From 18763fd41f568e790ed5bf07cb37305ab21c1338 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 29 Jul 2004 14:47:05 +0000 Subject: [PATCH] Added a new course field called enrolperiod that allows a teacher to specify an enrolment period for new students. --- course/edit.html | 17 +++++++++++++++++ lang/en/help/enrolperiod.html | 13 +++++++++++++ lib/db/mysql.php | 4 ++++ lib/db/mysql.sql | 1 + lib/db/postgres7.php | 4 ++++ lib/db/postgres7.sql | 1 + version.php | 2 +- 7 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 lang/en/help/enrolperiod.html diff --git a/course/edit.html b/course/edit.html index 1281500642..b08c11fb16 100644 --- a/course/edit.html +++ b/course/edit.html @@ -12,6 +12,9 @@ if (!isset($form->lang)) { $form->lang = ''; } + if (!isset($form->enrolperiod)) { + $form->enrolperiod = 0; + } ?>
@@ -71,6 +74,20 @@ helpbutton("coursestartdate", get_string("startdate")); ?> + + + +

:

+ enrolperiod", ""); + helpbutton("enrolperiod", get_string("enrolperiod")); + ?> +

:

Enrolment period

+ +

This setting specifies the number of days a student can be + enrolled in this course (starting from the moment they enroll).

+ +

If this is set, then students are automatically unenrolled + after the specified time has elapsed. This is most useful + for rolling courses without a specific start or end time.

+ +

If you don't set this then the student will remain + in this course until they are manually unenrolled or the + clean-up function to remove defunct students takes effect.

+ diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 2b36fda9a1..75615d929b 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -790,6 +790,10 @@ function main_upgrade($oldversion=0) { table_column('course', '', 'cost', 'varchar', '10', '', '', 'not null', 'lang'); } + if ($oldversion < 2004072900) { + table_column('course', '', 'enrolperiod', 'int', '10', 'unsigned', '0', 'not null', 'startdate'); + } + return $result; diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 8ba452bc62..ccb439a285 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -47,6 +47,7 @@ CREATE TABLE `prefix_course` ( `students` varchar(100) NOT NULL default 'Students', `guest` tinyint(2) unsigned NOT NULL default '0', `startdate` int(10) unsigned NOT NULL default '0', + `enrolperiod` int(10) unsigned NOT NULL default '0', `numsections` smallint(5) unsigned NOT NULL default '1', `marker` int(10) unsigned NOT NULL default '0', `maxbytes` int(10) unsigned NOT NULL default '0', diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 7870438f64..064268e7f0 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -532,6 +532,10 @@ function main_upgrade($oldversion=0) { table_column('course', '', 'cost', 'varchar', '10', '', '', 'not null', 'lang'); } + if ($oldversion < 2004072900) { + table_column('course', '', 'enrolperiod', 'int', '10', 'unsigned', '0', 'not null', 'startdate'); + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index 9f04818d6d..ac324ab602 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -25,6 +25,7 @@ CREATE TABLE prefix_course ( students varchar(100) NOT NULL default 'Students', guest integer NOT NULL default '0', startdate integer NOT NULL default '0', + enrolperiod integer NOT NULL default '0', numsections integer NOT NULL default '1', marker integer NOT NULL default '0', maxbytes integer NOT NULL default '0', diff --git a/version.php b/version.php index 5120acad74..88b8862194 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2004072500; // The current version is a date (YYYYMMDDXX) +$version = 2004072900; // The current version is a date (YYYYMMDDXX) $release = "1.4 development"; // User-friendly version number -- 2.39.5