Browse Source

[svn r11104] fix a bug : All course users are now displayed in the list and the announce is always sent by mail

Julian Prud'homme 18 years ago
parent
commit
94174fb37c
2 changed files with 11 additions and 10 deletions
  1. 3 3
      main/announcements/announcements.inc.php
  2. 8 7
      main/announcements/announcements.php

+ 3 - 3
main/announcements/announcements.inc.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.inc.php 9982 2006-11-15 00:08:08Z pcool $
+<?php //$Id: announcements.inc.php 11104 2007-02-13 09:21:38Z elixir_julian $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -152,9 +152,9 @@ function construct_not_selected_select_form($group_list=null, $user_list=null,$t
 	// adding the individual users to the select form
 	foreach($user_list as $this_user)
 	{
-		if (!in_array("USER:".$this_user[uid],$to_already_selected)) // $to_already_selected is the array containing the users (and groups) that are already selected
+		if (!in_array("USER:".$this_user["user_id"],$to_already_selected)) // $to_already_selected is the array containing the users (and groups) that are already selected
 		{
-			echo	"\t\t<option value=\"USER:",$this_user[uid],"\">",
+			echo	"\t\t<option value=\"USER:",$this_user["user_id"],"\">",
 				"",$this_user[lastName]," ",$this_user[firstName],
 				"</option>\n";
 		}

+ 8 - 7
main/announcements/announcements.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.php 10996 2007-01-30 09:14:28Z elixir_julian $
+<?php //$Id: announcements.php 11104 2007-02-13 09:21:38Z elixir_julian $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -616,10 +616,11 @@ if(eregi('^[0-9a-z_\.-]+@(([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-z][0-9a-z-]*[0-9a-z
 				    							MAIL FUNCTION
 				===================================================================*/
 
-				if ($_POST['email_ann'] && empty($_POST['onlyThoseMails']))
+				if (empty($_POST['onlyThoseMails']))
 				{
+					
 				  	$sent_to=sent_to("announcement", $insert_id);
-
+					
 				    $userlist   = $sent_to['users'];
 				    $grouplist  = $sent_to['groups'];
 
@@ -1023,17 +1024,17 @@ if ($message == true)
 		if (!isset($announcement_to_modify) ) $announcement_to_modify ="";
 		if ($announcement_to_modify=='')
 		{
-			($email_ann=='1')?$checked='checked':$checked='';
+			/*($email_ann=='1')?$checked='checked':$checked='';
 			echo "<input class=\"checkbox\" type=checkbox value=\"1\" name=\"email_ann\" $checked> ".get_lang('EmailOption')," : ",
-			"<br /><br />";
+			"<br /><br />";*/
 		}
 	}else{
 			if (!isset($announcement_to_modify) ) $announcement_to_modify ="";
 			if ($announcement_to_modify=='')
 			{
-				($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked='';
+				//($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked='';
 				//echo "<input class=\"checkbox\" type=checkbox value=\"1\" name=\"email_ann\" $checked> ".get_lang('EmailOption')," : ".get_lang('MyGroup'),
-				"<br><br>";
+				//"<br><br>";
 			}
 		}
 		if($surveyid){