Rename an_cutoff_hour and an_cutoff_min to an_cutoff.
This commit is contained in:
@@ -17,14 +17,11 @@ function getsettletime($time)
|
||||
{
|
||||
global $CFG;
|
||||
|
||||
$hrs = intval($CFG->an_cutoff_hour);
|
||||
$mins = intval($CFG->an_cutoff_min);
|
||||
$cutoff = intval($CFG->an_cutoff); $hrs = $cutoff / 60; $mins = $cutoff % 60;
|
||||
$cutofftime = strtotime("$hrs:$mins", $time);
|
||||
|
||||
if ($cutofftime < $time) {
|
||||
$cutofftime = strtotime("$hrs:$mins", $time + (24 * 3600));
|
||||
}
|
||||
|
||||
return $cutofftime;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@ if (!isset($frm->an_test)) $frm->an_test = '';
|
||||
if (!isset($frm->an_review)) $frm->an_review = '';
|
||||
if (!isset($frm->an_capture_day)) $frm->an_capture_day = '5';
|
||||
if (!isset($frm->an_emailexpired)) $frm->an_emailexpired = '2';
|
||||
|
||||
if (isset($CFG->an_cutoff)) {
|
||||
$frm->an_cutoff_hour = intval($CFG->an_cutoff) / 60;
|
||||
$frm->an_cutoff_min = intval($CFG->an_cutoff) % 60;
|
||||
}
|
||||
if (!isset($frm->an_cutoff_hour)) $frm->an_cutoff_hour = '0';
|
||||
if (!isset($frm->an_cutoff_min)) $frm->an_cutoff_min = '5';
|
||||
|
||||
|
||||
@@ -79,11 +79,23 @@ function authorize_upgrade($oldversion=0) {
|
||||
execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP authcode", false);
|
||||
}
|
||||
|
||||
if ($oldversion < 2006010200) {
|
||||
if (isset($CFG->an_review_day)) { // rename an_review_day
|
||||
set_config('an_capture_day', $CFG->an_review_day);
|
||||
delete_records('config', 'name', 'an_review_day');
|
||||
}
|
||||
if ($oldversion < 2006010200) { // rename an_review_day
|
||||
if (isset($CFG->an_review_day)) {
|
||||
set_config('an_capture_day', $CFG->an_review_day);
|
||||
delete_records('config', 'name', 'an_review_day');
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2006020100) { // rename an_cutoff_hour and an_cutoff_min to an_cutoff
|
||||
if (isset($CFG->an_cutoff_hour) && isset($CFG->an_cutoff_min)) {
|
||||
$an_cutoff_hour = intval($CFG->an_cutoff_hour);
|
||||
$an_cutoff_min = intval($CFG->an_cutoff_min);
|
||||
$an_cutoff = ($an_cutoff_hour * 60) + $an_cutoff_min;
|
||||
if (set_config('an_cutoff', $an_cutoff)) {
|
||||
delete_records('config', 'name', 'an_cutoff_hour');
|
||||
delete_records('config', 'name', 'an_cutoff_min');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -79,13 +79,25 @@ function authorize_upgrade($oldversion=0) {
|
||||
execute_sql("ALTER TABLE {$CFG->prefix}enrol_authorize DROP authcode", false);
|
||||
}
|
||||
|
||||
if ($oldversion < 2006010200) {
|
||||
if (isset($CFG->an_review_day)) { // rename an_review_day
|
||||
if ($oldversion < 2006010200) { // rename an_review_day
|
||||
if (isset($CFG->an_review_day)) {
|
||||
set_config('an_capture_day', $CFG->an_review_day);
|
||||
delete_records('config', 'name', 'an_review_day');
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2006020100) { // rename an_cutoff_hour and an_cutoff_min to an_cutoff
|
||||
if (isset($CFG->an_cutoff_hour) && isset($CFG->an_cutoff_min)) {
|
||||
$an_cutoff_hour = intval($CFG->an_cutoff_hour);
|
||||
$an_cutoff_min = intval($CFG->an_cutoff_min);
|
||||
$an_cutoff = ($an_cutoff_hour * 60) + $an_cutoff_min;
|
||||
if (set_config('an_cutoff', $an_cutoff)) {
|
||||
delete_records('config', 'name', 'an_cutoff_hour');
|
||||
delete_records('config', 'name', 'an_cutoff_min');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -463,8 +463,10 @@ class enrolment_plugin extends enrolment_base
|
||||
set_config('an_avs', optional_param('an_avs', ''));
|
||||
set_config('an_test', optional_param('an_test', ''));
|
||||
set_config('an_referer', optional_param('an_referer', 'http://', PARAM_URL));
|
||||
set_config('an_cutoff_hour', optional_param('an_cutoff_hour', 0, PARAM_INT));
|
||||
set_config('an_cutoff_min', optional_param('an_cutoff_min', 5, PARAM_INT));
|
||||
|
||||
$cutoff_hour = optional_param('an_cutoff_hour', 0, PARAM_INT);
|
||||
$cutoff_min = optional_param('an_cutoff_min', 5, PARAM_INT);
|
||||
set_config('an_cutoff', $cutoff_hour * 60 + $cutoff_min);
|
||||
|
||||
$reviewval = optional_param('an_review', '');
|
||||
$captureday = optional_param('an_capture_day', 5, PARAM_INT);
|
||||
@@ -604,7 +606,7 @@ class enrolment_plugin extends enrolment_base
|
||||
}
|
||||
|
||||
if (empty($CFG->an_review) || (!empty($CFG->an_test)) ||
|
||||
intval($CFG->an_capture_day < 1) || (!$this->check_openssl_loaded())) {
|
||||
(intval($CFG->an_capture_day) < 1) || (!$this->check_openssl_loaded())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
$module->version = 2006010200;
|
||||
$module->version = 2006020100;
|
||||
$module->requires = 2005072200;
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user