From 4afe0109d1dd0d67e0a5120ce34739c623aab672 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 31 Jan 2004 11:54:26 +0000 Subject: [PATCH] A new log_display entry for when resources are updated --- mod/resource/db/mysql.php | 5 +++++ mod/resource/db/mysql.sql | 2 ++ mod/resource/db/postgres7.php | 5 +++++ mod/resource/db/postgres7.sql | 2 ++ mod/resource/version.php | 2 +- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mod/resource/db/mysql.php b/mod/resource/db/mysql.php index 9ed1fdc4fa..ead3139d70 100644 --- a/mod/resource/db/mysql.php +++ b/mod/resource/db/mysql.php @@ -10,6 +10,11 @@ function resource_upgrade($oldversion) { table_column("resource", "course", "course", "integer", "10", "unsigned", "0"); } + if ($oldversion < 2004013101) { + modify_database("", "INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name');"); + modify_database("", "INSERT INTO prefix_log_display VALUES ('resource', 'add', 'resource', 'name');"); + } + return true; } diff --git a/mod/resource/db/mysql.sql b/mod/resource/db/mysql.sql index 9c308eed45..4571078a60 100755 --- a/mod/resource/db/mysql.sql +++ b/mod/resource/db/mysql.sql @@ -33,3 +33,5 @@ CREATE TABLE prefix_resource ( # INSERT INTO prefix_log_display VALUES ('resource', 'view', 'resource', 'name'); +INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name'); +INSERT INTO prefix_log_display VALUES ('resource', 'add', 'resource', 'name'); diff --git a/mod/resource/db/postgres7.php b/mod/resource/db/postgres7.php index 0183dddee0..66e9f7a636 100644 --- a/mod/resource/db/postgres7.php +++ b/mod/resource/db/postgres7.php @@ -4,6 +4,11 @@ function resource_upgrade($oldversion) { // This function does anything necessary to upgrade // older versions to match current functionality + if ($oldversion < 2004013101) { + modify_database("", "INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name');"); + modify_database("", "INSERT INTO prefix_log_display VALUES ('resource', 'add', 'resource', 'name');"); + } + return true; } diff --git a/mod/resource/db/postgres7.sql b/mod/resource/db/postgres7.sql index 3ce60d5026..1ee767d661 100644 --- a/mod/resource/db/postgres7.sql +++ b/mod/resource/db/postgres7.sql @@ -31,3 +31,5 @@ CREATE TABLE prefix_resource ( # INSERT INTO prefix_log_display VALUES ('resource', 'view', 'resource', 'name'); +INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name'); +INSERT INTO prefix_log_display VALUES ('resource', 'add', 'resource', 'name'); diff --git a/mod/resource/version.php b/mod/resource/version.php index f4a6b3233d..f3e4fbad43 100644 --- a/mod/resource/version.php +++ b/mod/resource/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2003082000; +$module->version = 2004013101; $module->requires = 2004012000; // Requires this Moodle version $module->cron = 0; -- 2.39.5