[svn r17983] Logic changes - Added validation field required for subject, titles for each user list when you modify them and allow to cancel when you are not sure to send everybody the announcement - see FS#3524

skala
Cristian Fasanando 16 years ago
parent 102486eddb
commit 279efc8383
  1. 19
      main/announcements/announcements.inc.php
  2. 11
      main/announcements/announcements.php

@ -1,4 +1,4 @@
<?php //$Id: announcements.inc.php 17332 2008-12-16 20:10:35Z cfasanando $
<?php //$Id: announcements.inc.php 17983 2009-01-24 01:13:39Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -102,6 +102,7 @@ function show_to_form($to_already_selected)
// the form containing all the groups and all the users of the course
echo "\t\t<td>\n";
echo "<strong>".get_lang('UsersList')."</strong><br />";
construct_not_selected_select_form($group_list,$user_list,$to_already_selected);
echo "\t\t</td>\n";
@ -120,6 +121,7 @@ function show_to_form($to_already_selected)
echo "\n\t\t<td>\n";
// the form containing the selected groups and users
echo "<strong>".get_lang('DestinationUsersList')."</strong><br />";
construct_selected_select_form($group_list,$user_list,$to_already_selected);
echo "\t\t</td>\n";
echo "\t</tr>\n";
@ -432,12 +434,21 @@ function to_javascript()
function selectAll(cbList,bSelect,showwarning)
{
if (document.getElementById('emailTitle').value==''){
document.getElementById('msg_error').innerHTML='".get_lang('FieldRequired')."';
document.getElementById('msg_error').style.display='block';
}else {
if (cbList.length < 1) {
alert(\"".get_lang('Send2All')."\");
return;
if (!confirm(\"".get_lang('Send2All')."\")) {
return false;
}
}
for (var i=0; i<cbList.length; i++)
cbList[i].selected = cbList[i].checked = bSelect
cbList[i].selected = cbList[i].checked = bSelect;
document.f1.submit();
}
}
function reverseAll(cbList)

@ -1,4 +1,4 @@
<?php //$Id: announcements.php 17787 2009-01-17 00:41:06Z ivantcholakov $
<?php //$Id: announcements.php 17983 2009-01-24 01:13:39Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -1127,7 +1127,8 @@ if(!empty($error_message))
echo get_lang('EmailAddress').": <input type=\"text\" name=\"emailsAdd\" value=\"".$emails_add."\" size=\"52\">(Comma separated for multiple)<br>";
echo get_lang('OnlyThoseAddresses').": <input type=\"checkbox\" name=\"onlyThoseMails\"><br>";
}
echo get_lang('EmailTitle').": <input type=\"text\" name=\"emailTitle\" value=\"".$title_to_modify."\" size=\"52\"><br />";
echo "<div id='msg_error' style='display:none;color:red'></div>";
echo "<label style='color:red;font-size:14pt'>*</label>&nbsp;".get_lang('EmailTitle').": <input type=\"text\" id=\"emailTitle\" name=\"emailTitle\" value=\"".$title_to_modify."\" size=\"52\" onfocus=\"document.getElementById('msg_error').style.display='none';\"><br />";
unset($title_to_modify);
$title_to_modify = null;
@ -1165,10 +1166,12 @@ if(!empty($error_message))
echo $oFCKeditor->CreateHtml();
if(empty($_SESSION['toolgroup'])){
echo '<br /><input type="Submit" name="submitAnnouncement" value="'.' '.get_lang('Ok').' '.'" onclick="selectAll(this.form.elements[3],true)" /><br /><br />';
echo '<input type="hidden" name="submitAnnouncement" value="OK">';
echo '<br /><input type="button" value="'.' '.get_lang('Ok').' '.'" onclick="selectAll(this.form.elements[3],true)" /><br /><br />';
}
else{
echo '<br /><input type="Submit" name="submitAnnouncement" value="'.' '.get_lang('Ok').' '.'" onclick="selectAll(this.form.elements[4],true)" /><br /><br />';
echo '<input type="hidden" name="submitAnnouncement" value="OK">';
echo '<br /><input type="button" value="'.' '.get_lang('Ok').' '.'" onclick="selectAll(this.form.elements[4],true)" /><br /><br />';
}
echo '</form><br />';

Loading…
Cancel
Save