Fixed a timezone bug.

If the the timezone is changed from local time in php.ini,
the event model still uses the machine's local time zone. The reason
is it is still using sql's NOW() function. This has now been fixed.

The same modification was already made in 3.1 / dev.
Added a small event model test

I have added a small test for event model to test the due_in
attribute. The test checks that the model uses the php time zone
instead of the sql time zone when calculating the due_in field.
The test uses assertWithinMargin, because the difference between
the time within the test and time used by the model may be
off by a few seconds depending on the speed of the machine. The
difference is alright since we mostly care that the correct time
zone is used which has differences measure in hours.

The test will have to be modified in version 3.1 to accomodate for
the possibility that the timezone is set in system parameters and
not in php.ini.
Modified courses/edit for instructor in no faculties

When instructors are created with no faculties, their list of
available instructors is empty. This causes a problem when the
course is edited (Eg. change the title). Since the list of instructors
would be empty, the list of selected instructors would also be empty.
This will cause the list of instructors in the course to be removed.

I have now fixed the problem by appending the course's instructors
to the beginning of the list of available instructors whether
the instructors are in the same faculties or not.
Fixed courses edit

A bug was found when user A edits the user B's profile if User A does
not have access to all of the courses user B is enrolled in. The problem
was user B would be unenrolled from the courses User A does not have
access to.

I have also copied the fix from dev for another problem which is
if all the courses are unselected, the user would not be unenrolled
from any of the courses.
Fixed courses edit for instructors and tutors

I have fixed unenrolling all courses for instructors and tutors
from courses edit similar to the fix for students. When tutors
are unenrolled using this method, they are also removed from
the groups they are in.
Fixed survey group member model tests

I have added the missing fixtures
Fixed reported bug in student index

The bug is events that are not released (release dates are in the
future) are placed in the expired section, when they should not be
displayed at all. The reason behind the bug is events in the above
situation are fulfills one of the filters requirements (no submissions
and date is before result_release_date_end.

To fix this bug I have added an extra condition which is the current
date and time has to also be after release_date_end for the event
to be placed in the expired section.

I have added an extra event to test this bug. The event is set to
be released "next" year on July 31st. Using the existing tests, we
can check that the bug is permanently fixed. The new event should not
appear in the expired array or any other events' arrays.
Release 3.0.8