MDL-32766 course view section log: update patch

This commit is contained in:
Rossiani Wijaya
2012-05-22 14:02:48 +08:00
parent 15a848ba90
commit 34b84d45b6
3 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -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')) {
+1
View File
@@ -38,6 +38,7 @@ global $DB; // TODO: this is a hack, we should really do something with the SQL
$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!
+1 -1
View File
@@ -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