Skip to content
Browse files

MDL-32766 course view section log: update patch

  • Loading branch information...
1 parent 15a848b commit 34b84d45b6abfdbbc325635bd88893b7d3052b8a @rwijaya rwijaya committed May 22, 2012
Showing with 8 additions and 2 deletions.
  1. +6 −1 course/view.php
  2. +1 −0 lib/db/log.php
  3. +1 −1 version.php
View
7 course/view.php
@@ -90,11 +90,16 @@
$logparam = 'id='. $course->id;
$loglabel = 'view';
+ $infoid = $course->id;
if(!empty($section)) {
$logparam .= '&section='. $section;
$loglabel = 'view section';
+ $sectionparams = array('course' => $course->id, 'section' => $section);
+ if ($coursesections = $DB->get_record('course_sections', $sectionparams, 'id', MUST_EXIST)) {
+ $infoid = $coursesections->id;
}
- add_to_log($course->id, 'course', $loglabel, "view.php?". $logparam, "$course->fullname");
+ }
+ add_to_log($course->id, 'course', $loglabel, "view.php?". $logparam, $infoid);
$course->format = clean_param($course->format, PARAM_ALPHA);
if (!file_exists($CFG->dirroot.'/course/format/'.$course->format.'/format.php')) {
View
1 lib/db/log.php
@@ -38,6 +38,7 @@
$logs = array(
array('module'=>'course', 'action'=>'user report', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')),
array('module'=>'course', 'action'=>'view', 'mtable'=>'course', 'field'=>'fullname'),
+ array('module'=>'course', 'action'=>'view section', 'mtable'=>'course_section', 'field'=>'COALESCE(name, section)'),
array('module'=>'course', 'action'=>'update', 'mtable'=>'course', 'field'=>'fullname'),
array('module'=>'course', 'action'=>'enrol', 'mtable'=>'course', 'field'=>'fullname'), // there should be some way to store user id of the enrolled user!
array('module'=>'course', 'action'=>'unenrol', 'mtable'=>'course', 'field'=>'fullname'), // there should be some way to store user id of the enrolled user!
View
2 version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012051900.00; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2012051900.01; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

0 comments on commit 34b84d4

Please sign in to comment.
Something went wrong with that request. Please try again.