an enrolment period for new students.
if (!isset($form->lang)) {
$form->lang = '';
}
+ if (!isset($form->enrolperiod)) {
+ $form->enrolperiod = 0;
+ }
?>
<FORM METHOD="post" action="edit.php" NAME="form">
<table cellpadding=9 cellspacing=0 >
helpbutton("coursestartdate", get_string("startdate"));
?></td>
</tr>
+<tr valign=top>
+ <td align="right"><P><?php print_string("enrolperiod") ?>:</td>
+ <td>
+ <?php
+ $periodmenu[0] = get_string('unlimited');
+ for ($i=1; $i<=365; $i++) {
+ $seconds = $i * 86400;
+ $periodmenu[$seconds] = get_string('numdays', '', $i);
+ }
+ choose_from_menu ($periodmenu, "enrolperiod", "$form->enrolperiod", "");
+ helpbutton("enrolperiod", get_string("enrolperiod"));
+ ?>
+ </td>
+</tr>
<tr valign=top>
<td align="right"><P><?php print_string("numberweeks") ?>:</td>
<td><?php
--- /dev/null
+<p align="center"><b>Enrolment period</b></b></p>
+
+<p>This setting specifies the number of days a student can be
+ enrolled in this course (starting from the moment they enroll).</p>
+
+<p>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.</p>
+
+<p>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. </p>
+
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;
`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',
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;
}
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',
// 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