753 Commits

Author SHA1 Message Date
Damyon Wiese
44585a1ecd Merge branch 'MDL-41792_master' of https://github.com/markn86/moodle 2013-10-08 16:03:46 +08:00
Eloy Lafuente (stronk7)
10d13aaf25 MDL-42188 shifter: delete some orphaned files 2013-10-07 21:44:13 +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
Mark Nelson
da3041379a MDL-41792 core_calendar: refactored the calendar to allow the use of multiple calendar types 2013-10-04 16:17:02 +08:00
Eloy Lafuente (stronk7)
00a6df6b02 Merge branch 'w40_MDL-41999_m26_userpw' of https://github.com/skodak/moodle 2013-10-01 15:59:06 +02:00
Sam Hemelryk
c78fdd8db3 Merge branch 'MDL-41995_master' of https://github.com/markn86/moodle 2013-10-01 14:50:53 +13:00
Petr Škoda
2aaf332bb1 MDL-41999 do not use $USER->password directly 2013-09-27 10:51:13 +02:00
Mark Nelson
14c992b4fc MDL-41995 calendar: changed the page layout for the export page 2013-09-26 16:51:32 +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
2aefba53a5 MDL-18375 calendar: added condition to ensure calendar type exists before loading 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
Mark Nelson
022745acd2 MDL-18375 calendar: implemented the usage of the recently introduced automatic class loading 2013-09-05 18:32:16 +08:00
Mark Nelson
2f00e1b245 MDL-18375 calendar: huge refactor of the initial patch
1) Moved the calendar types location to a sub-folder in the calendar directory.
2) Removed/moved language strings.
3) Removed calendar types that should be downloaded as plugins.
4) Removed a Non-English language pack for the Gregorian calendar type that
should be downloaded separately.
5) Removed custom files responsible for checking for updates and uninstalling
calendar types, which should be done by core.
6) Removed JS from the calendar_month block as there is no non-JS alternative
provided and the JS written does not make use of the YUI library to ensure
multiple browser support.
7) Removed code from the base class responsible for creating timestamps that
are saved in the DB.
8) Added PHPDocs.

Note: In the original patch we are editing core functions responsible for saving
time in the database in the calendar base class. This is very dangerous, we do
not want to touch these functions as it could cause a complete fubar of the
database. There are places we are forcing the use of the gregorian calendar as
we are passing dates generated by the PHP date function, where as sometimes
we pass dates from usergetdate (which was being overwritten to return the
date specific to the calendar). We can not expect third party modules to
change the calendar type depending on the format they pass to these functions.
2013-09-05 18:30:05 +08:00
Shamim Rezaie
6dd59aabfa MDL-18375 calendar: added multiple calendar support
Conflicts:

	course/edit_form.php
	lib/db/install.xml
	lib/form/dateselector.php
	lib/form/datetimeselector.php
	lib/setup.php
2013-09-05 18:30:05 +08:00
Ankit Agarwal
ee74a2a19e MDL-41485 calendar: Replace value of action buttons on managesubscription page with int 2013-08-29 14:55:43 +08:00
Damyon Wiese
74df2951d1 Revert "MDL-39876 Change get_record('course') calls to get_course"
This reverts commit ab7632b74c331540c90229bf03d13aa2e6bdd9be.
2013-08-21 13:42:30 +08:00
Sam Hemelryk
6eee89bc8f Merge branch 'MDL-39876-master' of git://github.com/sammarshallou/moodle
Conflicts:
	course/lib.php
2013-08-21 12:08:46 +12:00
Sam Hemelryk
ead9cce340 Merge branch 'MDL-41157-master' of git://github.com/danpoltawski/moodle 2013-08-21 10:48:02 +12:00
sam marshall
ab7632b74c MDL-39876 Change get_record('course') calls to get_course 2013-08-15 11:31:20 +01:00
Dan Poltawski
d20b0aa567 MDL-41157 calendar: improve calendar_get_course_cached
The function get_course() introduced in 2.5.1 will use $COURSE and
$SITE to avoid an uncessary DB query, simplifying the logic of this
function and improving perf.
2013-08-14 11:05:27 +08:00
Dan Poltawski
3607961d8f MDL-41157 calendar: add unit tests for calendar_get_course_cached 2013-08-14 11:05:27 +08:00
Dan Poltawski
f37c923d14 MDL-19171 fix trailing whitespace 2013-08-13 10:06:34 +08:00
Dan Poltawski
41e337dd82 Merge branch 'MDL-19171' of https://github.com/bostelm/moodle 2013-08-13 09:57:52 +08:00
Henning Bostelmann
f6a5ffe802 MDL-19171 Calendar: show course links in more places 2013-08-08 17:55:01 +01: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
Eloy Lafuente (stronk7)
fb1788c598 Merge branch 'MDL-40424-master' of git://github.com/FMCorz/moodle
Conflicts:
	admin/oacleanup.php
2013-07-17 01:21:51 +02:00
Mary Evans
3ca6cd9665 MDL-40652 Calendar: Changed pagelayout from 'standard' to 'base' in calendar/export.php. 2013-07-14 15:01:50 +01:00
Frederic Massart
2e4c0c9181 MDL-40424 libraries: Deprecate context_instance_preload_sql() 2013-07-12 17:41:49 +08:00
Marina Glancy
f64998fab3 Merge branch 'MDL-39020-master' of git://github.com/ankitagarwal/moodle 2013-07-09 16:32:16 +10:00
Ankit Agarwal
0601e0eef6 MDL-40402 libraries: Replace get_system_context() with context_system::instance() in core 2013-07-04 15:41:06 +08: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
Mary Evans
310845b92d MDL-38896 theme_bootstrapbase: Abbreviated weekdays in calendar/renderer.php + added @media css rule for calendar view. 2013-04-26 14:01:52 +01:00
Damyon Wiese
986adc066c MDL-39092 Yuilib - remove more -coverage.js files
Also slight tweak to the readme for someone who does not know shifter.
2013-04-15 09:02:11 +08:00
Ankit Agarwal
8aba76fddf MDL-37562 calendar: Updating upgrade.txt to mention calendar_update_subscription() 2013-04-08 15:03:31 +08:00
Ankit Agarwal
ab37339d09 MDL-37562 calendar: Remove all hardcoded updating of calendar subscriptions, use calendar_update_subscription() instead 2013-04-08 15:03:31 +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
1f7981e079 MDL-37562 calendar: Adding a api calendar_update_subscription() to update calendar events 2013-04-08 13:45:24 +08:00
Eloy Lafuente (stronk7)
dbc5692fc5 Merge branch 'MDL-38883-master' of git://github.com/danpoltawski/moodle 2013-04-05 02:48:37 +02:00
Dan Poltawski
d60ee78a5f MDL-38883 calendar: fix missing setType
Also remove duplicate sesskey definition (this is done by formslib
internally)
2013-04-04 17:17:37 +08:00
Andrew Robert Nicols
5e8dddc167 MDL-38666 JavaScript: Migrate moodle-calendar-evantmanager to use Shifter 2013-03-24 18:42:38 +00:00
Tim Hunt
658b9372ee MDL-38212 cron: display time and memory usage before each task.
This helps diagnose problems.

Also, call gc_collect_cycles between tasks, which may reduce the
frequency of out-of-memory errors.
2013-03-08 10:24:41 +00:00
Rajesh Taneja
9fd0cb9cb1 MDL-37338 Calendar: User will not see calendar subscription, which he/she can't edit
Signed-off-by: Rajesh Taneja <rajesh@moodle.com>
2013-03-04 01:49:02 +01:00
Dan Poltawski
85ef4d45ca Merge branch 'MDL-25853-master' of git://github.com/FMCorz/moodle 2013-02-04 10:12:54 +08:00
Frederic Massart
769c73ae6c MDL-25853 calendar: Fixed broken previous/next links 2013-01-30 08:59:11 +08:00