MDL-29984 fix undefined $today when no course start date
authorPetr Skoda <commits@skodak.org>
Fri, 28 Oct 2011 13:11:42 +0000 (15:11 +0200)
committerPetr Skoda <commits@skodak.org>
Fri, 28 Oct 2011 13:11:42 +0000 (15:11 +0200)
enrol/manual/lib.php

index 206ee89..92d5e74 100644 (file)
@@ -209,10 +209,10 @@ class enrol_manual_plugin extends enrol_plugin {
         $startdateoptions = array();
         $timeformat = get_string('strftimedatefullshort');
         if ($startdate > 0) {
-            $today = time();
-            $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
             $startdateoptions[2] = get_string('coursestart') . ' (' . userdate($startdate, $timeformat) . ')';
         }
+        $today = time();
+        $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
         $startdateoptions[3] = get_string('today') . ' (' . userdate($today, $timeformat) . ')' ;
 
         $modules = array('moodle-enrol_manual-quickenrolment', 'moodle-enrol_manual-quickenrolment-skin');