MDL-49684 timezones: rewrite timezone support
authorPetr Skoda <petr.skoda@totaralms.com>
Sat, 28 Mar 2015 05:46:16 +0000 (18:46 +1300)
committerPetr Skoda <petr.skoda@totaralms.com>
Mon, 6 Apr 2015 01:53:51 +0000 (13:53 +1200)
commitd6e7a63d9a6dcb89676a0ec4de25803895950c32
tree21b9c454870cf9ddd0a4aab439e96d07a7fd664a
parente19b37101fe58f6661767d132180eb6bd3b24788
MDL-49684 timezones: rewrite timezone support

This patch replaces all homegrown timezone
stuff with standard PHP date/time code.

The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!

Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone
60 files changed:
admin/cli/install.php
admin/index.php
admin/settings/location.php
admin/settings/users.php
admin/timezone.php
admin/tool/timezoneimport/index.php [deleted file]
admin/tool/timezoneimport/lang/en/tool_timezoneimport.php [deleted file]
admin/tool/timezoneimport/settings.php [deleted file]
admin/tool/timezoneimport/version.php [deleted file]
admin/tool/uploaduser/user_form.php
availability/condition/date/tests/condition_test.php
backup/util/helper/backup_cron_helper.class.php
backup/util/helper/tests/cronhelper_test.php
calendar/classes/type_factory.php
calendar/lib.php
calendar/tests/calendartype_test.php
calendar/tests/rrule_manager_tests.php
calendar/type/gregorian/classes/structure.php
calendar/upgrade.txt
install.php
lang/en/admin.php
lib/classes/date.php [new file with mode: 0644]
lib/classes/plugin_manager.php
lib/classes/task/scheduled_task.php
lib/datalib.php
lib/db/install.xml
lib/db/upgrade.php
lib/deprecatedlib.php
lib/form/tests/dateselector_test.php
lib/form/tests/datetimeselector_test.php
lib/googleapi.php
lib/moodlelib.php
lib/olson.php [deleted file]
lib/phpunit/classes/advanced_testcase.php
lib/phpunit/classes/util.php
lib/phpunit/tests/advanced_test.php
lib/setup.php
lib/statslib.php
lib/tests/behat/timezone.feature [new file with mode: 0644]
lib/tests/date_legacy_test.php
lib/tests/date_test.php [new file with mode: 0644]
lib/tests/fixtures/timezonewindows.xml [new file with mode: 0644]
lib/tests/moodlelib_test.php
lib/tests/scheduled_task_test.php
lib/tests/statslib_test.php
lib/timezone.txt [deleted file]
lib/upgrade.txt
mod/chat/lib.php
mod/forum/lib.php
mod/forum/locallib.php
mod/forum/tests/maildigest_test.php
mod/scorm/lib.php
mod/url/locallib.php
user/edit.php
user/edit_form.php
user/editadvanced.php
user/editadvanced_form.php
user/editlib.php
user/profile.php
version.php