From acfcf342d557000a4dade4c15274af360eccd354 Mon Sep 17 00:00:00 2001 From: Andrew Robert Nicols Date: Wed, 14 Nov 2012 16:53:27 +0000 Subject: [PATCH] MDL-36601 Ensure that reports remember all days setting All Days was set as the nothing value, but this nothing value was used. Additionally, an insufficient comparison meant that the selecteddate then became Today. --- report/log/locallib.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/report/log/locallib.php b/report/log/locallib.php index 255a4654e2f..e7462f1f27e 100644 --- a/report/log/locallib.php +++ b/report/log/locallib.php @@ -245,7 +245,10 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0, $timemidnight = $today = usergetmidnight($timenow); // Put today up the top of the list - $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) ); + $dates = array( + "0" => get_string('alldays'), + "$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) + ); if (!$course->startdate or ($course->startdate > $timenow)) { $course->startdate = $course->timecreated; @@ -259,7 +262,7 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0, $numdates++; } - if ($selecteddate == "today") { + if ($selecteddate === "today") { $selecteddate = $today; } @@ -319,7 +322,7 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0, } echo html_writer::label(get_string('date'), 'menudate', false, array('class' => 'accesshide')); - echo html_writer::select($dates, "date", $selecteddate, get_string("alldays")); + echo html_writer::select($dates, "date", $selecteddate, false); echo html_writer::label(get_string('showreports'), 'menumodid', false, array('class' => 'accesshide')); echo html_writer::select($activities, "modid", $selectedactivity, get_string("allactivities")); echo html_writer::label(get_string('actions'), 'menumodaction', false, array('class' => 'accesshide')); @@ -563,4 +566,4 @@ function report_log_print_selector_form($course, $selecteduser=0, $selecteddate= echo ''; echo ''; echo ''; -} \ No newline at end of file +}