From: Barry Oosthuizen Date: Tue, 31 Mar 2015 10:35:19 +0000 (+0100) Subject: Check if there is a manual enrolment with no expiry date X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=678e2a297bc437605659ca9a2e5137f43db99094;p=moodle-mod_attendance.git Check if there is a manual enrolment with no expiry date --- diff --git a/locallib.php b/locallib.php index 2700b9e..b50128c 100644 --- a/locallib.php +++ b/locallib.php @@ -1038,7 +1038,7 @@ class attendance { // CONTRIB-4868 $mintime = 'MIN(CASE WHEN (ue.timestart > :zerotime) THEN ue.timestart ELSE ue.timecreated END)'; - $maxtime = 'MAX(ue.timeend)'; + $maxtime = 'CASE WHEN MIN(ue.timeend) = 0 THEN 0 ELSE MAX(ue.timeend) END'; // CONTRIB-3549 $sql = "SELECT ue.userid, ue.status,