From d63d25a61d2a7bf9272f78c73fbce6a7a3ff6eee Mon Sep 17 00:00:00 2001 From: rub Date: Sun, 26 Mar 2006 22:06:20 +0000 Subject: [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) git-svn-id: http://piwigo.org/svn/trunk@1105 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 6 +- .../include/functions_notification_by_mail.inc.php | 168 +++++++ admin/notification_by_mail.php | 485 ++++++++++++++------- include/functions_mail.inc.php | 3 +- install/config.sql | 4 + install/db/17-database.php | 64 +++ language/en_UK.iso-8859-1/admin.lang.php | 37 +- .../help/notification_by_mail.html | 13 + language/fr_FR.iso-8859-1/admin.lang.php | 37 +- .../help/notification_by_mail.html | 15 +- template/yoga/admin/notification_by_mail.tpl | 88 +++- 11 files changed, 719 insertions(+), 201 deletions(-) create mode 100644 admin/include/functions_notification_by_mail.inc.php create mode 100644 install/db/17-database.php diff --git a/admin/include/functions.php b/admin/include/functions.php index 076c69fb4..4dd2869ef 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -743,7 +743,7 @@ UPDATE '.$tablename.' { // creation of the temporary table $query = ' -DESCRIBE '.$tablename.' +SHOW FULL COLUMNS FROM '.$tablename.' ;'; $result = pwg_query($query); $columns = array(); @@ -762,6 +762,10 @@ DESCRIBE '.$tablename.' { $column.= " default '".$row['Default']."'"; } + if (isset($row['Collation'])) + { + $column.= " collate '".$row['Collation']."'"; + } array_push($columns, $column); } } diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php new file mode 100644 index 000000000..31753c7de --- /dev/null +++ b/admin/include/functions_notification_by_mail.inc.php @@ -0,0 +1,168 @@ + $row['check_key'], + 'enabled' => $enabled_value + ) + ); + $updated_data_count += 1; + array_push($page['infos'], sprintf($msg_info, $row['username'], $row['mail_address'])); + } + + mass_updates( + USER_MAIL_NOTIFICATION_TABLE, + array( + 'primary' => array('check_key'), + 'update' => array('enabled') + ), + $updates + ); + } + } + + array_push($page['infos'], sprintf(l10n('nbm_user_change_enabled_updated_data_count'), $updated_data_count)); + + return $updated_data_count; +} + +/* + * Unsubscribe notification by mail + * + * check_key list where action will be done + * + * @return updated data count + */ +function unsubcribe_notification_by_mail($check_key_list = array()) +{ + return do_subscribe_unsubcribe_notification_by_mail(false, $check_key_list); +} + +/* + * Subscribe notification by mail + * + * check_key list where action will be done + * + * @return updated data count + */ +function subcribe_notification_by_mail($check_key_list = array()) +{ + return do_subscribe_unsubcribe_notification_by_mail(true, $check_key_list); +} + +?> \ No newline at end of file diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php index db92b8e72..c6212299a 100644 --- a/admin/notification_by_mail.php +++ b/admin/notification_by_mail.php @@ -36,7 +36,7 @@ if (!defined('PHPWG_ROOT_PATH')) } include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); -include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); +include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php'); include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); @@ -49,38 +49,34 @@ check_status(ACCESS_ADMINISTRATOR); // +-----------------------------------------------------------------------+ // | functions | // +-----------------------------------------------------------------------+ + /* - * Search an available check_key - * - * It's a copy of function find_available_feed_id - * - * @return string feed identifier - */ -function find_available_check_key() + * Get the authorized_status for each tab + * return corresponding status +*/ +function get_tab_status($mode) { - while (true) + $result = ACCESS_WEBMASTER; + switch ($mode) { - $key = generate_key(128); - $query = ' -select - count(*) -from - '.USER_MAIL_NOTIFICATION_TABLE.' -where - check_key = \''.$key.'\';'; - - list($count) = mysql_fetch_row(pwg_query($query)); - if ($count == 0) - { - return $key; - } + case 'param': + case 'subscribe' : + $result = ACCESS_WEBMASTER; + break; + case 'send' : + $result = ACCESS_ADMINISTRATOR; + break; + default: + $result = ACCESS_WEBMASTER; + break; } + return $result; } /* - * Updating News users + * Inserting News users */ -function update_data_user_mail_notification() +function insert_new_data_user_mail_notification() { global $conf, $page; @@ -94,6 +90,7 @@ where trim(mail_address) = \'\';'; pwg_query($query); + // null mail_address are not selected in the list $query = ' select u.id user_id, u.username, u.mail_address @@ -110,57 +107,108 @@ order by if (mysql_num_rows($result) > 0) { $inserts = array(); + $check_key_list = array(); while ($row = mysql_fetch_array($result)) { - array_push($inserts, array('user_id' => $row['user_id'], - 'check_key' => find_available_check_key(), - 'enabled' => ($conf['default_value_user_mail_notification_enabled'] == true ? 'true' : 'false'))); + // Calculate key + $row['check_key'] = find_available_check_key(); + + // Save key + array_push($check_key_list, $row['check_key']); + + // Insert new rows + array_push + ( + $inserts, + array + ( + 'user_id' => $row['user_id'], + 'check_key' => $row['check_key'], + 'enabled' => 'false' // By default if false, set to true with specific functions + ) + ); + array_push($page['infos'], sprintf(l10n('nbm_User %s [%s] added.'), $row['username'], $row['mail_address'])); } + // Insert new rows mass_inserts(USER_MAIL_NOTIFICATION_TABLE, array('user_id', 'check_key', 'enabled'), $inserts); + // Update field enabled with specific function + do_subscribe_unsubcribe_notification_by_mail + ( + ($conf['default_value_user_mail_notification_enabled'] == true ? true : false), + $check_key_list + ); } } /* - * Updating News users + * Send mail for notification to all users + * Return list of "treated/selected" users */ -function send_all_user_mail_notification() +function do_action_send_mail_notification($action = 'prepare', $check_key_list = array(), $customize_mail_content = '') { - global $conf, $conf_mail, $page, $user, $lang_info, $lang; + global $conf, $page, $user, $lang_info, $lang; list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); + $return_list = array(); + $is_action_send = ($action == 'send'); + + $quoted_check_key_list = quote_check_key_list($check_key_list); + if (count($quoted_check_key_list) != 0 ) + { + $query_and_check_key = ' and + check_key in ('.implode(",", $quoted_check_key_list).') '; + } + else + { + $query_and_check_key = ''; + } + if (isset($customize_mail_content)) + { + $customize_mail_content = $conf['nbm_complementary_mail_content']; + } + + // disabled and null mail_address are not selected in the list $query = ' select - N.user_id, U.username, U.mail_address, N.last_send + N.user_id, N.check_key, U.username, U.mail_address, N.last_send from '.USER_MAIL_NOTIFICATION_TABLE.' as N, '.USERS_TABLE.' as U where N.user_id = U.id and N.enabled = \'true\' and - U.mail_address is not null + U.mail_address is not null'.$query_and_check_key.' order by - user_id;'; + username;'; $result = pwg_query($query); if (mysql_num_rows($result) > 0) { $error_on_mail_count = 0; - $sended_mail_count = 0; + $sent_mail_count = 0; $datas = array(); // Save $user, $lang_info and $lang arrays (include/user.inc.php has been executed) $sav_mailtousers_user = $user; $sav_mailtousers_lang_info = $lang_info; $sav_mailtousers_lang = $lang; // Save message info and error in the original language - $msg_info = l10n('nbm_Mail sended to %s [%s].'); + $msg_info = l10n('nbm_Mail sent to %s [%s].'); $msg_error = l10n('nbm_Error when sending email to %s [%s].'); // Last Language $last_mailtousers_language = $user['language']; + if ($is_action_send) + { + // Init mail configuration + $send_as_name = ((isset($conf['nbm_send_mail_as']) and !empty($conf['nbm_send_mail_as'])) ? $conf['nbm_send_mail_as'] : $conf['gallery_title']); + $send_as_mail_address = get_webmaster_mail_address(); + $send_as_mail_formated = format_email($send_as_name, $send_as_mail_address); + } + while ($row = mysql_fetch_array($result)) { $user = array(); @@ -186,35 +234,51 @@ order by $news = news($row['last_send'], $dbnow); if (count($news) > 0) { - $subject = '['.$conf['gallery_title'].']: '.l10n('nbm_New elements added'); - $message .= sprintf(l10n('nbm_Hello %s'), $row['username']).",\n\n"; - - if (!is_null($row['last_send'])) - $message .= sprintf(l10n('nbm_New elements were added between %s and %s:'), $row['last_send'], $dbnow); - else - $message .= sprintf(l10n('nbm_New elements were added on %s:'), $dbnow); - $message .= "\n"; + array_push($return_list, $row); - foreach ($news as $line) + if ($is_action_send) { - $message .= ' o '.$line."\n"; - } - - $message .= "\n".sprintf(l10n('nbm_Go to %s %s.'), $conf['gallery_title'], $conf['gallery_url'])."\n\n"; - $message .= "\n".sprintf(l10n('nbm_To unsubscribe send a message to %s.'), $conf_mail['email_webmaster'])."\n\n"; - - if (pwg_mail(format_email($row['username'], $row['mail_address']), '', $subject, $message)) - { - $sended_mail_count += 1; - array_push($page['infos'], sprintf($msg_info, $row['username'], $row['mail_address'])); - $data = array('user_id' => $row['user_id'], - 'last_send' => $dbnow); - array_push($datas, $data); - } - else - { - $error_on_mail_count += 1; - array_push($page['errors'], sprintf($msg_error, $row['username'], $row['mail_address'])); + $subject = '['.$conf['gallery_title'].']: '.l10n('nbm_ContentObject'); + $message .= sprintf(l10n('nbm_ContentHello'), $row['username']).",\n\n"; + + if (!is_null($row['last_send'])) + $message .= sprintf(l10n('nbm_ContentNewElementsBetween'), $row['last_send'], $dbnow); + else + $message .= sprintf(l10n('nbm_ContentNewElements'), $dbnow); + + if ($conf['nbm_send_detailed_content']) + { + $message .= ":\n"; + + foreach ($news as $line) + { + $message .= ' o '.$line."\n"; + } + $message .= "\n"; + } + else + { + $message .= ".\n"; + } + + $message .= sprintf(l10n('nbm_ContentGoTo'), $conf['gallery_title'], $conf['gallery_url'])."\n\n"; + $message .= $customize_mail_content."\n\n"; + $message .= l10n('nbm_ContentByeBye')."\n ".$send_as_name."\n\n"; + $message .= "\n".sprintf(l10n('nbm_ContentUnsubscribe'), $send_as_mail_address)."\n\n"; + + if (pwg_mail(format_email($row['username'], $row['mail_address']), $send_as_mail_formated, $subject, $message)) + { + $sent_mail_count += 1; + array_push($page['infos'], sprintf($msg_info, $row['username'], $row['mail_address'])); + $data = array('user_id' => $row['user_id'], + 'last_send' => $dbnow); + array_push($datas, $data); + } + else + { + $error_on_mail_count += 1; + array_push($page['errors'], sprintf($msg_error, $row['username'], $row['mail_address'])); + } } } } @@ -224,39 +288,43 @@ order by $lang_info = $sav_mailtousers_lang_info; $lang = $sav_mailtousers_lang; - mass_updates( - USER_MAIL_NOTIFICATION_TABLE, - array( - 'primary' => array('user_id'), - 'update' => array('last_send') - ), - $datas - ); - - if ($error_on_mail_count != 0) + if ($is_action_send) { - array_push($page['errors'], sprintf(l10n('nbm_%d mails were not sended.'), $error_on_mail_count)); - } - else - { - if ($sended_mail_count == 0) - array_push($page['infos'], l10n('nbm_No mail to send.')); + mass_updates( + USER_MAIL_NOTIFICATION_TABLE, + array( + 'primary' => array('user_id'), + 'update' => array('last_send') + ), + $datas + ); + + if ($error_on_mail_count != 0) + { + array_push($page['errors'], sprintf(l10n('nbm_%d mails were not sent.'), $error_on_mail_count)); + } else - array_push($page['infos'], sprintf(l10n('nbm_%d mails were sended.'), $sended_mail_count)); + { + if ($sent_mail_count == 0) + array_push($page['infos'], l10n('nbm_No mail to send.')); + else + array_push($page['infos'], sprintf(l10n('nbm_%d mails were sent.'), $sent_mail_count)); + } } } else { - array_push($page['errors'], l10n('nbm_No user to send notifications by mail.')); + if ($is_action_send) + { + array_push($page['errors'], l10n('nbm_No user to send notifications by mail.')); + } } + return $return_list; } // +-----------------------------------------------------------------------+ // | Main | // +-----------------------------------------------------------------------+ -update_data_user_mail_notification(); -//send_all_user_mail_notification(); - if (!isset($_GET['mode'])) { $page['mode'] = 'send'; @@ -266,27 +334,132 @@ else $page['mode'] = $_GET['mode']; } +// +-----------------------------------------------------------------------+ +// | Check Access and exit when user status is not ok | +// +-----------------------------------------------------------------------+ +check_status(get_tab_status($page['mode'])); + +// +-----------------------------------------------------------------------+ +// | Insert new users with mails | +// +-----------------------------------------------------------------------+ +if (!isset($_POST) or (count($_POST) ==0)) +{ + // No insert data in post mode + insert_new_data_user_mail_notification(); +} + +// +-----------------------------------------------------------------------+ +// | Treatment of tab post | +// +-----------------------------------------------------------------------+ +switch ($page['mode']) +{ + case 'param' : + { + $updated_param_count = 0; + // Update param + $result = pwg_query('select param, value from '.CONFIG_TABLE.' where param like \'nbm\\_%\''); + while ($row = mysql_fetch_array($result)) + { + if (isset($_POST['param_submit'])) + { + if (isset($_POST[$row['param']])) + { + $value = $_POST[$row['param']]; + + $query = ' +update + '.CONFIG_TABLE.' +set + value = \''. str_replace("\'", "''", $value).'\' +where + param = \''.$row['param'].'\';'; + pwg_query($query); + $updated_param_count += 1; + } + } + + $conf[$row['param']] = $row['value']; + + // if the parameter is present in $_POST array (if a form is submited), we + // override it with the submited value + if (isset($_POST[$row['param']])) + { + $conf[$row['param']] = stripslashes($_POST[$row['param']]); + } + + // If the field is true or false, the variable is transformed into a + // boolean value. + if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false') + { + $conf[$row['param']] = get_boolean($conf[$row['param']]); + } + } + + if ($updated_param_count != 0) + { + array_push($page['infos'], sprintf(l10n('nbm_updated_param_count'), $updated_param_count)); + } + } + case 'subscribe' : + { + if (isset($_POST['falsify']) and isset($_POST['cat_true'])) + { + unsubcribe_notification_by_mail($_POST['cat_true']); + } + else + if (isset($_POST['trueify']) and isset($_POST['cat_false'])) + { + subcribe_notification_by_mail($_POST['cat_false']); + } + break; + } + + case 'send' : + { + if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content'])) + { + do_action_send_mail_notification('send', $_POST['send_selection'], $_POST['send_customize_mail_content']); + } + } +} + // +-----------------------------------------------------------------------+ // | template initialization | // +-----------------------------------------------------------------------+ -$template->set_filenames( - array( +$template->set_filenames +( + array + ( 'double_select' => 'admin/double_select.tpl', 'notification_by_mail'=>'admin/notification_by_mail.tpl' - ) - ); + ) +); $base_url = get_root_url().'admin.php'; -$template->assign_vars( - array( +$template->assign_vars +( + array + ( 'U_TABSHEET_TITLE' => l10n('nbm_'.$page['mode'].'_mode'), - 'U_HELP' => add_url_params(get_root_url().'/popuphelp.php', array('page'=>'notification_by_mail') ), - 'U_PARAM_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'param') ), - 'U_SUBSCRIBE_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'subscribe') ), - 'U_SEND_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'send') ), + 'U_HELP' => add_url_params(get_root_url().'/popuphelp.php', array('page' => 'notification_by_mail')), 'F_ACTION'=> $base_url.get_query_string_diff(array()) - )); + ) +); + +if (is_autorize_status(ACCESS_WEBMASTER)) +{ + $template->assign_block_vars + ( + 'header_link', + array + ( + 'PARAM_MODE' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'param')), + 'SUBSCRIBE_MODE' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'subscribe')), + 'SEND_MODE' => add_url_params($base_url.get_query_string_diff(array('mode', 'select')), array('mode' => 'send')) + ) + ); +} switch ($page['mode']) { @@ -295,16 +468,19 @@ switch ($page['mode']) $template->assign_block_vars( $page['mode'], array( - //'HISTORY_YES'=>$history_yes + 'SEND_MAIL_AS' => $conf['nbm_send_mail_as'], + 'SEND_DETAILED_CONTENT_YES' => ($conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''), + 'SEND_DETAILED_CONTENT_NO' => (!$conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''), + 'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'] )); break; } + case 'subscribe' : { $template->assign_block_vars( $page['mode'], array( - //'HISTORY_YES'=>$history_yes )); $template->assign_vars( @@ -314,82 +490,71 @@ switch ($page['mode']) ) ); + $query = ' +select + N.check_key, N.enabled, U.username, U.mail_address +from + '.USER_MAIL_NOTIFICATION_TABLE.' as N, + '.USERS_TABLE.' as U +where + N.user_id = U.id +order by + username;'; -/* $template->assign_block_vars( - $blockname, - array('SELECTED'=>$selected, - 'VALUE'=>$category['id'], - 'OPTION'=>$option - ));*/ - $template->assign_block_vars( - 'category_option_true', - array('SELECTED'=>'', - 'VALUE'=>'rub', - 'OPTION'=>'rub [rub@phpwebgallery.net]' - )); + $result = pwg_query($query); + if (!empty($result)) + { + while ($row = mysql_fetch_array($result)) + { + $template->assign_block_vars( + (get_boolean($row['enabled']) ? 'category_option_true' : 'category_option_false'), + array('SELECTED' => '', + 'VALUE' => $row['check_key'], + 'OPTION' => $row['username'].'['.$row['mail_address'].']' + )); + } + } break; } + case 'send' : { - $template->assign_block_vars( - $page['mode'], - array( - //'HISTORY_YES'=>$history_yes - )); - - $template->assign_vars( - array( - 'L_CAT_OPTIONS_TRUE' => l10n('nbm_send_col'), - 'L_CAT_OPTIONS_FALSE' => l10n('nbm_nosend_col') - ) - ); + $template->assign_block_vars($page['mode'], array()); + $data_rows = do_action_send_mail_notification('prepare'); -/* $template->assign_block_vars( - $blockname, - array('SELECTED'=>$selected, - 'VALUE'=>$category['id'], - 'OPTION'=>$option - ));*/ - $template->assign_block_vars( - 'category_option_true', - array('SELECTED'=>' selected="selected"', - 'VALUE'=>'rub', - 'OPTION'=>'rub [2006-03-20 23:35:23]' - )); + if (count($data_rows) == 0) + { + $template->assign_block_vars($page['mode'].'.send_empty', array()); + } + else + { + $template->assign_block_vars( + $page['mode'].'.send_data', + array( + // 'URL_CHECK_ALL' => add_url_params($base_url.get_query_string_diff(array('select')), array('select' => 'all')), + // 'URL_UNCHECK_ALL' => add_url_params($base_url.get_query_string_diff(array('select')), array('select' => 'none')), + 'CUSTOMIZE_MAIL_CONTENT' => isset($_POST['send_customize_mail_content']) ? $_POST['send_customize_mail_content'] : $conf['nbm_complementary_mail_content'] + )); + + foreach ($data_rows as $num => $local_user) + $template->assign_block_vars( + $page['mode'].'.send_data.user_send_mail', + array( + 'CLASS' => ($num % 2 == 1) ? 'row2' : 'row1', + 'ID' => $local_user['check_key'], + 'CHECKED' => isset($_POST['send_uncheck_all']) ? '' : 'checked="checked"', + 'USERNAME'=> $local_user['username'], + 'EMAIL' => $local_user['mail_address'], + 'LAST_SEND'=> $local_user['last_send'] + )); + } break; } } -// +-----------------------------------------------------------------------+ -// | infos & errors display | -// +-----------------------------------------------------------------------+ - -/*echo '
';
-
-if (count($page['errors']) != 0)
-{
-  echo "\n\nErrors:\n";
-  foreach ($page['errors'] as $error)
-  {
-    echo $error."\n";
-  }
-}
-
-if (count($page['infos']) != 0)
-{
-  echo "\n\nInformations:\n";
-  foreach ($page['infos'] as $info)
-  {
-    echo $info."\n";
-  }
-}
-
-echo '
'; -*/ - // +-----------------------------------------------------------------------+ // | Sending html code | // +-----------------------------------------------------------------------+ diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index edd08c6ce..9c5b8aaa8 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -29,7 +29,7 @@ /** * - Extract mail fonctions of password.php * - Modify pwg_mail (add pararameters + news fonctionnalities) - * - Var conf_mail, function init_conf_mail, function format_email + * - Var conf_mail, function get_mail_configuration, format_email, pwg_mail */ // +-----------------------------------------------------------------------+ @@ -133,4 +133,5 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '') return mail($to, $subject, $content, $headers); } } + ?> \ No newline at end of file diff --git a/install/config.sql b/install/config.sql index 80c572903..6bd677fa6 100644 --- a/install/config.sql +++ b/install/config.sql @@ -20,3 +20,7 @@ INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('rate','true','Ra INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('page_banner','

PhpWebGallery demonstration site

My photos web site

','html displayed on the top each page of your gallery'); +-- Notification by mail +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail'); +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_detailed_content','true','Send detailed content for notification by mail'); +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_complementary_mail_content','','Complementary mail content for notification by mail'); diff --git a/install/db/17-database.php b/install/db/17-database.php new file mode 100644 index 000000000..820ca6194 --- /dev/null +++ b/install/db/17-database.php @@ -0,0 +1,64 @@ + diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php index 1596d3d24..fe0d5cd64 100644 --- a/language/en_UK.iso-8859-1/admin.lang.php +++ b/language/en_UK.iso-8859-1/admin.lang.php @@ -238,35 +238,50 @@ $lang['metadata_basic'] = 'basic'; $lang['metadata_exif'] = 'EXIF'; $lang['metadata_iptc'] = 'IPTC'; $lang['name'] = 'name'; -$lang['nbm_%d mails were not sended.'] = '%d mails were not sended.'; -$lang['nbm_%d mails were sended.'] = '%d mails were sended.'; +$lang['nbm_%d mails were not sent.'] = '%d mails were not sent.'; +$lang['nbm_%d mails were sent.'] = '%d mails were sent.'; $lang['nbm_Error when sending email to %s [%s].'] = 'Error when sending email to %s [%s].'; -$lang['nbm_Go to %s %s.'] = 'Go to %s %s.'; -$lang['nbm_Hello %s'] = 'Hello %s'; -$lang['nbm_Mail sended to %s [%s].'] = 'Mail sended to %s [%s].'; -$lang['nbm_New elements added'] = 'New elements added'; -$lang['nbm_New elements were added between %s and %s:'] = 'New elements were added between %s and %s:'; -$lang['nbm_New elements were added on %s:'] = 'New elements were added on %s:'; +$lang['nbm_Mail sent to %s [%s].'] = 'Mail sent to %s [%s].'; +$lang['nbm_ContentObject'] = 'New elements added'; +$lang['nbm_ContentHello'] = 'Hello %s'; +$lang['nbm_ContentNewElementsBetween'] = 'New elements were added between %s and %s'; +$lang['nbm_ContentNewElements'] = 'New elements were added on %s'; +$lang['nbm_ContentGoTo'] = 'Go to %s %s.'; +$lang['nbm_ContentByeBye'] = 'See you soon'; +$lang['nbm_ContentUnsubscribe'] = 'To unsubscribe send a message to %s.'; $lang['nbm_No mail to send.'] = 'No mail to send.'; $lang['nbm_No user to send notifications by mail.'] = 'No user to send notifications by mail.'; $lang['nbm_Send mail to users'] = 'Send mail to users'; -$lang['nbm_To unsubscribe send a message to %s.'] = 'To unsubscribe send a message to %s.'; $lang['nbm_User %s [%s] added.'] = 'User %s [%s] added.'; $lang['nbm_item_notification'] = 'Notification'; $lang['nbm_param_mode'] = 'Parameter'; $lang['nbm_subscribe_mode'] = 'Subscribe'; $lang['nbm_send_mode'] = 'Send'; $lang['nbm_title_param'] = 'Parameters'; +$lang['nbm_updated_param_count'] = '%d parameters are updated.'; +$lang['nbm_send_mail_as'] = 'Send mail as'; +$lang['nbm_info_send_mail_as'] = 'With blank value, gallery title will be used'; $lang['nbm_send_detailed_content'] = 'Send detailed content'; $lang['nbm_complementary_mail_content'] = 'Complementary mail content'; $lang['nbm_title_subscribe'] = 'Subscribe/unscribe users'; $lang['nbm_warning_subscribe_unsubcribe'] = 'Warning, subscribe or unscribe send mails to users [Not Implemented]'; $lang['nbm_subscribe_col'] = 'Subscribed'; $lang['nbm_unsubscribe_col'] = 'Unsubcribed'; +$lang['nbm_no_user_available_to_send_L1'] = 'No user are available in order to send mail.'; +$lang['nbm_no_user_available_to_send_L2'] = 'A user is available, if the are news elements to notify'; $lang['nbm_title_send'] = 'Select sendings'; +$lang['nbm_col_user'] = 'User'; +$lang['nbm_col_mail'] = 'email'; +$lang['nbm_col_last_send'] = 'Last send'; +$lang['nbm_col_check_user_send_mail'] = 'To send ?'; +$lang['nbm_send_options'] = 'Options'; +$lang['nbm_send_complementary_mail_content'] = 'Complementary mail content'; $lang['nbm_send_submit'] = 'Send'; -$lang['nbm_send_col'] = 'To send'; -$lang['nbm_nosend_col'] = 'No to send'; +$lang['nbm_send_check_all'] = 'Check All'; +$lang['nbm_send_uncheck_all'] = 'Uncheck All'; +$lang['nbm_user_change_enabled_true'] = 'User %s [%s] added to subscribe list.'; +$lang['nbm_user_change_enabled_false'] = 'User %s [%s] removed of subscribe list.'; +$lang['nbm_user_change_enabled_updated_data_count'] = '%d user(s) are updated.'; $lang['no_write_access'] = 'no write access'; $lang['order_by'] = 'order by'; $lang['path'] = 'path'; diff --git a/language/en_UK.iso-8859-1/help/notification_by_mail.html b/language/en_UK.iso-8859-1/help/notification_by_mail.html index aa977a816..106c5a736 100644 --- a/language/en_UK.iso-8859-1/help/notification_by_mail.html +++ b/language/en_UK.iso-8859-1/help/notification_by_mail.html @@ -1,2 +1,15 @@

Notification by mail

+

This screen allows to configure, to manage the notification to users of news sendinf mail.

+ +

This screen is composed of 3 tabs:

+ +

Parameters

+

Available only for webmasters, this tab sets parameters of the notification by mail.

+ +

Subscribe

+

Available only for webmasters, this tab manages subscribe/unsubscribe of notification by mail.

+ +

Envoi

+

Available only for webmasters and administrators, this tab allows to send mails to notify news.

+ diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php index 0ad69bced..810716154 100644 --- a/language/fr_FR.iso-8859-1/admin.lang.php +++ b/language/fr_FR.iso-8859-1/admin.lang.php @@ -238,35 +238,50 @@ $lang['metadata_basic'] = 'basique'; $lang['metadata_exif'] = 'EXIF'; $lang['metadata_iptc'] = 'IPTC'; $lang['name'] = 'nom'; -$lang['nbm_%d mails were not sended.'] = '%s mails n\'ont pas été envoyés.'; -$lang['nbm_%d mails were sended.'] = '%s mails ont été envoyés.'; +$lang['nbm_%d mails were not sent.'] = '%s mails n\'ont pas été envoyés.'; +$lang['nbm_%d mails were sent.'] = '%s mails ont été envoyés.'; $lang['nbm_Error when sending email to %s [%s].'] = 'Erreur lors de l\'envoi du mail à %s [%s].'; -$lang['nbm_Go to %s %s.'] = 'Allez sur %s %s.'; -$lang['nbm_Hello %s'] = 'Bonjour %s'; -$lang['nbm_Mail sended to %s [%s].'] = 'Mail envoyé à %s [%s].'; -$lang['nbm_New elements added'] = 'Nouveaux éléments ajoutés'; -$lang['nbm_New elements were added between %s and %s:'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s:'; -$lang['nbm_New elements were added on %s:'] = 'Des nouveaux éléments ont été ajoutés le %s:'; +$lang['nbm_Mail sent to %s [%s].'] = 'Mail envoyé à %s [%s].'; +$lang['nbm_ContentObject'] = 'Nouveaux éléments ajoutés'; +$lang['nbm_ContentHello'] = 'Bonjour %s'; +$lang['nbm_ContentNewElementsBetween'] = 'Des nouveaux éléments ont été ajoutés entre le %s et le %s'; +$lang['nbm_ContentNewElements'] = 'Des nouveaux éléments ont été ajoutés le %s'; +$lang['nbm_ContentGoTo'] = 'Rendez-vous sur %s %s.'; +$lang['nbm_ContentByeBye'] = 'A bientôt'; +$lang['nbm_ContentUnsubscribe'] = 'Pour vous désinscrire, envoyer un mail à %s.'; $lang['nbm_No mail to send.'] = 'Pas de mail à envoyer.'; $lang['nbm_No user to send notifications by mail.'] = 'Pas d\'utilisateur pour envoyer des notifications par mails.'; $lang['nbm_Send mail to users'] = 'Envoi de mail aux utilisateurs'; -$lang['nbm_To unsubscribe send a message to %s.'] = 'Pour vous désinscrire, envoyer un mail à %s.'; $lang['nbm_User %s [%s] added.'] = 'Utilisateur %s [%s] ajouté.'; $lang['nbm_item_notification'] = 'Notification'; $lang['nbm_param_mode'] = 'Paramètrage'; $lang['nbm_subscribe_mode'] = 'Inscription'; $lang['nbm_send_mode'] = 'Envoi'; $lang['nbm_title_param'] = 'Paramètres'; +$lang['nbm_updated_param_count'] = '%d paramètres ont été mis à jour.'; +$lang['nbm_send_mail_as'] = 'Envoyer le mail en tant que'; +$lang['nbm_info_send_mail_as'] = 'Sans valeur, le titre de la galerie sera utilisé'; $lang['nbm_send_detailed_content'] = 'Envoi d\'un contenu détaillé'; $lang['nbm_complementary_mail_content'] = 'Contenu complémentaire au mail'; $lang['nbm_title_subscribe'] = 'Inscrire/desinscrire les utilisateurs'; $lang['nbm_warning_subscribe_unsubcribe'] = 'Attention, l\'inscription ou la desincription entraine l\'envoi de mails aux utilisateurs concernés [Fonction non implementée]'; $lang['nbm_subscribe_col'] = 'Inscrits'; $lang['nbm_unsubscribe_col'] = 'Non Inscrits'; +$lang['nbm_no_user_available_to_send_L1'] = 'Il n\'y a pas d\'utilisateur à notifier par mail.'; +$lang['nbm_no_user_available_to_send_L2'] = 'Un utilisateur est à notifier si de nouveaux éléments sont disponibles pour cet utilisateur.'; $lang['nbm_title_send'] = 'Sélection des envois'; +$lang['nbm_col_user'] = 'Utilisateur'; +$lang['nbm_col_mail'] = 'email'; +$lang['nbm_col_last_send'] = 'Dernier envoi'; +$lang['nbm_col_check_user_send_mail'] = 'A envoyer ?'; +$lang['nbm_send_options'] = 'Options'; +$lang['nbm_send_complementary_mail_content'] = 'Contenu complémentaire du mail'; $lang['nbm_send_submit'] = 'Envoyer'; -$lang['nbm_send_col'] = 'A envoyer'; -$lang['nbm_nosend_col'] = 'A ne pas envoyer'; +$lang['nbm_send_check_all'] = 'Tout cocher'; +$lang['nbm_send_uncheck_all'] = 'Tout décocher'; +$lang['nbm_user_change_enabled_true'] = 'L\'utilisateur %s [%s] a été ajouté à la liste des inscrits.'; +$lang['nbm_user_change_enabled_false'] = 'L\'utilisateur %s [%s] a été supprimé de la liste des inscrits.'; +$lang['nbm_user_change_enabled_updated_data_count'] = '%d utilisateur(s) a(ont) été mis à jour.'; $lang['no_write_access'] = 'pas d\'accès en écriture'; $lang['order_by'] = 'trier selon'; $lang['path'] = 'chemin'; diff --git a/language/fr_FR.iso-8859-1/help/notification_by_mail.html b/language/fr_FR.iso-8859-1/help/notification_by_mail.html index 1426d3671..3178aa0ec 100644 --- a/language/fr_FR.iso-8859-1/help/notification_by_mail.html +++ b/language/fr_FR.iso-8859-1/help/notification_by_mail.html @@ -1,2 +1,15 @@ -

Avertissement par mail

+

Notification par mail

+ +

Cet écran permet de configurer, de gérer la notification aux utilisateurs de changements par l'envoi d'un mail.

+ +

Cet écran est composé de 3 onglets:

+ +

Paramètrage

+

Accésible uniquement aux webmestres, cet onglet permet de positionner les paramètres de la notification par mail.

+ +

Inscription

+

Accésible uniquement aux webmestres, cet onglet permet de gérer les inscriptions/désinscriptions à la notification par mail.

+ +

Envoi

+

Accésible aux webmestres et aux administrateurs, cet onglet permet d'effectuer les envois des mails pour notifier les changements.

diff --git a/template/yoga/admin/notification_by_mail.tpl b/template/yoga/admin/notification_by_mail.tpl index 36bff3cf3..07ddda54e 100644 --- a/template/yoga/admin/notification_by_mail.tpl +++ b/template/yoga/admin/notification_by_mail.tpl @@ -4,13 +4,15 @@
  • (?)
  • {lang:nbm_Send mail to users} [{U_TABSHEET_TITLE}]

    +

    - {lang:nbm_param_mode} | - {lang:nbm_subscribe_mode} | - {lang:nbm_send_mode} + {lang:nbm_param_mode} | + {lang:nbm_subscribe_mode} | + {lang:nbm_send_mode}

    +
    @@ -21,40 +23,94 @@ + + + + - + - +
    + +
    {lang:nbm_info_send_mail_as} +
    + + +

    - - + +

    {lang:nbm_title_subscribe} -
    {lang:nbm_warning_subscribe_unsubcribe}
    +
    {lang:nbm_warning_subscribe_unsubcribe}

    {DOUBLE_SELECT}
    -
    - {lang:nbm_title_send} - {DOUBLE_SELECT} -
    + +
    + {lang:nbm_no_user_available_to_send_L1}
    + {lang:nbm_no_user_available_to_send_L2} +
    + + +
    + {lang:nbm_title_send} + + + + + + + + + + + + + + + +
    {lang:nbm_col_user}{lang:nbm_col_mail}{lang:nbm_col_last_send}{lang:nbm_col_check_user_send_mail}
    + +

    + + / + +

    +
    -

    - - -

    +
    + {lang:nbm_send_options} + + + + + + +
    +
    + +

    + +

    +
    -- cgit v1.2.3