mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
Improvements to timezone import interface
This commit is contained in:
parent
c9e55a2583
commit
a1e93da26c
5 changed files with 113 additions and 168 deletions
|
@ -208,7 +208,7 @@ function get_records_csv($file, $table) {
|
|||
function put_records_csv($file, $records, $table = NULL) {
|
||||
global $CFG, $db;
|
||||
|
||||
if(empty($records)) {
|
||||
if (empty($records)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,8 @@ function put_records_csv($file, $records, $table = NULL) {
|
|||
return false;
|
||||
}
|
||||
|
||||
echo "x";
|
||||
|
||||
if(!($fp = @fopen($CFG->dataroot.'/temp/'.$file, 'w'))) {
|
||||
error('put_records_csv failed to open '.$file);
|
||||
}
|
||||
|
@ -231,6 +233,7 @@ function put_records_csv($file, $records, $table = NULL) {
|
|||
else {
|
||||
return false;
|
||||
}
|
||||
echo "x";
|
||||
|
||||
if(!empty($metacolumns)) {
|
||||
$fields_table = array_map(create_function('$a', 'return $a->name;'), $metacolumns);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php //$Id$
|
||||
|
||||
/***
|
||||
*** olson_todst ($filename)
|
||||
*** olson_to_timezones ($filename)
|
||||
***
|
||||
*** Parses the olson files for Zones and DST rules.
|
||||
*** It updates the Moodle database with the Zones/DST rules
|
||||
|
@ -9,7 +9,7 @@
|
|||
*** Returns true/false
|
||||
***
|
||||
*/
|
||||
function olson_todst ($filename) {
|
||||
function olson_to_timezones ($filename) {
|
||||
|
||||
$zones = olson_simple_zone_parser($filename);
|
||||
$rules = olson_simple_rule_parser($filename);
|
||||
|
@ -627,4 +627,4 @@ function olson_parse_at ($at, $set = 'set', $gmtoffset) {
|
|||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue