diff --git a/main/calendar/myagenda.inc.php b/main/calendar/myagenda.inc.php index 6d428c14e2..bfd3345b6e 100755 --- a/main/calendar/myagenda.inc.php +++ b/main/calendar/myagenda.inc.php @@ -123,7 +123,6 @@ function get_myagendaitems($courses_dbs, $month, $year) { $items[$agendaday][$item['start_date']] .= '
'."".$agenda_link." ".Security::remove_XSS($item['title'])."
"; $items[$agendaday][$item['start_date']] .= '
'; } - } // sorting by hour for every day $agendaitems = array (); @@ -136,6 +135,8 @@ function get_myagendaitems($courses_dbs, $month, $year) { $agendaitems[$agendaday] .= $val; } } + + //print_r($agendaitems); return $agendaitems; } @@ -162,19 +163,18 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra $backwardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".Security::remove_XSS($g_cc)."&action=view&view=month&month=". ($month == 1 ? 12 : $month -1)."&year=". ($month == 1 ? $year -1 : $year); $forewardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".Security::remove_XSS($g_cc)."&action=view&view=month&month=". ($month == 12 ? 1 : $month +1)."&year=". ($month == 12 ? $year +1 : $year); - echo "\n", "\n", ""; - echo "\n", "", ""; + echo "
".Display::return_icon('action_prev.png',get_lang('Previous'))."", $monthName, " ", $year, "".Display::return_icon('action_next.png',get_lang('Next'))."
", "", ""; + echo "", "", ""; - echo "\n"; - for ($ii = 1; $ii < 8; $ii ++) - { - echo "\n"; + echo ""; + for ($ii = 1; $ii < 8; $ii ++) { + echo ""; } - echo "\n"; + echo ""; $curday = -1; $today = getdate(); while ($curday <= $numberofdays[$month]) { - echo "\n"; + echo ""; for ($ii = 0; $ii < 7; $ii ++) { if (($curday == -1) && ($ii == $startdayofweek)) { $curday = 1; @@ -183,22 +183,22 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra $bgcolor = $ii < 5 ? $class = "class=\"days_week\" style=\"width:10%;\"" : $class = "class=\"days_weekend\" style=\"width:10%;\""; $dayheader = "$curday
"; if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) { - $dayheader = "$curday - ".get_lang("Today")."
"; + $dayheader = "$curday - ".get_lang('Today')."
"; $class = "class=\"days_today\" style=\"width:10%;\""; } echo "\n"; + echo ""; $curday ++; } else { - echo "\n"; + echo ""; } } - echo "\n"; + echo ""; } - echo "
".Display::return_icon('action_prev.png',get_lang('Previous'))."", $monthName, " ", $year, "".Display::return_icon('action_next.png',get_lang('Next'))."
", $DaysShort[$ii % 7], "
", $DaysShort[$ii % 7], "
", "".$dayheader; if (!empty($agendaitems[$curday])) { echo "".$agendaitems[$curday].""; } - echo "  
\n"; + echo ""; } /** * Show the mini calender of the given month @@ -217,20 +217,20 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) { $backwardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".Security::remove_XSS($g_cc)."&month=". ($month == 1 ? 12 : $month -1)."&year=". ($month == 1 ? $year -1 : $year); $forewardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&courseCode=".Security::remove_XSS($g_cc)."&month=". ($month == 12 ? 1 : $month +1)."&year=". ($month == 12 ? $year +1 : $year); - echo "\n", "\n", ""; - echo "\n", "", ""; + echo "
".Display::return_icon('action_prev.png',get_lang('Previous'))."", $monthName, " ", $year, "".Display::return_icon('action_next.png',get_lang('Next'))."
", "", ""; + echo "", "", ""; - echo "\n"; + echo ""; for ($ii = 1; $ii < 8; $ii ++) { - echo "\n"; + echo ""; } - echo "\n"; + echo ""; $curday = -1; $today = getdate(); while ($curday <= $numberofdays[$month]) { - echo "\n"; + echo ""; for ($ii = 0; $ii < 7; $ii ++) { if (($curday == -1) && ($ii == $startdayofweek)) { @@ -245,7 +245,7 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) { $dayheader = "$curday"; $class = "class=\"days_today\""; } - echo "\t\n"; + // "a".$dayheader." ".$agendaitems[$curday].""; + echo ""; $curday ++; } else { - echo "\n"; + echo ""; } } - echo "\n"; + echo ""; } - echo "
".Display::return_icon('action_prev.png',get_lang('Previous'))."", $monthName, " ", $year, "".Display::return_icon('action_next.png',get_lang('Next'))."
", $DaysShort[$ii % 7], "", $DaysShort[$ii % 7], "
"; + echo ""; if (!empty($agendaitems[$curday])) { echo "".$dayheader.""; @@ -254,18 +254,18 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) { { echo $dayheader; } - // "a".$dayheader." ".$agendaitems[$curday]."\n"; - echo "  
\n"; + echo ""; } /** @@ -612,12 +612,11 @@ function get_personal_agenda_items($agendaitems, $day = "", $month = "", $year = $root_url = $url['url']; } } - + $result = Database::query($sql); - while ($item = Database::fetch_array($result)) - { + while ($item = Database::fetch_array($result)) { // we break the date field in the database into a date and a time part - $agenda_db_date = explode(" ", $item[date]); + $agenda_db_date = explode(" ", $item['date']); $date = $agenda_db_date[0]; $time = $agenda_db_date[1]; // we divide the date part into a day, a month and a year @@ -631,31 +630,29 @@ function get_personal_agenda_items($agendaitems, $day = "", $month = "", $year = $minute = $agendatime[1]; $second = $agendatime[2]; // if the student has specified a course we a add a link to that course - if ($item['course'] <> "") - { + if ($item['course'] <> "") { $url = $root_url."main/calendar/agenda.php?cidReq=".urlencode($item['course'])."&day=$day&month=$month&year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item $course_link = "".$item['course'].""; - } - else - { + } else { $course_link = ""; } // Creating the array that will be returned. If we have week or month view we have an array with the date as the key // if we have a day_view we use a half hour as index => key 33 = 16h30 - if ($type !== "day_view") // This is the array construction for the WEEK or MONTH view - { + if ($type !== "day_view") { + // This is the array construction for the WEEK or MONTH view + //Display events in agenda $agendaitems[$day] .= "
$hour:$minute $course_link ".$item['title']."

"; - } - else // this is the array construction for the DAY view - { + + } else { + // this is the array construction for the DAY view $halfhour = 2 * $agendatime['0']; - if ($agendatime['1'] >= '30') - { + if ($agendatime['1'] >= '30') { $halfhour = $halfhour +1; } //Display events by list $agendaitems[$halfhour] .= "
$hour:$minute $course_link ".$item['title']."
"; + } } //print_r($agendaitems); @@ -711,7 +708,7 @@ function show_personal_agenda() { $export_icon_high = 'export_high_fade.png'; // starting the table output - echo "\n"; + echo "
"; if (Database::num_rows($result) > 0) { @@ -723,7 +720,7 @@ function show_personal_agenda() { if ($month_bar != date("m", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"]))) { $month_bar = date("m", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"])); - echo "\n"; + echo ""; } // highlight: if a date in the small calendar is clicked we highlight the relevant items $db_date = (int) date("d", strtotime($myrow["date"])).date("n", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"])); @@ -740,7 +737,7 @@ function show_personal_agenda() { /*-------------------------------------------------- display: date and time --------------------------------------------------*/ - echo "\t\n\t\t"; + echo ""; echo '\n\t"; + //echo ""; echo ""; /*-------------------------------------------------- display: the title @@ -760,21 +757,21 @@ function show_personal_agenda() { echo ""; echo '\n\t"; - echo "\n"; + echo ""; + echo ""; /*-------------------------------------------------- display: the content --------------------------------------------------*/ $content = $myrow['text']; $content = make_clickable($content); $content = text_filter($content); - echo "\t\n\t\t"; /*-------------------------------------------------- display: the edit / delete icons --------------------------------------------------*/ - echo "\t\n\t\t"; @@ -784,7 +781,7 @@ function show_personal_agenda() { { echo ''; } - echo "
".$MonthsLong[date("n", strtotime($myrow["date"])) - 1]." ".date("Y", strtotime($myrow["date"]))."
".$MonthsLong[date("n", strtotime($myrow["date"])) - 1]." ".date("Y", strtotime($myrow["date"]))."
'; // adding an internal anchor echo ""; @@ -752,7 +749,7 @@ function show_personal_agenda() { //echo ''.Display::return_icon($export_icon_high, get_lang('ExportiCalConfidential')).''; //echo ''.Display::return_icon($export_icon_low, get_lang('ExportiCalPrivate')).''; //echo ''.Display::return_icon($export_icon, get_lang('ExportiCalPublic')).''; - //echo "\n\t\t
'; echo $myrow['title']; - echo "\n\t\t
"; + echo "
"; echo $content; echo "
"; + echo "
"; echo "".Display::return_icon('edit.gif', get_lang('Edit')).""; echo "".Display::return_icon('delete.gif', get_lang('Delete')).""; echo "
'.get_lang('NoAgendaItems').'
\n"; + echo ""; } /**