From 8c0deeb559ac2564a7b8a4441fd8d82c3789c7de Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 18 Jan 2012 18:28:58 +0100 Subject: [PATCH] More fixes when sending emails in the work tool see BT#3240 --- main/work/work.lib.php | 9 +++------ main/work/work.php | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/main/work/work.lib.php b/main/work/work.lib.php index d5954ef969..67c1229997 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -1748,14 +1748,11 @@ function send_reminder_users_without_publication($task_data) { $list_users = get_list_users_without_publication($task_id); - $mails_sent_to = array(); + $mails_sent_to = array(); foreach ($list_users as $user) { $name_user = api_get_person_name($user[1], $user[0], null, PERSON_NAME_EMAIL_ADDRESS); - $result = api_mail($name_user, $user[2], $emailsubject, $emailbody_user, $sender_name, $email_admin); - if ($result) { - $mails_sent_to[] = $name_user; - } - $mails_sent_to[] = $name_user; + $result = api_mail($name_user, $user[3], $emailsubject, $emailbody_user, $sender_name, $email_admin); + $mails_sent_to[] = $name_user; } return $mails_sent_to; diff --git a/main/work/work.php b/main/work/work.php index 32a8659c70..db022ab91c 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -41,7 +41,7 @@ /* INIT SECTION */ -$language_file = array('exercice', 'work', 'document', 'admin', 'group', 'userInfo'); +$language_file = array('exercice', 'work', 'document', 'admin'); require_once '../inc/global.inc.php'; @@ -487,9 +487,9 @@ switch ($action) { if (Security::check_token('get')) { $mails_sent_to = send_reminder_users_without_publication($my_folder_data); if (empty($mails_sent_to)) { - Display::display_warning_message(get_lang('NoStudents')); + Display::display_warning_message(get_lang('NoResults')); } else { - Display::display_confirmation_message(get_lang('MessageOutboxComment').' '.implode(', ', $mails_sent_to)); + Display::display_confirmation_message(get_lang('MessageHasBeenSent').' '.implode(', ', $mails_sent_to)); } Security::clear_token(); }