MDL-10633 fixed regression in last commit

This commit is contained in:
skodak 2008-07-01 23:01:01 +00:00
parent b0e7781eb8
commit 2192e94ef2

View file

@ -97,6 +97,8 @@
}
}
$form = null;
switch($action) {
case 'delete':
$title = get_string('deleteevent', 'calendar');
@ -125,10 +127,6 @@
$form->name = clean_param(strip_tags($form->name,'<lang><span>'), PARAM_CLEAN);
// To avoid double slashes
$form->name = stripslashes($form->name);
$form->description = stripslashes($form->description);
$form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin);
if($form->duration == 1) {
$form->timeduration = make_timestamp($form->endyr, $form->endmon, $form->endday, $form->endhr, $form->endmin) - $form->timestart;
@ -157,25 +155,23 @@
}
execute_sql('UPDATE '.$CFG->prefix.'event SET '.
'name = '.$db->qstr($form->name).','.
'description = '.$db->qstr($form->description).','.
'name = \''.$form->name.'\','.
'description = \''.$form->description.'\','.
'timestart = '.$timestartoffset.','.
'timeduration = '.$form->timeduration.','.
'timemodified = '.time().' WHERE repeatid = '.$event->repeatid);
/// Log the event update.
$form->name = stripslashes($form->name); //To avoid double-slashes
add_to_log($form->courseid, 'calendar', 'edit all', 'event.php?action=edit&amp;id='.$form->id, $form->name);
add_to_log($form->courseid, 'calendar', 'edit all', 'event.php?action=edit&amp;id='.$form->id, stripslashes($form->name));
}
else {
// Update this
$form->timemodified = time();
update_record('event', $form);
/// Log the event update.
$form->name = stripslashes($form->name); //To avoid double-slashes
add_to_log($form->courseid, 'calendar', 'edit', 'event.php?action=edit&amp;id='.$form->id, $form->name);
add_to_log($form->courseid, 'calendar', 'edit', 'event.php?action=edit&amp;id='.$form->id, stripslashes($form->name));
}
// OK, now redirect to day view
@ -260,6 +256,8 @@
break;
}
$form = stripslashes_recursive($form);
// Let's see if we are supposed to provide a referring course link
// but NOT for the "main page" course
if($SESSION->cal_course_referer != SITEID &&