Better log_display fixes

This commit is contained in:
moodler 2003-01-01 08:15:55 +00:00
parent 14e4a496b4
commit db70b54b62
5 changed files with 32 additions and 4 deletions

View File

@ -230,12 +230,12 @@ function main_upgrade($oldversion=0) {
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)') ");
}
}
if ($oldversion < 2003010100) {
if ($oldversion < 2003010101) {
delete_records("log_display", "module", "user");
$new->module = "user";
$new->action = "view";
$new->mtable = "user";
$new->field = "CONCAT(firstname,\' \',lastname)";
$new->field = "CONCAT(firstname,\" \",lastname)";
insert_record("log_display", $new);
delete_records("log_display", "module", "course");
@ -246,6 +246,8 @@ function main_upgrade($oldversion=0) {
insert_record("log_display", $new);
$new->action = "update";
insert_record("log_display", $new);
$new->action = "enrol";
insert_record("log_display", $new);
}
return true;

View File

@ -227,6 +227,8 @@ CREATE TABLE `prefix_user_teachers` (
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM COMMENT='One record per teacher per course';
INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)');
INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname," ",lastname)');
INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');

View File

@ -19,6 +19,26 @@
function main_upgrade($oldversion=0) {
if ($oldversion < 2003010101) {
delete_records("log_display", "module", "user");
$new->module = "user";
$new->action = "view";
$new->mtable = "user";
$new->field = "CONCAT(firstname,\" \",lastname)";
insert_record("log_display", $new);
delete_records("log_display", "module", "course");
$new->module = "course";
$new->action = "view";
$new->mtable = "course";
$new->field = "fullname";
insert_record("log_display", $new);
$new->action = "update";
insert_record("log_display", $new);
$new->action = "enrol";
insert_record("log_display", $new);
}
return true;
}

View File

@ -137,3 +137,7 @@ CREATE TABLE prefix_user_teachers (
INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname," ",lastname)');
INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');

View File

@ -5,7 +5,7 @@
// database to determine whether upgrades should
// be performed (see lib/db/*.php)
$version = 2003010100; // The current version is a date (YYYYMMDDXX)
$version = 2003010101; // The current version is a date (YYYYMMDDXX)
$release = "1.0.8 alpha"; // User-friendly version number