900 Commits

Author SHA1 Message Date
Cameron Ball
a776415d55
MDL-58578 core_calendar: Properly respect priorities on overview
Prior to this patch, if a user was in two groups, and an override
existed for both groups in an assignment the override
visually lower on the override list would be displayed on the
overview, whereas the one visually higher would be displayed
in the assignment grading table.
2017-04-27 15:15:12 +08:00
Jake Dallimore
0dcfadd9e4 Merge branch 'MDL-57793-master' of git://github.com/junpataleta/moodle 2017-04-24 15:16:30 +08:00
Mark Nelson
37c38dfca1 MDL-58566 calendar: fixed comment's reference to non-existent function 2017-04-21 11:27:15 +08:00
David Monllao
fc394ded2a Merge branch 'MDL-58566-master' of git://github.com/junpataleta/moodle 2017-04-19 00:43:02 +08:00
Jun Pataleta
6d5661a9b3 MDL-57793 calendar: Additional edge-case tests
* Added leap year and 31th day of the month tests.
2017-04-18 13:55:25 +08:00
Jun Pataleta
dbb49e8d48 MDL-57793 calendar: Add recursion to satisfy COUNT rule
* Add recursion to the creation of recurring calendar events to satisfy
  the COUNT rule, if necessary.
2017-04-18 13:55:25 +08:00
Jun Pataleta
22753c8c5c MDL-58566 calendar: Move \core_calendar\local\api::get_legacy_events()
* Move and rename \core_calendar\local\api::get_legacy_events() to
  calendar_get_legacy_events() in calendar/lib.php.
* Fix the parameter-normalising callback function in
  calendar_get_legacy_events() so that it correctly handles false values
  by returning an empty array instead of it returning a non-empty array
  that contains an empty element.
2017-04-18 10:32:09 +08:00
Cameron Ball
a05e4f25a7
MDL-58085 core_calendar: Display actions on calendar events page 2017-04-11 11:21:43 +08:00
Mark Nelson
5c85bfe122 MDL-55611 core_calendar: Fixed query for Oracle
Also fixed unit test filter.
2017-04-06 12:56:00 +08:00
Andrew Nicols
95f38c22ca MDL-55611 calendar: Fix unit test filter
The event test factory uses a closure to return only every other record.
This was previously working based on ID but MSSQL starts from an even
number rather than an odd number.

This change changes that to use a static variable which keeps a count of
the records instead and only returns every other record in this fashion,
removing the dependance upon ID.
2017-04-06 08:50:12 +08:00
Dan Poltawski
1e4e5c52d7 Merge branch 'MDL-55611-master' of git://github.com/danpoltawski/moodle 2017-04-04 17:07:41 +01:00
Simey Lameze
53cbac18ba MDL-58474 core_calendar: add missing action_event_interface import
Part of MDL-55611 epic.
2017-04-04 11:01:57 +01:00
Mark Nelson
d7bc2c6fd5 MDL-55611 core_calendar: fixed unit tests failing in isolation 2017-04-04 11:01:57 +01:00
Cameron Ball
c28f1077c4 MDL-58442 core_calendar: Better documentation for the container
Part of MDL-55611 epic.
2017-04-04 11:01:57 +01:00
Cameron Ball
92ac08bcee MDL-58442 core_calendar: Nuke action_event_factory and friends
These are unecessary since the only place the factory
is used is in the container.

Part of MDL-55611 epic.
2017-04-04 11:01:56 +01:00
Cameron Ball
d10693cb63 MDL-58442 core_calendar: Rename core_container to simply container
core_container was confusing as it looks Frankenstyleish.

Part of MDL-55611 epic.
2017-04-04 11:01:56 +01:00
Cameron Ball
42e76c3f70 MDL-58430 core_calendar: Keep interfaces with implementations
All interfaces have been moved from the interfaces folder such
that they now live with their default implementations.

Part of MDL-55611 epic.
2017-04-04 11:01:55 +01:00
Mark Nelson
2229368a3c MDL-58424 core_calendar: moved api::get_events
This function was moved to local_api::get_legacy_events.

Also removed the calendar/classes/api.php file since it no longer contained any
functionality and added unit tests for local_api::get_legacy_events (a copy of
the unit tests for calendar_get_events).

Part of MDL-55611 epic.
2017-04-04 11:01:53 +01:00
Mark Nelson
f8443a26f9 MDL-58424 core_calendar: removed unused get_action_events_* functions
Also moved associated unit tests to another location and changed
them so that they were testing local_api instead.

Part of MDL-55611 epic.
2017-04-04 11:01:53 +01:00
Mark Nelson
23a29de7ee MDL-58424 core_calendar: moved logic from api.php to lib.php
Also moved related PHPUnit tests.

Part of MDL-55611 epic.
2017-04-04 11:01:52 +01:00
Mark Nelson
10515e152d MDL-58424 core: undeprecated calendar_* functions
Part of MDL-55611 epic.
2017-04-04 11:01:52 +01:00
Jun Pataleta
c755cb354c MDL-58441 calendar: Pass $withduration to the correct function
Part of MDL-55611 epic.
2017-04-04 11:01:50 +01:00
Mark Nelson
2a8e41b990 MDL-58432 core_calendar: allow event properties to be null
Part of MDL-55611 epic.
2017-04-04 11:01:49 +01:00
Mark Nelson
e1cd93ce20 MDL-58423 core_calendar: moved \core_calendar\event class
Part of MDL-55611 epic.
2017-04-04 11:01:49 +01:00
Cameron Ball
71d1430c27 MDL-58396 core_calendar: Fix failing unit test
Part of MDL-55611 epic.
2017-04-04 11:01:48 +01:00
Jun Pataleta
20592f5ff2 MDL-58386 calendar: Fixed CI issues
Part of MDL-55611 epic.
2017-04-04 11:01:47 +01:00
Cameron Ball
8d4e0f29dc MDL-58383 core_calendar: Correctly filter in event vault
The filter parameter was being passed in as the wrong argument which
was allowing non action events to be returned.

Part of MDL-55611 epic.
2017-04-04 11:01:45 +01:00
Damyon Wiese
de66ac3cd6 MDL-55611 calendar: fix calendar_event uses
It was renamed to \core_calendar::event
2017-04-04 11:01:44 +01:00
Damyon Wiese
01a95b86cd MDL-55611 icons: Remove pix_url
Change to image_url because these are not "pix icons".
2017-04-04 11:01:44 +01:00
Cameron Ball
378259a8ab MDL-58087 core_calendar: Fix random unit test failure
Part of MDL-55611 epic.
2017-04-04 11:01:42 +01:00
Cameron Ball
bd01fd15d4 MDL-58087 core_calendar: Unit tests now jam with new vault behaviour
Some unit tests needed to be updated to specify a few extra
bits and pieces on the events to work properly with the
new event vault behaviour.

Part of MDL-55611 epic.
2017-04-04 11:01:41 +01:00
Cameron Ball
258a570563 MDL-58087 core_calendar: Move logic from get_events to the local API
The logic from get_events has now been moved in to our local API
and is used by the event vault to retrieve events, instead of
querying the database directly.

This has the advantage that it deals with overrides and only
returns events for the relevant user.

Part of MDL-55611 epic.
2017-04-04 11:01:40 +01:00
Cameron Ball
02854eac9e MDL-58087 core_calendar: Don't pass non action events through our plumbing
The event factory should simply instantiate an event for non action
events and pass only action events through the plumbing.

This way modules implementing the callbacks can be sure that what
is passed in to the callback is actually supposed to be an action event.

Part of MDL-55611 epic.
2017-04-04 11:01:40 +01:00
Cameron Ball
f8a3e28b16 MDL-58087 core_calendar: Don't process events not created by modules
Our API infrastructure currently only deals with events created
by course modules. Site, user, etc events can't be dealt with.

Part of MDL-55611 epic.
2017-04-04 11:01:40 +01:00
Cameron Ball
b6d9b701f0 MDL-58087 core_calendar: Remove redundant event vault factory
Part of MDL-55611 epic.
2017-04-04 11:01:38 +01:00
Cameron Ball
59a601e632 MDL-58087 core_calendar: Set correct ID for repeat event collection
Initially we were only sending "top level" events through our API
i.e., events that can be repeated, but are not repeats themselves.
In the future we will be sending ALL events through our API and int
that situation the ID of the collection needs a small bit of logic
to correctly set the ID of the parent.

Part of MDL-55611 epic.
2017-04-04 11:01:19 +01:00
Damyon Wiese
72fd103add MDL-58219 cibot: Fixes
Fixes for cibot warnings.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
1a1a09d8f8 MDL-58142 calendar: Add an obvious link to the help docs
Part of MDL-58220
2017-04-03 13:40:13 +08:00
Cameron Ball
6d82ef49ea MDL-58087 core_calendar: Event mapper learned to map to stdClass and array
Part of MDL-55611 epic.
2017-04-03 11:37:09 +08:00
Mark Nelson
88d14007b3 MDL-57878 core_calendar: additional unit test for bailout callback
Part of MDL-55611 epic.
2017-04-03 11:37:09 +08:00
Mark Nelson
74588eecc4 MDL-57878 core_calendar: extended bailout callback
Do not display completion related events if completion is disabled.

Part of MDL-55611 epic.
2017-04-03 11:37:09 +08:00
Mark Nelson
0c9dc98b44 MDL-58340 core_calendar: bailout callback now uses '$cm->uservisible'
Part of MDL-55611 epic.
2017-04-03 11:37:08 +08:00
Ryan Wyllie
5a0974c748 MDL-58218 calendar: correct offset using last seen event
Part of MDL-55611 epic.
2017-04-03 11:37:08 +08:00
Simey Lameze
fdeeaff954 MDL-58265 core_test: replace I turn editing on steps
Also remove few more unnecessary steps that redirects behat to
site home page to actually get to the course.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Simey Lameze
93be3f730c MDL-58265 core_test: remove unnecessary steps
This commmit removes steps that take behat to site home page
to actually get to a course page.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Simey Lameze
c987d1b2ef MDL-58265 core_test: replace all uses of I follow course steps
Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Ryan Wyllie
0eb8556245 MDL-57585 block_myoverview: add styling for timeline view in boost
Part of MDL-55611 epic.
2017-04-03 11:37:06 +08:00
Cameron Ball
e798fa76f5 MDL-58110 core_calendar: Add proxy for modules
Modules associated with an event are stored in the event table
as the module's name and instance number not the actual ID of the instance
in the modules table.

So to lazy load them we need a proxy that uses the module name and instance
rather than the ID.

Part of MDL-55611 epic.
2017-04-03 11:37:06 +08:00
Jun Pataleta
6b7b39fe3a MDL-58048 calendar: Show itemcount conditionally
Part of MDL-55611 epic.
2017-04-03 11:37:06 +08:00
Mark Nelson
56885618d9 MDL-58236 core_calendar: do not display events with 0 item counts
Part of MDL-55611 epic.
2017-04-03 11:37:06 +08:00