21 Commits

Author SHA1 Message Date
Rajesh Taneja
d61d3e82d0 MDL-42537 calendar: locale charset on windows will come from calendartype
date_format_string() will now convert date on windows based on calendar type used
2013-11-04 15:54:19 +08:00
Mark Nelson
1d43da0220 MDL-41664 core_calendar: replaced class variables that stored minimum and maximum years with functions
Also made slight changes to the existing functions.
2013-10-30 12:42:12 +08:00
Adrian Greeve
73412d9680 MDL-41664 - Calendar: Add method for formating years in the new calendar plugin. 2013-10-30 11:53:16 +08:00
Petr Škoda
ed661154de MDL-41792 fix calendar test typos 2013-10-08 23:08:27 +02:00
Mark Nelson
bcd5c6a958 MDL-41792 core_calendar: added some behat tests to cover calendar functionality 2013-10-04 16:17:03 +08:00
Mark Nelson
070bd1db6f MDL-41792 core_calendar: added missing abstract functions to test calendar 2013-10-04 16:17:03 +08:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Mark Nelson
5ca04d0ef1 MDL-18375 calendar: fixed issue when resaving the year in the datetime field causing the year to decrease
For example, a user may create a date/time profile field and set the 'Start year'
field to '2012'. Another user, using the Hijri calendar, may edit the name of
this field. They visit the settings page and in this case the date '1/1/2012'
is converted to '7/2/1433' in Hijri. So, the year '1433' is then displayed.
The user then changes the name of this field and saves the form. This is where
the issue occurs, as the date '1/1/1433' is converted into Gregorian, which
converts to the year '26/09/2011', so the year '2011' is saved in the DB, not
'2012'.
2013-09-05 18:32:16 +08:00
Mark Nelson
deed22ea39 MDL-18375 calendar: removed usage of the calendar type in the usergetdate function
The usergetdate function is not only used to display dates, it is also passed
to the function make_timestamp. This means users using another calendar type
other than Gregorian will generate incorrect timestamps which may be saved in
the DB or used to populate the date_selector and date_time_selector elements.
For example, when creating an assignment using another calendar type other
than Gregorian, the mod_form.php file calls $this->apply_admin_defaults()
which uses the function usergetmidnight to set the "Allow submissions from"
date to today's date and the "Due date" field to 7 days in the future. The
usergetmidnight function calls usergetdate which is then passed to
make_timestamp. Since the usergetdate function was using the calendar
type's timestamp_to_date_array function the date being passed to
make_timestamp was not in Gregorian. So, when using the hijri calendar the
year 1434 was being passed which was generating a large negative number as
the timestamp which was then used to populate the date fields.
2013-09-05 18:32:16 +08:00
Mark Nelson
6eafa4ddba MDL-18375 calendar: changed the name of the function factory to be more descriptive 2013-09-05 18:32:16 +08:00
Mark Nelson
df01e4c748 MDL-18375 calendar: PHPDoc tidy up as well as some other minor changes 2013-09-05 18:32:16 +08:00
Mark Nelson
f59ab4adc8 MDL-18375 calendar: renamed the userdate/usergetdate functions and changed them to abstract
Renamed the userdate/usergetdate functions in the calendar type to be more
descriptive and made them abstract to ensure developers implement this
functionality in their calendar type.

Also tidied up PHPDocs for these functions.
2013-09-05 18:32:16 +08:00
Mark Nelson
0ae36d6cfc MDL-18375 calendar: created a test calendar type to use for PHPUnit tests and added tests 2013-09-05 18:32:16 +08:00
Dan Poltawski
3607961d8f MDL-41157 calendar: add unit tests for calendar_get_course_cached 2013-08-14 11:05:27 +08:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Ankit Agarwal
9dadb59064 MDL-39020 phpunit: Rename incorrect filename
Rename externallib_tests.php to externallib_test.php
Fix failing unit tests
2013-07-01 10:32:28 +08:00
Ankit Agarwal
5ae4e15344 MDL-37562 calendar: Adding unit tests for calendar_update_subscription() 2013-04-08 15:03:31 +08:00
Ankit Agarwal
15c0b1ccef MDL-37101 phpunit: phpunit tests for ws api core_calendar_create_calendar_events 2013-01-22 13:53:23 +08:00
Ankit Agarwal
261a41f16d MDL-37100 webservices: Adding warnings and cleaning up get_calendar_events() api 2013-01-21 11:05:50 +08:00
Ankit Agarwal
7c30224aeb MDL-37100 webservices: PHPunit tests for core_calendar_get_calendar_events() 2013-01-21 11:05:50 +08:00
Ankit Agarwal
644a7ef7a4 MDL-37077 phpunit: Adding phpunit tests for the ws api core_calendar_delete_event 2013-01-15 13:54:38 +08:00