Commit graph

873 commits

Author SHA1 Message Date
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
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
Cameron Ball
7aedfe32f4 MDL-58187 core_calendar: Skip callbacks when events module is invisible
Previously every event would get piped through the two callbacks
even when the associated course module was invisible. This patch
adds an early bail out check to avoid that.

Part of MDL-55611 epic.
2017-04-03 11:37:05 +08:00
Mark Nelson
8aa761b021 MDL-58211 core_calendar: fixed incompatibility with PHP 5.x
Part of MDL-55611 epic.
2017-04-03 11:37:05 +08:00
Ryan Wyllie
1aeb58faad MDL-57503 calendat: test external function get action events by courses
Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
9b8e505715 MDL-57503 calendar: external function for action events by courses
Added an external function to get action events by a list of courses and
timesort.

Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
5e026bb05f MDL-57503 calendar: test external function get action events by course
Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
60774b28c3 MDL-57503 calendar: external function get action events by course
Added an external function to get action events by course and timesort.

Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
42ac7ac629 MDL-57503 calendar: test for api function for action events by courses
Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
8a082024e7 MDL-57503 calendar: add api function for action events by courses
Add get_action_events_by_courses to calendar api.

Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
39e7bbaec4 MDL-57503 calendar: test for api function for action events by course
Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Ryan Wyllie
e62cd85fc5 MDL-57503 calendar: add api function for action events by course
Add get_action_events_by_course to calendar api.

Part of MDL-55611 epic.
2017-04-03 11:36:34 +08:00
Cameron Ball
1d364a89e9 MDL-58060 core_calendar: Use static course cache in event factory
Part of MDL-55611 epic.
2017-04-03 11:36:33 +08:00
Mark Nelson
ed0f8d3ca3 MDL-58101 block_myoverview: don't display link if inactionable
Part of MDL-55611 epic.
2017-04-03 11:36:33 +08:00
Mark Nelson
c91b4c0278 MDL-57730 core_calendar: fixed failing unit tests
Part of MDL-55611 epic.
2017-04-03 11:36:33 +08:00
Mark Nelson
bb19f80414 MDL-57730 core_calendar: handle '0' as a courseid
User overrides set the course id as 0 in the events table
(Moodle can be stupid). We need to deal with this.

Part of MDL-55611 epic.
2017-04-03 11:36:33 +08:00
Mark Nelson
5e6e3babf4 MDL-57730 core_calendar: fixed incompatibility with PHP 5.x
Also removed unused function and fixed PHPDocs.

Part of MDL-55611 epic.
2017-04-03 11:36:33 +08:00
Cameron Ball
aa457b7dee MDL-57730 core_calendar: Action interface aware of actionability
We need a way to decide whether an action can currently be completed
(e.g., an assignment where submissions are not yet open can not
be actioned, even though it may be displayed on the upcomming events
list).

To do this, the action interface now contains an is_actionable method.

Part of MDL-55611 epic.
2017-04-03 11:36:33 +08:00
Cameron Ball
42ec9f0d63 MDL-57730 core_calendar: Map action events to legacy events
Part of MDL-55611 epic.
2017-04-03 11:36:32 +08:00
Cameron Ball
2a5cce61ba MDL-57730 core_calendar: Allow modules to control event visibility
By implementing the mod_{modname}_core_calendar_is_event_visible callback
a module can decide whether or not a user should see an event.

Part of MDL-55611 epic.
2017-04-03 11:36:32 +08:00
Ryan Wyllie
4139f1311f MDL-57502 core_calendar: get calendar action events tests
Part of MDL-55611 epic.
2017-04-03 11:36:08 +08:00
Mark Nelson
c0f877fa62 MDL-57502 core_calendar: add get calendar action events web service
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Ryan Wyllie
984355ce57 MDL-57502 core_calendar: add calendar event exporters
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Ryan Wyllie
392d6a49f8 MDL-57502 calendar: add local api class for internal use
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Ryan Wyllie
1575194a5c MDL-57750 calendar: tests for api get_action_events_by_timesort
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Ryan Wyllie
ca21b08de8 MDL-57750 calendar: add api function to get action events by timesort
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Ryan Wyllie
18a96325a7 MDL-57750 calendar: calendar event vault tests
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Ryan Wyllie
84d865d69b MDL-57750 calendar: add event vault
Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Cameron Ball
5ca71c2dc3 MDL-57442 core_calendar: Allow course modules to create actions for events
Course modules can now implement the function mod_{module}_core_calendar_provide_event_action
which allows them to return an action to attach to an event.

Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00