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
If the user has posted in the forum before, follow their previous
discussion preference.
If the user has not posted before, but is subscribed to the forum, follow
their forum preference.
Otherwise, follow their user-preference.
This has the result that if a user has unsubscribed from a forum and writes
their first response; the user preference will be followed. This may
override the forum subscription.
This commit also changes from a dropdown to a checkbox in the post form.
This code was previously misplaced so that only posts in discussion which
had not yet been processed in the current cron run would have keys
generated. If two posts were generated in the same discussion and sent out
on the same cron cycle, only the first post to be processed would have a
key generated.
These sporadic unit test failures were happening because the post time and
subscription time sometimes differ depending on the amount of time it takes
to complete the different components of the test.
To reliably address these issues, the post creation, and the discussion
subscription times are manually updated by different factors to ensure a
more realistic state of affairs.
This adds a reset of the discussion and forum cache when running the mail
and maildigest tests.
These test fails were highlighted by the addition of new tests which
add similar post ids.
The maxeditingtime needs to be a negative value for unit tests to ensure
that the messages are actually sent out.
Whilst fixing this I also discovered that the create_discussion part of the
generator also creates the first post.