]> git.mjollnir.org Git - moodle.git/commitdiff
workaround by Dan for bug #6130, fixed some warnings; merged from MOODLE_16_STABLE
authorskodak <skodak>
Mon, 17 Jul 2006 07:31:22 +0000 (07:31 +0000)
committerskodak <skodak>
Mon, 17 Jul 2006 07:31:22 +0000 (07:31 +0000)
calendar/event.php
calendar/event_new.html

index b7c78d64ab9ad5837d5af708f9765e10f9c4b7bc..7093c95290f2ad2306dd51213df961871ffe450a 100644 (file)
 
             if($eventtype == 'select') {
                 $courseid = optional_param('courseid', $SESSION->cal_course_referer, PARAM_INT);
+                if ($courseid == 0) { // workaround by Dan for bug #6130
+                    $courseid = SITEID;
+                }
                 if (!$course = get_record('course', 'id', $courseid)) {
                     error('Incorrect course ID');
                 }
index 3c036bec4e7dcef548a38666aed1d09570ab9aaf..6820973cfd240c4a8c4ec930d0defceafe0d60fc 100644 (file)
@@ -29,9 +29,9 @@
       <?php print_string('eventdate', 'calendar'); ?>:
     </td>
     <td>
-      <?php print_date_selector('startday', 'startmon', 'startyr', $form->timestart);?>
+      <?php print_date_selector('startday', 'startmon', 'startyr', (int)$form->timestart);?>
       <?php print_string('eventtime', 'calendar');?>
-      <?php print_time_selector('starthr', 'startmin', $form->timestart) ?>
+      <?php print_time_selector('starthr', 'startmin', (int)$form->timestart) ?>
       <?php if (isset($err['timestart'])) formerr($err['timestart']); ?>
     </td>
   </tr>