Time end not being recorded in external database enrollmentst
I have looked at the enrol/database/enrol.php file and cannot find any code that specifies the time end to be set. In the enrol/manual/enrol.php there is code at about line 140 and line 224 that says:
} elseif (!empty($_GET['confirm'])) {
if ($course->enrolperiod) {
$timestart = time();
$timeend = time() + $course->enrolperiod;
} else {
$timestart = $timeend = 0;
}
There is also a function cron at about line 330 that deletes studnets whose enrolment has expired but nothing in enrol/database/enrol.php and line 368 has the code for notifying teachers of students about to expire but nothing in enrol/database/enrol.php.
Is there a reason that the enrollment information has been left out of the database enrollment option? Any ideas on how I include it - loathe to just copy the code across from enrol/manual/enrol.php as my programming skills are pretty basic to say the least!
Nikki Macfarlane
Re: Time end not being recorded in external database enrollmentst
I have looked at the enrol/database/enrol.php file and cannot find any code that specifies the time end to be set.
It seems the current code is just missing that part. You can file a bug (at http://moodle.org/bugs) or use my 'improved' version of the database enrolment plugin that you can get here:
http://orodruin.escomposlinux.org/~iarenaza/moodle/enrol_db_files_for_16/
(you can see the changes to the stock 1.6.x version in the patch series I have at http://orodruin.escomposlinux.org/~iarenaza/moodle/enrol_db_patch_series_for_16/).
There is also a function cron at about line 330 that deletes studnets whose enrolment has expired but nothing in enrol/database/enrol.php and line 368 has the code for notifying teachers of students about to expire but nothing in enrol/database/enrol.php.
In Moodle 1.6.x, manual enrolment is always enabled, even if you don't use it at all. This means the cron function in the manual enrolment code is always run and thus performs the actions you want. The problem is just that the stock database enrolment is not filling the enrolment period data, so no student (or teacher) enrolment ever expires.
If you use the files mentionned above, everything should work as expected.
Saludos. Iñaki.
Re: Time end not being recorded in external database enrollmentst
Nikki