diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php
index 7577dfa253..0b6178a504 100644
--- a/main/calendar/agenda.inc.php
+++ b/main/calendar/agenda.inc.php
@@ -23,11 +23,11 @@
*/
// the variables for the days and the months
// Defining the shorts for the days
-$DaysShort = api_get_week_days_short();
+$DaysShort = api_get_week_days_short();
// Defining the days of the week to allow translation of the days
-$DaysLong = api_get_week_days_long();
+$DaysLong = api_get_week_days_long();
// Defining the months of the year to allow translation of the months
-$MonthsLong = api_get_months_long();
+$MonthsLong = api_get_months_long();
/*
==============================================================================
@@ -66,8 +66,8 @@ function get_calendar_items($month, $year)
$repeats = array();
$session_condition = intval($_SESSION['id_session'])==0 ? '' : ' AND agenda.session_id IN (0,'.intval($_SESSION['id_session']).') ';
-
-
+
+
/*--------------------------------------------------
CONSTRUCT THE SQL STATEMENT
--------------------------------------------------*/
@@ -98,7 +98,7 @@ function get_calendar_items($month, $year)
$start = time();
$stop = mktime(0,0,0,1,1,2038);//by default, set year to maximum for mktime()
}
-
+
// by default we use the id of the current user. The course administrator can see the agenda of other users by using the user / group filter
$user_id=$_user['user_id'];
if ($_SESSION['user']!==null)
@@ -250,7 +250,7 @@ function get_calendar_items($month, $year)
//echo "
\n";
for ($ii=0; $ii<7; $ii++)
{
if (($curday == -1)&&($ii==$startdayofweek))
@@ -418,7 +418,7 @@ function display_monthcalendar($month, $year)
$bgcolor = $ii<5 ? "class=\"row_odd\"" : "class=\"row_even\"";
$dayheader = "$curday";
-
+
if (key_exists($curday,$data)) {
$dayheader="".$curday."";
foreach ($data[$curday] as $key=>$agenda_item)
@@ -437,7 +437,7 @@ function display_monthcalendar($month, $year)
//echo $agendaitems['title'];
}
- }
+ }
}
if (($curday==$today['mday'])&&($year ==$today['year'])&&($month == $today['mon']))
@@ -509,47 +509,47 @@ function move(fbox, tbox)
fLength++;
}
}
-
+
//arrFbox.sort();
- //arrTbox.sort()
+ //arrTbox.sort()
var arrFboxGroup = new Array();
var arrFboxUser = new Array();
- var prefix_x;
-
+ var prefix_x;
+
for (x = 0; x < arrFbox.length; x++) {
- prefix_x = arrFbox[x].substring(0,2);
+ prefix_x = arrFbox[x].substring(0,2);
if (prefix_x == 'G:') {
- arrFboxGroup.push(arrFbox[x]);
+ arrFboxGroup.push(arrFbox[x]);
} else {
- arrFboxUser.push(arrFbox[x]);
- }
- }
-
+ arrFboxUser.push(arrFbox[x]);
+ }
+ }
+
arrFboxGroup.sort();
arrFboxUser.sort();
- arrFbox = arrFboxGroup.concat(arrFboxUser);
-
+ arrFbox = arrFboxGroup.concat(arrFboxUser);
+
var arrTboxGroup = new Array();
- var arrTboxUser = new Array();
- var prefix_y;
-
+ var arrTboxUser = new Array();
+ var prefix_y;
+
for (y = 0; y < arrTbox.length; y++) {
- prefix_y = arrTbox[y].substring(0,2);
+ prefix_y = arrTbox[y].substring(0,2);
if (prefix_y == 'G:') {
arrTboxGroup.push(arrTbox[y]);
} else {
arrTboxUser.push(arrTbox[y]);
- }
- }
-
+ }
+ }
+
arrTboxGroup.sort();
arrTboxUser.sort();
arrTbox = arrTboxGroup.concat(arrTboxUser);
fbox.length = 0;
tbox.length = 0;
-
+
var c;
for(c = 0; c < arrFbox.length; c++)
{
@@ -569,7 +569,7 @@ function move(fbox, tbox)
function checkDate(month, day, year)
{
- var monthLength =
+ var monthLength =
new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if (!day || !month || !year)
@@ -584,14 +584,14 @@ function checkDate(month, day, year)
if (day > monthLength[month-1])
return false;
-
+
return true;
-}
+}
-function mktime()
-{
+function mktime()
+{
var no, ma = 0, mb = 0, i = 0, d = new Date(), argv = arguments, argc = argv.length;
- d.setHours(0,0,0); d.setDate(1); d.setMonth(1); d.setYear(1972);
+ d.setHours(0,0,0); d.setDate(1); d.setMonth(1); d.setYear(1972);
var dateManip = {
0: function(tt){ return d.setHours(tt); },
1: function(tt){ return d.setMinutes(tt); },
@@ -599,7 +599,7 @@ function mktime()
3: function(tt){ set = d.setMonth(parseInt(tt)-1); ma = d.getFullYear() - 1972; return set; },
4: function(tt){ return d.setDate(tt+mb); },
5: function(tt){ return d.setYear(tt+ma); }
- };
+ };
for( i = 0; i < argc; i++ ){
no = parseInt(argv[i]*1);
if (isNaN(no)) {
@@ -611,10 +611,10 @@ function mktime()
return false;
}
}
- }
+ }
return Math.floor(d.getTime()/1000);
-}
-
+}
+
function validate()
{
var f = document.new_calendar_item;
@@ -623,52 +623,52 @@ function validate()
}
function selectAll(cbList,bSelect,showwarning)
-{
+{
var start_day = document.new_calendar_item.fday.value;
var start_month = document.new_calendar_item.fmonth.value;
- var start_year = document.new_calendar_item.fyear.value;
- var start_hour = document.new_calendar_item.fhour.value;
+ var start_year = document.new_calendar_item.fyear.value;
+ var start_hour = document.new_calendar_item.fhour.value;
var start_minute = document.new_calendar_item.fminute.value;
var start_date = mktime(start_hour,start_minute,0,start_month,start_day,start_year)
-
+
var ends_day = document.new_calendar_item.end_fday.value;
var ends_month = document.new_calendar_item.end_fmonth.value;
- var ends_year = document.new_calendar_item.end_fyear.value;
- var ends_hour = document.new_calendar_item.end_fhour.value;
+ var ends_year = document.new_calendar_item.end_fyear.value;
+ var ends_hour = document.new_calendar_item.end_fhour.value;
var ends_minute = document.new_calendar_item.end_fminute.value;
- var ends_date = mktime(ends_hour,ends_minute,0,ends_month,ends_day,ends_year)
-
+ var ends_date = mktime(ends_hour,ends_minute,0,ends_month,ends_day,ends_year)
+
msg_err1 = document.getElementById(\"err_date\");
msg_err2 = document.getElementById(\"err_start_date\");
msg_err3 = document.getElementById(\"err_end_date\");
msg_err4 = document.getElementById(\"err_title\");
-
- if (start_date > ends_date) {
- msg_err1.style.display =\"block\";
+
+ if (start_date > ends_date) {
+ msg_err1.style.display =\"block\";
msg_err1.innerHTML=\"".get_lang('EndDateCannotBeBeforeTheStartDate')."\";
- msg_err2.innerHTML=\"\";msg_err3.innerHTML=\"\";
+ msg_err2.innerHTML=\"\";msg_err3.innerHTML=\"\";
} else if (checkDate(start_month,start_day,start_year) == false) {
msg_err2.style.display =\"block\";
msg_err2.innerHTML=\"".get_lang('InvalidDate')."\";
- msg_err1.innerHTML=\"\";msg_err3.innerHTML=\"\";
+ msg_err1.innerHTML=\"\";msg_err3.innerHTML=\"\";
} else if (checkDate(ends_month,ends_day,ends_year) == false) {
msg_err3.style.display =\"block\";
msg_err3.innerHTML=\"".get_lang('InvalidDate')."\";
- msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";
+ msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";
} else if (document.new_calendar_item.title.value == '') {
msg_err4.style.display =\"block\";
msg_err4.innerHTML=\"".get_lang('FieldRequired')."\";
- msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";msg_err3.innerHTML=\"\";
+ msg_err1.innerHTML=\"\";msg_err2.innerHTML=\"\";msg_err3.innerHTML=\"\";
} else {
if (cbList.length < 1) {
if (!confirm(\"".get_lang('Send2All')."\")) {
- return false;
- }
- }
+ return false;
+ }
+ }
for (var i=0; i\n";
echo "\t
\n";
// the form containing all the groups and all the users of the course
@@ -813,9 +813,9 @@ function show_to_form($to_already_selected)
echo "\t\t",
-
+
"\n\t\t
",
-
+
"\n\t\t";
@@ -837,7 +837,7 @@ function show_to_form($to_already_selected)
function construct_not_selected_select_form($group_list=null, $user_list=null,$to_already_selected=array())
{
echo "\t\t\n";
}
@@ -891,37 +891,37 @@ function construct_selected_select_form($group_list=null, $user_list=null,$to_al
// we load all the groups and all the users into a reference array that we use to search the name of the group / user
$ref_array_groups=get_course_groups();
-
- $ref_array_users=get_course_users();
+
+ $ref_array_users=get_course_users();
// we construct the form of the already selected groups / users
echo "\t\t