From 12b820c2275251f279cf711114fc5562f13f1566 Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 27 Jul 2002 06:07:49 +0000 Subject: [PATCH] Changes to suit new upgrading procedure (admin/index.html) --- mod/assignment/module.php | 12 ++++++++++++ mod/choice/module.php | 16 ++++++++++++---- mod/forum/module.php | 16 ++++++++++++---- mod/journal/module.php | 22 +++++++++++++++++----- mod/survey/module.php | 16 ++++++++++++---- 5 files changed, 65 insertions(+), 17 deletions(-) diff --git a/mod/assignment/module.php b/mod/assignment/module.php index 9f60400b999..afa4c246c1c 100644 --- a/mod/assignment/module.php +++ b/mod/assignment/module.php @@ -5,6 +5,18 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// +$module->fullname = "Assignment"; +$module->version = 20020801; +$module->cron = 60; +$module->search = ""; + +function assignment_upgrade($oldversion) { +// This function does anything necessary to upgrade +// older versions to match current functionality + + return true; +} + ?> diff --git a/mod/choice/module.php b/mod/choice/module.php index 6256b8dc334..31e1f4fa566 100644 --- a/mod/choice/module.php +++ b/mod/choice/module.php @@ -5,10 +5,18 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// - $module->fullname = "Choice"; - $module->version = "20011110"; - $module->cron = 0; - $module->search = ""; +$module->fullname = "Choice"; +$module->version = 20011110; +$module->cron = 0; +$module->search = ""; + +function choice_upgrade($oldversion) { +// This function does anything necessary to upgrade +// older versions to match current functionality + + return true; +} + ?> diff --git a/mod/forum/module.php b/mod/forum/module.php index 65f9fd4d2cc..966b3306736 100644 --- a/mod/forum/module.php +++ b/mod/forum/module.php @@ -5,10 +5,18 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// - $module->fullname = "Forum"; - $module->version = "20020801"; - $module->cron = 0; - $module->search = ""; +$module->fullname = "Forum"; +$module->version = 20020801; +$module->cron = 0; +$module->search = ""; + +function forum_upgrade($oldversion) { +// This function does anything necessary to upgrade +// older versions to match current functionality + + return true; +} + ?> diff --git a/mod/journal/module.php b/mod/journal/module.php index 608216d1d32..10bcf6e01f9 100644 --- a/mod/journal/module.php +++ b/mod/journal/module.php @@ -5,10 +5,22 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// - $module->fullname = "Journal"; - $module->version = "20011110"; - $module->cron = 0; - $module->search = ""; +$module->fullname = "Journal"; +$module->version = 200208010; +$module->cron = 60; +$module->search = ""; -?> +function journal_upgrade($oldversion) { +// This function does anything necessary to upgrade +// older versions to match current functionality + $result = true; + + if ($oldversion < 20020810) { + if (! execute_sql("ALTER TABLE `journal_entries` ADD `mailed` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL")) { + $result = false; + } + } + + return $result; +} diff --git a/mod/survey/module.php b/mod/survey/module.php index 82319a6f108..8369de85151 100644 --- a/mod/survey/module.php +++ b/mod/survey/module.php @@ -5,10 +5,18 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// - $module->fullname = "Survey"; - $module->version = "20011110"; - $module->cron = 0; - $module->search = ""; +$module->fullname = "Survey"; +$module->version = 20020727; +$module->cron = 0; +$module->search = ""; + +function survey_upgrade($oldversion) { +// This function does anything necessary to upgrade +// older versions to match current functionality + + return true; +} + ?>