From: stronk7 Date: Sun, 4 Jun 2006 00:54:34 +0000 (+0000) Subject: report XXXX actions added. Bug 5714. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ae57b07c06a651ccc0460a67a289a93c67a9eb62;p=moodle.git report XXXX actions added. Bug 5714. (http://moodle.org/bugs/bug.php?op=show&bugid=5714) More or less, merged from MOODLE_16_STABLE --- diff --git a/lib/db/mysql.php b/lib/db/mysql.php index d7de119942..4fe7e51d62 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -1963,6 +1963,26 @@ function main_upgrade($oldversion=0) { execute_sql("ALTER TABLE `{$CFG->prefix}stats_user_monthly` CHANGE `writes` statswrites int(10) unsigned NOT NULL default 0", false); } + + // Adding some missing log actions + if ($oldversion < 2006060400) { + // But only if they doesn't exist (because this was introduced after branch and we could be duplicating!) + if (!record_exists('log_display', 'module', 'course', 'action', 'report log')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report log', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report live')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report live', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report outline')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report outline', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report participation')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report participation', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report stats')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname')"); + } + } return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index aaa322891c..96e1d6c3fb 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -905,6 +905,11 @@ INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'view', 'course', 'fullname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'update', 'course', 'fullname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'enrol', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report log', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report live', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report outline', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report participation', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'write', 'user', 'CONCAT(firstname," ",lastname)'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'read', 'user', 'CONCAT(firstname," ",lastname)'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'add contact', 'user', 'CONCAT(firstname," ",lastname)'); diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 3c6ac1820a..31df850b9b 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -1590,7 +1590,27 @@ function main_upgrade($oldversion=0) { execute_sql("ALTER TABLE {$CFG->prefix}stats_user_monthly RENAME COLUMN writes TO statswrites", false); } - + + // Adding some missing log actions + if ($oldversion < 2006060400) { + // But only if they doesn't exist (because this was introduced after branch and we could be duplicating!) + if (!record_exists('log_display', 'module', 'course', 'action', 'report log')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report log', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report live')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report live', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report outline')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report outline', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report participation')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report participation', 'course', 'fullname')"); + } + if (!record_exists('log_display', 'module', 'course', 'action', 'report stats')) { + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname')"); + } + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index 8de856179c..62ec8abc45 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -675,6 +675,11 @@ INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'view', 'course', 'fullname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'update', 'course', 'fullname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'enrol', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report log', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report live', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report outline', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report participation', 'course', 'fullname'); +INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'write', 'user', 'firstname||\' \'||lastname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'read', 'user', 'firstname||\' \'||lastname'); INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('message', 'add contact', 'user', 'firstname||\' \'||lastname'); diff --git a/version.php b/version.php index 9341438b4e..8f3415f811 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2006052400; // YYYYMMDD = date + $version = 2006060400; // YYYYMMDD = date // XY = increments within a single day $release = '1.7 dev'; // Human-friendly version name