61 Commits

Author SHA1 Message Date
Jun Pataleta
f52459bbbe MDL-55956 calendar: Show only one of duplicate events relevant to user
If there are multiple, non-repeating events with the same module name,
instance and event type. The most specific event or the event with the
highest priority will be shown.
The ordering of event priorities:
  User override events > Group override events > Course events.
If there are no user override events and there are multiple group
overrides for an event, then the one with the highest priority will be
shown.
2017-03-07 11:33:17 +08:00
Rajesh Taneja
57bee542ab
MDL-56519 behat: Fixed lint errors 2017-01-03 09:12:54 +08:00
David Monllao
b35c209d76 MDL-56551 calendar: Update behat test according to DOM changes 2016-11-25 10:06:36 +08:00
Adrian Greeve
cbbca0d00f MDL-56120 Calendar: Unit tests for getting events.
Added a unit test for checking that calendar_get_events
will only return events for activated activities.
2016-11-07 16:48:16 +08:00
Damyon Wiese
ba5c5083c5 MDL-55074 theme_boost: Behat fixes for latest theme changes
Fix I edit profile steps
Apply fixed header in css
Remove transitions from menus for behat
Be more specific about some "I follow" steps
Navigation path changes
"Current course" node removed from nav tree
Adapt tests because there are no default blocks
Force some space between action menu items
2016-10-21 16:06:54 +08:00
David Monllao
80180e0f92 MDL-55804 forms: Return exported data through _prepareValue 2016-09-27 08:11:56 +08:00
Eloy Lafuente (stronk7)
ed55d47d03 Merge branch 'wip-MDL-55123-master' of git://github.com/marinaglancy/moodle 2016-09-12 19:37:40 +02:00
Marina Glancy
64c45a2928 MDL-55123 forms: correctly create elements in unittests 2016-09-12 11:56:04 +08:00
Stephen Bourget
9629790b1b MDL-52798 calendar: Move calendar preferences to a user preferences page
This is based on the work of Shamim Rezaie and will also resolve
MDL-52375 and MDL-50378
2016-09-06 21:29:34 -04:00
Stephen Bourget
756e3c55c0 MDL-44369 Calendar: add events for subscriptions 2016-07-29 08:56:20 -04:00
David Monllao
837cec00f9 Merge branch 'wip-mdl-55091-m' of https://github.com/rajeshtaneja/moodle
Conflicts:
	lib/upgrade.txt
2016-07-26 10:14:30 +08:00
Rajesh Taneja
52f3e060e4
MDL-55091 phpunit: Following has been deprecated.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
2016-07-26 10:11:30 +08:00
Rajesh Taneja
d89dc6b123 MDL-55111 behat: Use option which is available everytime for export
recentupcoming option is always available everytime calendar export
is called, rest week and month is optionally shown and may not be
visible. So use recentupcoming event option and export calendar for test
2016-07-10 11:11:31 +08:00
Dan Poltawski
d7c9327d48 Merge branch 'MDL-51749-master' of git://github.com/junpataleta/moodle 2016-06-16 09:04:11 +01:00
Juan Leyva
871988b0b4 MDL-54049 core_message: Add missing external format text 2016-05-04 12:52:45 +02:00
Jun Pataleta
3de445bb56 MDL-51749 calendar: Behat tests for calendar export and additional fixes 2016-04-18 15:02:50 +08:00
Rajesh Taneja
eb9ca848fa MDL-53381 behat: Replaced chained steps with api.
Behat 3.x doesn't support chained steps and hence
this is first step to get rid of chained steps in core.
2016-04-06 11:32:49 +08:00
Rajesh Taneja
42ad096fdb MDL-46891 Behat: Added support for behat 3 2016-03-11 10:51:15 +08:00
Juan Leyva
39b8513763 MDL-52808 calendar: Do not return events for hidden activities 2016-03-07 22:36:31 +01:00
Stephen Bourget
a721339193 MDL-52383 Calendar: Allow users to set lookahead to 1 year 2016-01-15 13:14:56 -05:00
Eloy Lafuente (stronk7)
fdca1a1dd3 Merge branch 'MDL-51495' of https://github.com/NeillM/moodle 2015-11-11 16:56:27 +01:00
Neill Magill
11dc7c1c3d MDL-51495 calendar: Unit test to get an individual course event
If is user requests a single event on a course via the web service they should be able to retrieve it.
2015-11-11 15:18:37 +00:00
Rajesh Taneja
27c99f5007 MDL-52066 unittest: Use ics file from external repo 2015-11-10 13:27:00 +08:00
Rajesh Taneja
f0b48270d3 MDL-50179 behat: Use %d for windows compatibility 2015-06-09 09:34:10 +08:00
Rajesh Taneja
0fe86bbdbb MDL-49799 behat: replaced asd.com with example.com
asd.com is a valid domain, we should use reserved domain names for testing
2015-04-20 11:21:20 +08:00
David Monllao
89a6290fb9 Merge branch 'MDL-45131-master' of git://github.com/jleyva/moodle 2015-04-16 17:04:34 +08:00
Juan Leyva
e2c851575f MDL-45131 calendar: Add validation for returned parameters in WS tests 2015-04-13 16:37:18 +02:00
Simey Lameze
ef67967293 MDL-49412 core_calendar: Fix behat failures on blog and calendar
Part of MDL-45774
2015-04-10 17:18:24 +08:00
Petr Skoda
d6e7a63d9a 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
2015-04-06 13:53:51 +12:00
Marina Glancy
c96534600d MDL-27074 calendar: display group name for group events 2015-03-23 10:16:55 +08:00
Eloy Lafuente (stronk7)
ce1be0e738 MDL-48943 calendar: des@arn-izating acceptance tests 2015-03-11 12:46:23 +01:00
Andrew Nicols
dc3b2524a1 MDL-48943 calendar: Add behat tests for the calendar popup 2015-03-04 13:46:58 +08:00
David Monllao
ef5b65dae4 MDL-48285 calendar: Adapting unit tests to the new behaviour
Testing also the default value including repeated events.
2014-12-04 12:14:31 +00:00
Oleg Demeshev
741063b41c MDL-47993 calendar: Fix ical import Microsoft calendar issue 2014-11-14 10:32:54 +13:00
Jean-Philippe Gaudreau
b8ad1728d8 MDL-45765 Calendar import: Fix undefined variable in cron when updating calendar subscriptions 2014-07-10 16:09:28 -04:00
Mark Nelson
02a5a4b2ff MDL-43557 events: fixed minor issues in existing events 2014-04-29 19:16:11 -07:00
Ankit Agarwal
5ac3b20dc5 MDL-40915 events: Add unit tests for the newly created events 2014-03-21 16:33:19 +08:00
David Monllao
759b323e0e MDL-43236 behat: Updating references to deprecated methods 2014-03-07 16:05:21 +08:00
Ankit Agarwal
693fced7f1 MDL-42079 calendar: Add unittests for rrule_manager class 2014-03-05 09:48:07 +08:00
David Monllao
f083d6145e MDL-43738 behat: Updating features files
The following used steps were replaced by the ones
added in this issue:
- I fill the moodle form with
- I fill in with
- I select from
- I select radio button
- I check
- I uncheck
- the field should match

Also removing test for deprecated steps:
- the ASD checkbox should be checked
- the ASD checkbox should not be checked
2014-02-27 18:22:05 +08:00
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