Changeset 1105


Ignore:
Timestamp:
Mar 27, 2006, 12:06:20 AM (18 years ago)
Author:
rub
Message:

[NBM] Step 4: Screen NBM is available

o Add news parameters
o Add file functions_notification_by_mail.inc.php in order to use in future, these functions on php file of subscribe/unsubscribe
o Write a little html help file

+ improve mass_update in order to used binary fields (used collate and SHOW COLUMNS FROM)

Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r1082 r1105  
    744744    // creation of the temporary table
    745745    $query = '
    746 DESCRIBE '.$tablename.'
     746SHOW FULL COLUMNS FROM '.$tablename.'
    747747;';
    748748    $result = pwg_query($query);
     
    762762        {
    763763          $column.= " default '".$row['Default']."'";
     764        }
     765        if (isset($row['Collation']))
     766        {
     767          $column.= " collate '".$row['Collation']."'";
    764768        }
    765769        array_push($columns, $column);
  • trunk/admin/notification_by_mail.php

    r1094 r1105  
    3737
    3838include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    39 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     39include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php');
    4040include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
    4141include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php');
     
    5050// | functions                                                             |
    5151// +-----------------------------------------------------------------------+
     52
    5253/*
    53  * Search an available check_key
    54  *
    55  * It's a copy of function find_available_feed_id
    56  *
    57  * @return string feed identifier
     54 * Get the authorized_status for each tab
     55 * return corresponding status
     56*/
     57function get_tab_status($mode)
     58{
     59  $result = ACCESS_WEBMASTER;
     60  switch ($mode)
     61  {
     62    case 'param':
     63    case 'subscribe' :
     64      $result = ACCESS_WEBMASTER;
     65      break;
     66    case 'send' :
     67      $result = ACCESS_ADMINISTRATOR;
     68      break;
     69    default:
     70      $result = ACCESS_WEBMASTER;
     71      break;
     72  }
     73  return $result;
     74}
     75
     76/*
     77 * Inserting News users
    5878 */
    59 function find_available_check_key()
    60 {
    61   while (true)
    62   {
    63     $key = generate_key(128);
    64     $query = '
    65 select
    66   count(*)
    67 from
    68   '.USER_MAIL_NOTIFICATION_TABLE.'
    69 where
    70   check_key = \''.$key.'\';';
    71 
    72     list($count) = mysql_fetch_row(pwg_query($query));
    73     if ($count == 0)
    74     {
    75       return $key;
    76     }
    77   }
    78 }
    79 
    80 /*
    81  * Updating News users
    82  */
    83 function update_data_user_mail_notification()
     79function insert_new_data_user_mail_notification()
    8480{
    8581  global $conf, $page;
     
    9591  pwg_query($query);
    9692
     93  // null mail_address are not selected in the list
    9794  $query = '
    9895select
     
    111108  {
    112109    $inserts = array();
     110    $check_key_list = array();
    113111
    114112    while ($row = mysql_fetch_array($result))
    115113    {
    116       array_push($inserts, array('user_id' => $row['user_id'],
    117                                  'check_key' => find_available_check_key(),
    118                                  'enabled' => ($conf['default_value_user_mail_notification_enabled'] == true ? 'true' : 'false')));
     114      // Calculate key
     115      $row['check_key'] = find_available_check_key();
     116
     117      // Save key
     118      array_push($check_key_list, $row['check_key']);
     119
     120      // Insert new rows
     121      array_push
     122      (
     123        $inserts,
     124        array
     125        (
     126          'user_id' => $row['user_id'],
     127          'check_key' => $row['check_key'],
     128          'enabled' => 'false' // By default if false, set to true with specific functions
     129        )
     130      );
     131
    119132      array_push($page['infos'], sprintf(l10n('nbm_User %s [%s] added.'), $row['username'], $row['mail_address']));
    120133    }
    121134
     135    // Insert new rows
    122136    mass_inserts(USER_MAIL_NOTIFICATION_TABLE, array('user_id', 'check_key', 'enabled'), $inserts);
     137    // Update field enabled with specific function
     138    do_subscribe_unsubcribe_notification_by_mail
     139    (
     140      ($conf['default_value_user_mail_notification_enabled'] == true ? true : false),
     141      $check_key_list
     142    );
    123143  }
    124144}
    125145
    126146/*
    127  * Updating News users
     147 * Send mail for notification to all users
     148 * Return list of "treated/selected" users
    128149 */
    129 function send_all_user_mail_notification()
    130 {
    131   global $conf, $conf_mail, $page, $user, $lang_info, $lang;
     150function do_action_send_mail_notification($action = 'prepare', $check_key_list = array(), $customize_mail_content = '')
     151{
     152  global $conf, $page, $user, $lang_info, $lang;
    132153  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    133 
     154  $return_list = array();
     155  $is_action_send = ($action == 'send');
     156
     157  $quoted_check_key_list = quote_check_key_list($check_key_list);
     158  if (count($quoted_check_key_list) != 0 )
     159  {
     160    $query_and_check_key = ' and
     161  check_key in ('.implode(",", $quoted_check_key_list).') ';
     162  }
     163  else
     164  {
     165    $query_and_check_key = '';
     166  }
     167
     168  if (isset($customize_mail_content))
     169  {
     170    $customize_mail_content = $conf['nbm_complementary_mail_content'];
     171  }
     172
     173  // disabled and null mail_address are not selected in the list
    134174  $query = '
    135175select
    136   N.user_id, U.username, U.mail_address, N.last_send
     176  N.user_id, N.check_key, U.username, U.mail_address, N.last_send
    137177from
    138178  '.USER_MAIL_NOTIFICATION_TABLE.' as N,
     
    141181  N.user_id =  U.id and
    142182  N.enabled = \'true\' and
    143   U.mail_address is not null
     183  U.mail_address is not null'.$query_and_check_key.'
    144184order by
    145   user_id;';
     185  username;';
    146186
    147187  $result = pwg_query($query);
     
    150190  {
    151191    $error_on_mail_count = 0;
    152     $sended_mail_count = 0;
     192    $sent_mail_count = 0;
    153193    $datas = array();
    154194    // Save $user, $lang_info and $lang arrays (include/user.inc.php has been executed)
     
    157197    $sav_mailtousers_lang = $lang;
    158198    // Save message info and error in the original language
    159     $msg_info = l10n('nbm_Mail sended to %s [%s].');
     199    $msg_info = l10n('nbm_Mail sent to %s [%s].');
    160200    $msg_error = l10n('nbm_Error when sending email to %s [%s].');
    161201    // Last Language
    162202    $last_mailtousers_language = $user['language'];
     203
     204    if ($is_action_send)
     205    {
     206      // Init mail configuration
     207      $send_as_name = ((isset($conf['nbm_send_mail_as']) and !empty($conf['nbm_send_mail_as'])) ? $conf['nbm_send_mail_as'] : $conf['gallery_title']);
     208      $send_as_mail_address = get_webmaster_mail_address();
     209      $send_as_mail_formated = format_email($send_as_name, $send_as_mail_address);
     210    }
    163211
    164212    while ($row = mysql_fetch_array($result))
     
    187235      if (count($news) > 0)
    188236      {
    189         $subject = '['.$conf['gallery_title'].']: '.l10n('nbm_New elements added');
    190         $message .= sprintf(l10n('nbm_Hello %s'), $row['username']).",\n\n";
    191 
    192         if (!is_null($row['last_send']))
    193           $message .= sprintf(l10n('nbm_New elements were added between %s and %s:'), $row['last_send'], $dbnow);
    194         else
    195           $message .= sprintf(l10n('nbm_New elements were added on %s:'), $dbnow);
    196         $message .= "\n";
    197 
    198         foreach ($news as $line)
     237        array_push($return_list, $row);
     238
     239        if ($is_action_send)
    199240        {
    200           $message .= '  o '.$line."\n";
    201         }
    202 
    203         $message .= "\n".sprintf(l10n('nbm_Go to %s %s.'), $conf['gallery_title'], $conf['gallery_url'])."\n\n";
    204         $message .= "\n".sprintf(l10n('nbm_To unsubscribe send a message to %s.'), $conf_mail['email_webmaster'])."\n\n";
    205 
    206         if (pwg_mail(format_email($row['username'], $row['mail_address']), '', $subject, $message))
    207         {
    208           $sended_mail_count += 1;
    209           array_push($page['infos'], sprintf($msg_info, $row['username'], $row['mail_address']));
    210           $data = array('user_id' => $row['user_id'],
    211                         'last_send' => $dbnow);
    212           array_push($datas, $data);
    213         }
    214         else
    215         {
    216           $error_on_mail_count += 1;
    217           array_push($page['errors'], sprintf($msg_error, $row['username'], $row['mail_address']));
     241          $subject = '['.$conf['gallery_title'].']: '.l10n('nbm_ContentObject');
     242          $message .= sprintf(l10n('nbm_ContentHello'), $row['username']).",\n\n";
     243
     244          if (!is_null($row['last_send']))
     245            $message .= sprintf(l10n('nbm_ContentNewElementsBetween'), $row['last_send'], $dbnow);
     246          else
     247            $message .= sprintf(l10n('nbm_ContentNewElements'), $dbnow);
     248
     249          if ($conf['nbm_send_detailed_content'])
     250          {
     251            $message .= ":\n";
     252
     253            foreach ($news as $line)
     254            {
     255              $message .= '  o '.$line."\n";
     256            }
     257            $message .= "\n";
     258          }
     259          else
     260          {
     261            $message .= ".\n";
     262          }
     263
     264          $message .= sprintf(l10n('nbm_ContentGoTo'), $conf['gallery_title'], $conf['gallery_url'])."\n\n";
     265          $message .= $customize_mail_content."\n\n";
     266          $message .= l10n('nbm_ContentByeBye')."\n   ".$send_as_name."\n\n";
     267          $message .= "\n".sprintf(l10n('nbm_ContentUnsubscribe'), $send_as_mail_address)."\n\n";
     268
     269          if (pwg_mail(format_email($row['username'], $row['mail_address']), $send_as_mail_formated, $subject, $message))
     270          {
     271            $sent_mail_count += 1;
     272            array_push($page['infos'], sprintf($msg_info, $row['username'], $row['mail_address']));
     273            $data = array('user_id' => $row['user_id'],
     274                          'last_send' => $dbnow);
     275            array_push($datas, $data);
     276          }
     277          else
     278          {
     279            $error_on_mail_count += 1;
     280            array_push($page['errors'], sprintf($msg_error, $row['username'], $row['mail_address']));
     281          }
    218282        }
    219283      }
     
    225289    $lang = $sav_mailtousers_lang;
    226290
    227     mass_updates(
    228       USER_MAIL_NOTIFICATION_TABLE,
    229       array(
    230         'primary' => array('user_id'),
    231         'update' => array('last_send')
    232        ),
    233        $datas
    234        );
    235 
    236     if ($error_on_mail_count != 0)
    237     {
    238       array_push($page['errors'], sprintf(l10n('nbm_%d mails were not sended.'), $error_on_mail_count));
     291    if ($is_action_send)
     292    {
     293      mass_updates(
     294        USER_MAIL_NOTIFICATION_TABLE,
     295        array(
     296          'primary' => array('user_id'),
     297          'update' => array('last_send')
     298         ),
     299         $datas
     300         );
     301
     302      if ($error_on_mail_count != 0)
     303      {
     304        array_push($page['errors'], sprintf(l10n('nbm_%d mails were not sent.'), $error_on_mail_count));
     305      }
     306      else
     307      {
     308        if ($sent_mail_count == 0)
     309          array_push($page['infos'], l10n('nbm_No mail to send.'));
     310        else
     311          array_push($page['infos'], sprintf(l10n('nbm_%d mails were sent.'), $sent_mail_count));
     312      }
     313    }
     314  }
     315  else
     316  {
     317    if ($is_action_send)
     318    {
     319      array_push($page['errors'], l10n('nbm_No user to send notifications by mail.'));
     320    }
     321  }
     322  return $return_list;
     323}
     324
     325// +-----------------------------------------------------------------------+
     326// | Main                                                                  |
     327// +-----------------------------------------------------------------------+
     328if (!isset($_GET['mode']))
     329{
     330  $page['mode'] = 'send';
     331}
     332else
     333{
     334  $page['mode'] = $_GET['mode'];
     335}
     336
     337// +-----------------------------------------------------------------------+
     338// | Check Access and exit when user status is not ok                      |
     339// +-----------------------------------------------------------------------+
     340check_status(get_tab_status($page['mode']));
     341
     342// +-----------------------------------------------------------------------+
     343// | Insert new users with mails                                           |
     344// +-----------------------------------------------------------------------+
     345if (!isset($_POST) or (count($_POST) ==0))
     346{
     347  // No insert data in post mode
     348  insert_new_data_user_mail_notification();
     349}
     350
     351// +-----------------------------------------------------------------------+
     352// | Treatment of tab post                                                 |
     353// +-----------------------------------------------------------------------+
     354switch ($page['mode'])
     355{
     356  case 'param' :
     357  {
     358    $updated_param_count = 0;
     359    // Update param
     360    $result = pwg_query('select param, value from '.CONFIG_TABLE.' where param like \'nbm\\_%\'');
     361    while ($row = mysql_fetch_array($result))
     362    {
     363      if (isset($_POST['param_submit']))
     364      {
     365        if (isset($_POST[$row['param']]))
     366        {
     367          $value = $_POST[$row['param']];
     368
     369          $query = '
     370update
     371  '.CONFIG_TABLE.'
     372set
     373  value = \''. str_replace("\'", "''", $value).'\'
     374where
     375  param = \''.$row['param'].'\';';
     376          pwg_query($query);
     377          $updated_param_count += 1;
     378        }
     379      }
     380
     381      $conf[$row['param']] = $row['value'];
     382
     383      // if the parameter is present in $_POST array (if a form is submited), we
     384      // override it with the submited value
     385      if (isset($_POST[$row['param']]))
     386      {
     387        $conf[$row['param']] = stripslashes($_POST[$row['param']]);
     388      }
     389
     390      // If the field is true or false, the variable is transformed into a
     391      // boolean value.
     392      if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false')
     393      {
     394        $conf[$row['param']] = get_boolean($conf[$row['param']]);
     395      }
     396    }
     397   
     398    if ($updated_param_count != 0)
     399    {
     400      array_push($page['infos'], sprintf(l10n('nbm_updated_param_count'), $updated_param_count));
     401    }
     402  }
     403  case 'subscribe' :
     404  {
     405    if (isset($_POST['falsify']) and isset($_POST['cat_true']))
     406    {
     407      unsubcribe_notification_by_mail($_POST['cat_true']);
    239408    }
    240409    else
    241     {
    242       if ($sended_mail_count == 0)
    243         array_push($page['infos'], l10n('nbm_No mail to send.'));
    244       else
    245         array_push($page['infos'], sprintf(l10n('nbm_%d mails were sended.'), $sended_mail_count));
    246     }
    247   }
    248   else
    249   {
    250     array_push($page['errors'], l10n('nbm_No user to send notifications by mail.'));
    251   }
    252 }
    253 
    254 // +-----------------------------------------------------------------------+
    255 // | Main                                                                  |
    256 // +-----------------------------------------------------------------------+
    257 update_data_user_mail_notification();
    258 //send_all_user_mail_notification();
    259 
    260 if (!isset($_GET['mode']))
    261 {
    262   $page['mode'] = 'send';
    263 }
    264 else
    265 {
    266   $page['mode'] = $_GET['mode'];
     410    if (isset($_POST['trueify']) and isset($_POST['cat_false']))
     411    {
     412      subcribe_notification_by_mail($_POST['cat_false']);
     413    }
     414    break;
     415  }
     416
     417  case 'send' :
     418  {
     419    if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']))
     420    {
     421      do_action_send_mail_notification('send', $_POST['send_selection'], $_POST['send_customize_mail_content']);
     422    }
     423  }
    267424}
    268425
     
    270427// | template initialization                                               |
    271428// +-----------------------------------------------------------------------+
    272 $template->set_filenames(
    273   array(
     429$template->set_filenames
     430(
     431  array
     432  (
    274433    'double_select' => 'admin/double_select.tpl',
    275434    'notification_by_mail'=>'admin/notification_by_mail.tpl'
     435  )
     436);
     437
     438$base_url = get_root_url().'admin.php';
     439
     440$template->assign_vars
     441(
     442  array
     443  (
     444    'U_TABSHEET_TITLE' => l10n('nbm_'.$page['mode'].'_mode'),
     445    'U_HELP' => add_url_params(get_root_url().'/popuphelp.php', array('page' => 'notification_by_mail')),
     446    'F_ACTION'=> $base_url.get_query_string_diff(array())
     447  )
     448);
     449
     450if (is_autorize_status(ACCESS_WEBMASTER))
     451{
     452  $template->assign_block_vars
     453  (
     454    'header_link',
     455    array
     456    (
     457      'PARAM_MODE' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'param')),
     458      'SUBSCRIBE_MODE' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'subscribe')),
     459      'SEND_MODE' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'send'))
    276460    )
    277461  );
    278 
    279 $base_url = get_root_url().'admin.php';
    280 
    281 $template->assign_vars(
    282   array(
    283     'U_TABSHEET_TITLE' => l10n('nbm_'.$page['mode'].'_mode'),
    284     'U_HELP' => add_url_params(get_root_url().'/popuphelp.php', array('page'=>'notification_by_mail') ),
    285     'U_PARAM_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'param') ),
    286     'U_SUBSCRIBE_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'subscribe') ),
    287     'U_SEND_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'send') ),
    288     'F_ACTION'=> $base_url.get_query_string_diff(array())
    289     ));
     462}
    290463
    291464switch ($page['mode'])
     
    296469      $page['mode'],
    297470      array(
    298         //'HISTORY_YES'=>$history_yes
     471        'SEND_MAIL_AS' => $conf['nbm_send_mail_as'],
     472        'SEND_DETAILED_CONTENT_YES' => ($conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''),
     473        'SEND_DETAILED_CONTENT_NO' => (!$conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''),
     474        'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content']
    299475        ));
    300476    break;
    301477  }
     478
    302479  case 'subscribe' :
    303480  {
     
    305482      $page['mode'],
    306483      array(
    307         //'HISTORY_YES'=>$history_yes
    308484        ));
    309485
     
    315491      );
    316492
    317 
    318 /*    $template->assign_block_vars(
    319       $blockname,
    320       array('SELECTED'=>$selected,
    321             'VALUE'=>$category['id'],
    322             'OPTION'=>$option
    323         ));*/
    324     $template->assign_block_vars(
    325       'category_option_true',
    326       array('SELECTED'=>'',
    327             'VALUE'=>'rub',
    328             'OPTION'=>'rub [rub@phpwebgallery.net]'
    329         ));
     493    $query = '
     494select
     495  N.check_key, N.enabled, U.username, U.mail_address
     496from
     497  '.USER_MAIL_NOTIFICATION_TABLE.' as N,
     498  '.USERS_TABLE.' as U
     499where
     500  N.user_id =  U.id
     501order by
     502  username;';
     503
     504    $result = pwg_query($query);
     505    if (!empty($result))
     506    {
     507      while ($row = mysql_fetch_array($result))
     508      {
     509        $template->assign_block_vars(
     510          (get_boolean($row['enabled']) ? 'category_option_true' : 'category_option_false'),
     511          array('SELECTED' => '',
     512                'VALUE' => $row['check_key'],
     513                'OPTION' => $row['username'].'['.$row['mail_address'].']'
     514            ));
     515      }
     516    }
    330517
    331518    break;
    332519  }
     520
    333521  case 'send' :
    334522  {
    335     $template->assign_block_vars(
    336       $page['mode'],
    337       array(
    338         //'HISTORY_YES'=>$history_yes
    339         ));
    340 
    341     $template->assign_vars(
    342       array(
    343         'L_CAT_OPTIONS_TRUE' => l10n('nbm_send_col'),
    344         'L_CAT_OPTIONS_FALSE' => l10n('nbm_nosend_col')
    345         )
    346       );
    347 
    348 
    349 /*    $template->assign_block_vars(
    350       $blockname,
    351       array('SELECTED'=>$selected,
    352             'VALUE'=>$category['id'],
    353             'OPTION'=>$option
    354         ));*/
    355     $template->assign_block_vars(
    356       'category_option_true',
    357       array('SELECTED'=>' selected="selected"',
    358             'VALUE'=>'rub',
    359             'OPTION'=>'rub [2006-03-20 23:35:23]'
    360         ));
     523    $template->assign_block_vars($page['mode'], array());
     524
     525    $data_rows = do_action_send_mail_notification('prepare');
     526
     527    if  (count($data_rows) == 0)
     528    {
     529      $template->assign_block_vars($page['mode'].'.send_empty', array());
     530    }
     531    else
     532    {
     533      $template->assign_block_vars(
     534        $page['mode'].'.send_data',
     535        array(
     536  //        'URL_CHECK_ALL' => add_url_params($base_url.get_query_string_diff(array('select')), array('select' => 'all')),
     537  //        'URL_UNCHECK_ALL' => add_url_params($base_url.get_query_string_diff(array('select')), array('select' => 'none')),
     538          'CUSTOMIZE_MAIL_CONTENT' => isset($_POST['send_customize_mail_content']) ? $_POST['send_customize_mail_content'] : $conf['nbm_complementary_mail_content']
     539          ));
     540
     541      foreach ($data_rows as $num => $local_user)
     542          $template->assign_block_vars(
     543            $page['mode'].'.send_data.user_send_mail',
     544            array(
     545              'CLASS' => ($num % 2 == 1) ? 'row2' : 'row1',
     546              'ID' => $local_user['check_key'],
     547              'CHECKED' => isset($_POST['send_uncheck_all']) ? '' : 'checked="checked"',
     548              'USERNAME'=> $local_user['username'],
     549              'EMAIL' => $local_user['mail_address'],
     550              'LAST_SEND'=> $local_user['last_send']
     551              ));
     552    }
    361553
    362554    break;
    363555  }
    364556}
    365 
    366 // +-----------------------------------------------------------------------+
    367 // | infos & errors display                                                |
    368 // +-----------------------------------------------------------------------+
    369 
    370 /*echo '<pre>';
    371 
    372 if (count($page['errors']) != 0)
    373 {
    374   echo "\n\nErrors:\n";
    375   foreach ($page['errors'] as $error)
    376   {
    377     echo $error."\n";
    378   }
    379 }
    380 
    381 if (count($page['infos']) != 0)
    382 {
    383   echo "\n\nInformations:\n";
    384   foreach ($page['infos'] as $info)
    385   {
    386     echo $info."\n";
    387   }
    388 }
    389 
    390 echo '</pre>';
    391 */
    392557
    393558// +-----------------------------------------------------------------------+
  • trunk/include/functions_mail.inc.php

    r1021 r1105  
    3030 * - Extract mail fonctions of password.php
    3131 * - Modify pwg_mail (add pararameters + news fonctionnalities)
    32  * - Var conf_mail, function init_conf_mail, function format_email
     32 * - Var conf_mail, function get_mail_configuration, format_email, pwg_mail
    3333 */
    3434
     
    134134  }
    135135}
     136
    136137?>
  • trunk/install/config.sql

    r1071 r1105  
    2121INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('page_banner','<div id=\"theHeader\"><h1>PhpWebGallery demonstration site</h1><p>My photos web site</p></div>','html displayed on the top each page of your gallery');
    2222
     23-- Notification by mail
     24INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail');
     25INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_detailed_content','true','Send detailed content for notification by mail');
     26INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_complementary_mail_content','','Complementary mail content for notification by mail');
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r1091 r1105  
    239239$lang['metadata_iptc'] = 'IPTC';
    240240$lang['name'] = 'name';
    241 $lang['nbm_%d mails were not sended.'] = '%d mails were not sended.';
    242 $lang['nbm_%d mails were sended.'] = '%d mails were sended.';
     241$lang['nbm_%d mails were not sent.'] = '%d mails were not sent.';
     242$lang['nbm_%d mails were sent.'] = '%d mails were sent.';
    243243$lang['nbm_Error when sending email to %s [%s].'] = 'Error when sending email to %s [%s].';
    244 $lang['nbm_Go to %s %s.'] = 'Go to %s %s.';
    245 $lang['nbm_Hello %s'] = 'Hello %s';
    246 $lang['nbm_Mail sended to %s [%s].'] = 'Mail sended to %s [%s].';
    247 $lang['nbm_New elements added'] = 'New elements added';
    248 $lang['nbm_New elements were added between %s and %s:'] = 'New elements were added between %s and %s:';
    249 $lang['nbm_New elements were added on %s:'] = 'New elements were added on %s:';
     244$lang['nbm_Mail sent to %s [%s].'] = 'Mail sent to %s [%s].';
     245$lang['nbm_ContentObject'] = 'New elements added';
     246$lang['nbm_ContentHello'] = 'Hello %s';
     247$lang['nbm_ContentNewElementsBetween'] = 'New elements were added between %s and %s';
     248$lang['nbm_ContentNewElements'] = 'New elements were added on %s';
     249$lang['nbm_ContentGoTo'] = 'Go to %s %s.';
     250$lang['nbm_ContentByeBye'] = 'See you soon';
     251$lang['nbm_ContentUnsubscribe'] = 'To unsubscribe send a message to %s.';
    250252$lang['nbm_No mail to send.'] = 'No mail to send.';
    251253$lang['nbm_No user to send notifications by mail.'] = 'No user to send notifications by mail.';
    252254$lang['nbm_Send mail to users'] = 'Send mail to users';
    253 $lang['nbm_To unsubscribe send a message to %s.'] = 'To unsubscribe send a message to %s.';
    254255$lang['nbm_User %s [%s] added.'] = 'User %s [%s] added.';
    255256$lang['nbm_item_notification'] = 'Notification';
     
    258259$lang['nbm_send_mode'] = 'Send';
    259260$lang['nbm_title_param'] = 'Parameters';
     261$lang['nbm_updated_param_count'] = '%d parameters are updated.';
     262$lang['nbm_send_mail_as'] = 'Send mail as';
     263$lang['nbm_info_send_mail_as'] = 'With blank value, gallery title will be used';
    260264$lang['nbm_send_detailed_content'] = 'Send detailed content';
    261265$lang['nbm_complementary_mail_content'] = 'Complementary mail content';
     
    264268$lang['nbm_subscribe_col'] = 'Subscribed';
    265269$lang['nbm_unsubscribe_col'] = 'Unsubcribed';
     270$lang['nbm_no_user_available_to_send_L1'] = 'No user are available in order to send mail.';
     271$lang['nbm_no_user_available_to_send_L2'] = 'A user is available, if the are news elements to notify';
    266272$lang['nbm_title_send'] = 'Select sendings';
     273$lang['nbm_col_user'] = 'User';
     274$lang['nbm_col_mail'] = 'email';
     275$lang['nbm_col_last_send'] = 'Last send';
     276$lang['nbm_col_check_user_send_mail'] = 'To send ?';
     277$lang['nbm_send_options'] = 'Options';
     278$lang['nbm_send_complementary_mail_content'] = 'Complementary mail content';
    267279$lang['nbm_send_submit'] = 'Send';
    268 $lang['nbm_send_col'] = 'To send';
    269 $lang['nbm_nosend_col'] = 'No to send';
     280$lang['nbm_send_check_all'] = 'Check All';
     281$lang['nbm_send_uncheck_all'] = 'Uncheck All';
     282$lang['nbm_user_change_enabled_true'] = 'User %s [%s] added to subscribe list.';
     283$lang['nbm_user_change_enabled_false'] = 'User %s [%s] removed of subscribe list.';
     284$lang['nbm_user_change_enabled_updated_data_count'] = '%d user(s) are updated.';
    270285$lang['no_write_access'] = 'no write access';
    271286$lang['order_by'] = 'order by';
  • trunk/language/en_UK.iso-8859-1/help/notification_by_mail.html

    r1091 r1105  
    11<h2>Notification by mail</h2>
    22
     3<p>This screen allows to configure, to manage the notification to users of news sendinf mail.</p>
     4
     5<p>This screen is composed of 3 tabs:</p>
     6
     7<h3>Parameters</h3>
     8<p>Available only for webmasters, this tab sets parameters of the notification by mail.</p>
     9
     10<h3>Subscribe</h3>
     11<p>Available only for webmasters, this tab manages subscribe/unsubscribe of notification by mail.</p>
     12
     13<h3>Envoi</h3>
     14<p>Available only for webmasters and administrators, this tab allows to send mails to notify news.</p>
     15
  • trunk/language/fr_FR.iso-8859-1/admin.lang.php

    r1091 r1105  
    239239$lang['metadata_iptc'] = 'IPTC';
    240240$lang['name'] = 'nom';
    241 $lang['nbm_%d mails were not sended.'] = '%s mails n\'ont pas été envoyés.';
    242 $lang['nbm_%d mails were sended.'] = '%s mails ont été envoyés.';
     241$lang['nbm_%d mails were not sent.'] = '%s mails n\'ont pas été envoyés.';
     242$lang['nbm_%d mails were sent.'] = '%s mails ont été envoyés.';
    243243$lang['nbm_Error when sending email to %s [%s].'] = 'Erreur lors de l\'envoi du mail à %s [%s].';
    244 $lang['nbm_Go to %s %s.'] = 'Allez sur %s %s.';
    245 $lang['nbm_Hello %s'] = 'Bonjour %s';
    246 $lang['nbm_Mail sended to %s [%s].'] = 'Mail envoyé à %s [%s].';
    247 $lang['nbm_New elements added'] = 'Nouveaux éléments ajoutés';
    248 $lang['nbm_New elements were added between %s and %s:'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s:';
    249 $lang['nbm_New elements were added on %s:'] = 'Des nouveaux éléments ont été ajoutés le %s:';
     244$lang['nbm_Mail sent to %s [%s].'] = 'Mail envoyé à %s [%s].';
     245$lang['nbm_ContentObject'] = 'Nouveaux éléments ajoutés';
     246$lang['nbm_ContentHello'] = 'Bonjour %s';
     247$lang['nbm_ContentNewElementsBetween'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s';
     248$lang['nbm_ContentNewElements'] = 'Des nouveaux éléments ont été ajoutés le %s';
     249$lang['nbm_ContentGoTo'] = 'Rendez-vous sur %s %s.';
     250$lang['nbm_ContentByeBye'] = 'A bientôt';
     251$lang['nbm_ContentUnsubscribe'] = 'Pour vous désinscrire, envoyer un mail à %s.';
    250252$lang['nbm_No mail to send.'] = 'Pas de mail à envoyer.';
    251253$lang['nbm_No user to send notifications by mail.'] = 'Pas d\'utilisateur pour envoyer des notifications par mails.';
    252254$lang['nbm_Send mail to users'] = 'Envoi de mail aux utilisateurs';
    253 $lang['nbm_To unsubscribe send a message to %s.'] = 'Pour vous désinscrire, envoyer un mail à %s.';
    254255$lang['nbm_User %s [%s] added.'] = 'Utilisateur %s [%s] ajouté.';
    255256$lang['nbm_item_notification'] = 'Notification';
     
    258259$lang['nbm_send_mode'] = 'Envoi';
    259260$lang['nbm_title_param'] = 'Paramètres';
     261$lang['nbm_updated_param_count'] = '%d paramètres ont été mis à jour.';
     262$lang['nbm_send_mail_as'] = 'Envoyer le mail en tant que';
     263$lang['nbm_info_send_mail_as'] = 'Sans valeur, le titre de la galerie sera utilisé';
    260264$lang['nbm_send_detailed_content'] = 'Envoi d\'un contenu détaillé';
    261265$lang['nbm_complementary_mail_content'] = 'Contenu complémentaire au mail';
     
    264268$lang['nbm_subscribe_col'] = 'Inscrits';
    265269$lang['nbm_unsubscribe_col'] = 'Non Inscrits';
     270$lang['nbm_no_user_available_to_send_L1'] = 'Il n\'y a pas d\'utilisateur à notifier par mail.';
     271$lang['nbm_no_user_available_to_send_L2'] = 'Un utilisateur est à notifier si de nouveaux éléments sont disponibles pour cet utilisateur.';
    266272$lang['nbm_title_send'] = 'Sélection des envois';
     273$lang['nbm_col_user'] = 'Utilisateur';
     274$lang['nbm_col_mail'] = 'email';
     275$lang['nbm_col_last_send'] = 'Dernier envoi';
     276$lang['nbm_col_check_user_send_mail'] = 'A envoyer ?';
     277$lang['nbm_send_options'] = 'Options';
     278$lang['nbm_send_complementary_mail_content'] = 'Contenu complémentaire du mail';
    267279$lang['nbm_send_submit'] = 'Envoyer';
    268 $lang['nbm_send_col'] = 'A envoyer';
    269 $lang['nbm_nosend_col'] = 'A ne pas envoyer';
     280$lang['nbm_send_check_all'] = 'Tout cocher';
     281$lang['nbm_send_uncheck_all'] = 'Tout décocher';
     282$lang['nbm_user_change_enabled_true'] = 'L\'utilisateur %s [%s] a été ajouté à la liste des inscrits.';
     283$lang['nbm_user_change_enabled_false'] = 'L\'utilisateur %s [%s] a été supprimé de la liste des inscrits.';
     284$lang['nbm_user_change_enabled_updated_data_count'] = '%d utilisateur(s) a(ont) été mis à jour.';
    270285$lang['no_write_access'] = 'pas d\'accès en écriture';
    271286$lang['order_by'] = 'trier selon';
  • trunk/language/fr_FR.iso-8859-1/help/notification_by_mail.html

    r1099 r1105  
    1 <h2>Avertissement par mail</h2>
     1<h2>Notification par mail</h2>
    22
     3<p>Cet écran permet de configurer, de gérer la notification aux utilisateurs de changements par l'envoi d'un mail.</p>
     4
     5<p>Cet écran est composé de 3 onglets:</p>
     6
     7<h3>Paramètrage</h3>
     8<p>Accésible uniquement aux webmestres, cet onglet permet de positionner les paramètres de la notification par mail.</p>
     9
     10<h3>Inscription</h3>
     11<p>Accésible uniquement aux webmestres, cet onglet permet de gérer les inscriptions/désinscriptions à la notification par mail.</p>
     12
     13<h3>Envoi</h3>
     14<p>Accésible aux webmestres et aux administrateurs, cet onglet permet d'effectuer les envois des mails pour notifier les changements.</p>
     15
  • trunk/template/yoga/admin/notification_by_mail.tpl

    r1091 r1105  
    55  </ul>
    66  <h2>{lang:nbm_Send mail to users} [{U_TABSHEET_TITLE}]</h2>
     7  <!-- BEGIN header_link -->
    78  <h3>
    89    <p style="text-align:center;">
    9       <a href="{U_PARAM_MODE}">{lang:nbm_param_mode}</a> |
    10       <a href="{U_SUBSCRIBE_MODE}">{lang:nbm_subscribe_mode}</a> |
    11       <a href="{U_SEND_MODE}">{lang:nbm_send_mode}</a>
     10      <a href="{header_link.PARAM_MODE}">{lang:nbm_param_mode}</a> |
     11      <a href="{header_link.SUBSCRIBE_MODE}">{lang:nbm_subscribe_mode}</a> |
     12      <a href="{header_link.SEND_MODE}">{lang:nbm_send_mode}</a>
    1213    </p>
    1314  </h3>
     15  <!-- END header_link -->
    1416</div>
    1517
     
    2224    <table>
    2325      <tr>
     26     <tr>
     27        <td>
     28          <label for="send_mail_as">{lang:nbm_send_mail_as}</label>
     29          <br><i><small>{lang:nbm_info_send_mail_as}</small></i>
     30        </td>
     31        <td><input type="text" maxlength="35" size="35" name="nbm_send_mail_as" id="send_mail_as" value="{param.SEND_MAIL_AS}"/></td>
     32      </tr>
    2433        <td><label for="send_detailed_content">{lang:nbm_send_detailed_content} </label></td>
    25         <td><input type="checkbox" name="send_detailed_content" id="send_detailed_content" value="true" {param.SEND_DETAILED_CONTENT}/></td>
     34        <td>
     35          <label><input type="radio" name="nbm_send_detailed_content" value="true"  {param.SEND_DETAILED_CONTENT_YES}/>{lang:yes}</label>
     36          <label><input type="radio" name="nbm_send_detailed_content" value="false" {param.SEND_DETAILED_CONTENT_NO}/>{lang:no}</label>
     37        </td>
    2638      </tr>
    2739     <tr>
    2840        <td><label for="complementary_mail_content">{lang:nbm_complementary_mail_content} </label></td>
    29         <td><textarea cols="50" rows="5" name="complementary_mail_content" id="complementary_mail_content">{param.COMPLEMENTARY_MAIL_CONTENT}</textarea></td>
     41        <td><textarea cols="50" rows="5" name="nbm_complementary_mail_content" id="complementary_mail_content">{param.COMPLEMENTARY_MAIL_CONTENT}</textarea></td>
    3042      </tr>
    3143    </table>
     
    3345
    3446  <p>
    35     <input type="submit" value="{lang:Submit}" name="param_submit" {TAG_INPUT_ENABLED} />
    36     <input type="reset" value="{lang:Reset}" name="param_reset" />
     47    <input type="submit" value="{lang:Submit}" name="param_submit" {TAG_INPUT_ENABLED}/>
     48    <input type="reset" value="{lang:Reset}" name="param_reset"/>
    3749  </p>
    3850  <!-- END param -->
     
    4153  <fieldset>
    4254    <legend><strong>{lang:nbm_title_subscribe}</strong></legend>
    43     <legend><center><i>{lang:nbm_warning_subscribe_unsubcribe}</i></center></legend>
     55    <br><center><i>{lang:nbm_warning_subscribe_unsubcribe}</i></center><br>
    4456    {DOUBLE_SELECT}
    4557  </fieldset>
     
    4759
    4860  <!-- BEGIN send -->
    49   <fieldset>
    50     <legend><strong>{lang:nbm_title_send}</strong></legend>
    51     {DOUBLE_SELECT}
    52   </fieldset>
     61    <!-- BEGIN send_empty -->
     62    <center>
     63      {lang:nbm_no_user_available_to_send_L1}<br>
     64      {lang:nbm_no_user_available_to_send_L2}
     65    </center>
     66    <!-- END send_empty -->
     67    <!-- BEGIN send_data -->
     68    <fieldset>
     69      <legend><strong>{lang:nbm_title_send}</strong></legend>
     70      <table class="table2">
     71        <tr class="throw">
     72          <th>{lang:nbm_col_user}</th>
     73          <th>{lang:nbm_col_mail}</th>
     74          <th>{lang:nbm_col_last_send}</th>
     75          <th>{lang:nbm_col_check_user_send_mail}</th>
     76        </tr>
     77        <!-- BEGIN user_send_mail -->
     78        <tr class="{send.send_data.user_send_mail.CLASS}">
     79          <td><label for="send_selection-{send.send_data.user_send_mail.ID}">{send.send_data.user_send_mail.USERNAME}</label></td>
     80          <td><label for="send_selection-{send.send_data.user_send_mail.ID}">{send.send_data.user_send_mail.EMAIL}</label></td>
     81          <td><label for="send_selection-{send.send_data.user_send_mail.ID}">{send.send_data.user_send_mail.LAST_SEND}</label></td>
     82          <td><input type="checkbox" name="send_selection[]" value="{send.send_data.user_send_mail.ID}" {send.send_data.user_send_mail.CHECKED} id="send_selection-{send.send_data.user_send_mail.ID}"/></td>
     83        </tr>
     84        <!-- END user_send_mail -->
     85      </table>
     86  <!--
     87      <p>
     88          <a href="{send.send_data.URL_CHECK_ALL}">{lang:nbm_send_check_all}</a>
     89        / <a href="{send.send_data.URL_UNCHECK_ALL}">{lang:nbm_send_uncheck_all}</a>
     90      </p>
     91  -->
     92      <p>
     93        <input type="submit" value="{lang:nbm_send_check_all}" name="send_check_all"/>
     94        /
     95        <input type="submit" value="{lang:nbm_send_uncheck_all}" name="send_uncheck_all"/>
     96      </p>
     97    </fieldset>
    5398
    54   <p>
    55     <input type="submit" value="{lang:nbm_send_submit}" name="sene_submit" {TAG_INPUT_ENABLED} />
    56     <input type="reset" value="{lang:Reset}" name="send_reset" />
    57   </p>
     99    <fieldset>
     100      <legend><strong>{lang:nbm_send_options}</strong></legend>
     101
     102      <table>
     103       <tr>
     104          <td><label for="send_customize_mail_content">{lang:nbm_send_complementary_mail_content} </label></td>
     105          <td><textarea cols="50" rows="5" name="send_customize_mail_content" id="send_customize_mail_content">{send.send_data.CUSTOMIZE_MAIL_CONTENT}</textarea></td>
     106        </tr>
     107      </table>
     108    </fieldset>
     109
     110    <p>
     111      <input type="submit" value="{lang:nbm_send_submit}" name="send_submit" {TAG_INPUT_ENABLED}/>
     112    </p>
     113    <!-- END send_data -->
    58114  <!-- END send -->
    59115
Note: See TracChangeset for help on using the changeset viewer.