Browse Source

More fixes when sending emails in the work tool see BT#3240

Julio Montoya 13 years ago
parent
commit
8c0deeb559
2 changed files with 6 additions and 9 deletions
  1. 3 6
      main/work/work.lib.php
  2. 3 3
      main/work/work.php

+ 3 - 6
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;
     

+ 3 - 3
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();			
 		}