MDL-46991 Availability: Conditional dates not updated on restore

This commit is contained in:
sam marshall 2014-08-29 18:51:18 +01:00
parent 272fec367f
commit 5176504d3f
8 changed files with 158 additions and 55 deletions

View file

@ -209,4 +209,15 @@ class condition extends \core_availability\condition {
protected static function is_midnight($time) {
return usergetmidnight($time) == $time;
}
public function update_after_restore(
$restoreid, $courseid, \base_logger $logger, $name) {
// Update the date, if restoring with changed date.
$dateoffset = \core_availability\info::get_restore_date_offset($restoreid);
if ($dateoffset) {
$this->time += $dateoffset;
return true;
}
return false;
}
}