From 9ac3d68648112a2912abba4e093a42046e039b8e Mon Sep 17 00:00:00 2001 From: prateeksachan Date: Wed, 17 Jul 2013 07:22:37 +0530 Subject: [PATCH] MDL-40420: timemodified field update when lesson_page is updated --- mod/lesson/locallib.php | 1 + mod/lesson/pagetypes/endofbranch.php | 1 + mod/lesson/pagetypes/endofcluster.php | 1 + mod/lesson/pagetypes/essay.php | 1 + mod/lesson/pagetypes/matching.php | 1 + mod/lesson/pagetypes/truefalse.php | 1 + 6 files changed, 6 insertions(+) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 314e4c78a0e90..49d03129744ce 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -2119,6 +2119,7 @@ public function update($properties, $context = null, $maxbytes = null) { if ($maxbytes === null) { $maxbytes = get_user_max_upload_file_size($context); } + $properties->timemodified = time(); $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$maxbytes), $context, 'mod_lesson', 'page_contents', $properties->id); $DB->update_record("lesson_pages", $properties); diff --git a/mod/lesson/pagetypes/endofbranch.php b/mod/lesson/pagetypes/endofbranch.php index 315f51dab210e..ed40281566778 100644 --- a/mod/lesson/pagetypes/endofbranch.php +++ b/mod/lesson/pagetypes/endofbranch.php @@ -107,6 +107,7 @@ public function update($properties, $context = null, $maxbytes = null) { if (empty($properties->qoption)) { $properties->qoption = '0'; } + $properties->timemodified = time(); $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$PAGE->course->maxbytes), context_module::instance($PAGE->cm->id), 'mod_lesson', 'page_contents', $properties->id); $DB->update_record("lesson_pages", $properties); diff --git a/mod/lesson/pagetypes/endofcluster.php b/mod/lesson/pagetypes/endofcluster.php index f4cdb8b6e621f..b552e0a021e5d 100644 --- a/mod/lesson/pagetypes/endofcluster.php +++ b/mod/lesson/pagetypes/endofcluster.php @@ -76,6 +76,7 @@ public function update($properties, $context = null, $maxbytes = null) { if (empty($properties->qoption)) { $properties->qoption = '0'; } + $properties->timemodified = time(); $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$PAGE->course->maxbytes), context_module::instance($PAGE->cm->id), 'mod_lesson', 'page_contents', $properties->id); $DB->update_record("lesson_pages", $properties); diff --git a/mod/lesson/pagetypes/essay.php b/mod/lesson/pagetypes/essay.php index 293d989f5fc4e..3fc1ac7781cbe 100644 --- a/mod/lesson/pagetypes/essay.php +++ b/mod/lesson/pagetypes/essay.php @@ -131,6 +131,7 @@ public function update($properties, $context = null, $maxbytes = null) { $answers = $this->get_answers(); $properties->id = $this->properties->id; $properties->lessonid = $this->lesson->id; + $properties->timemodified = time(); $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$PAGE->course->maxbytes), context_module::instance($PAGE->cm->id), 'mod_lesson', 'page_contents', $properties->id); $DB->update_record("lesson_pages", $properties); diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php index 5ad5af0da5bb5..dc83ac5592848 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -297,6 +297,7 @@ public function update($properties, $context = null, $maxbytes = null) { $answers = $this->get_answers(); $properties->id = $this->properties->id; $properties->lessonid = $this->lesson->id; + $properties->timemodified = time(); $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$PAGE->course->maxbytes), context_module::instance($PAGE->cm->id), 'mod_lesson', 'page_contents', $properties->id); $DB->update_record("lesson_pages", $properties); diff --git a/mod/lesson/pagetypes/truefalse.php b/mod/lesson/pagetypes/truefalse.php index 49adeb55e7bf6..aa627641f7f2b 100644 --- a/mod/lesson/pagetypes/truefalse.php +++ b/mod/lesson/pagetypes/truefalse.php @@ -157,6 +157,7 @@ public function update($properties, $context = null, $maxbytes = null) { $answers = $this->get_answers(); $properties->id = $this->properties->id; $properties->lessonid = $this->lesson->id; + $properties->timemodified = time(); $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$PAGE->course->maxbytes), context_module::instance($PAGE->cm->id), 'mod_lesson', 'page_contents', $properties->id); $DB->update_record("lesson_pages", $properties);