]> git.mjollnir.org Git - moodle.git/commitdiff
Predict the time of settlement at first time. Probably, admin user set up own country...
authorethem <ethem>
Tue, 13 Jun 2006 16:05:15 +0000 (16:05 +0000)
committerethem <ethem>
Tue, 13 Jun 2006 16:05:15 +0000 (16:05 +0000)
Merged from 16stable.

enrol/authorize/config.html

index 21065bc48b200fb48147122fd138d4f9f763dd1b..f2ef6a592a2899c80826703eafaec6ea3716df68 100755 (executable)
@@ -18,11 +18,15 @@ if (!isset($frm->an_emailexpired)) $frm->an_emailexpired = '2';
 if (!isset($frm->an_teachermanagepay)) $frm->an_teachermanagepay = '';
 
 if (isset($CFG->an_cutoff)) {
-    $frm->an_cutoff_hour = intval($CFG->an_cutoff) / 60;
-    $frm->an_cutoff_min = intval($CFG->an_cutoff) % 60;
+    $cutoff = intval($CFG->an_cutoff);
+    $mins = $cutoff % 60; $hrs = ($cutoff - $mins) / 60;
+    $frm->an_cutoff_hour = $hrs; $frm->an_cutoff_min = $mins;
+}
+if (!isset($frm->an_cutoff_hour)) {
+    $timezone = format_float(get_user_timezone_offset(), 1);
+    $frm->an_cutoff_hour = intval($timezone);
+    $frm->an_cutoff_min = (intval(round($timezone)) != intval($timezone)) ? 35 : 5;
 }
-if (!isset($frm->an_cutoff_hour)) $frm->an_cutoff_hour = '0';
-if (!isset($frm->an_cutoff_min)) $frm->an_cutoff_min = '5';
 
 if (!isset($frm->acceptccs)) {
     $frm->acceptccs = array_keys(get_list_of_creditcards());