Commit graph

353 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
c91b4c0278 MDL-57730 core_calendar: fixed failing unit tests
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
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
18a96325a7 MDL-57750 calendar: calendar event vault tests
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
Cameron Ball
c5478a5b6c MDL-57442 core_calendar: Update proxies to accept a 'base' class
The base class can contain information we would prefer not to
have to hit the database for.

Part of MDL-55611 epic.
2017-04-03 11:36:07 +08:00
Mark Nelson
12cbce0aa3 MDL-57888 core_calendar: moved functions from calendar/lib.php
Part of MDL-55611 epic.
2017-04-03 11:35:38 +08:00
Cameron Ball
e46efe3a72 MDL-57599 core_calendar: Add action event class
This patch adds a "regular" calendar event class, and a simple extension
of it which we are calling an action event.

Part of MDL-55611 epic.
2017-04-03 11:35:38 +08:00
Simey Lameze
a22fa7cb68 MDL-57545 core_calendar: remove visibility fields from calendar events
Part of MDL-55611 epic.
2017-04-03 11:35:38 +08:00
Mark Nelson
c45266d115 MDL-57545 core_calendar: trigger update event when toggling visibility
Part of MDL-55611 epic.
2017-04-03 11:35:38 +08:00
Mark Nelson
e057f279e4 MDL-57497 core_calendar: added new calendar event class
Moved calendar_event class to new location using replaceclasses.php

Part of MDL-55611 epic.
2017-04-03 11:33:55 +08:00
Jun Pataleta
620ffacea1 MDL-57658 calendar: Set sort order for fetched DB records 2017-03-15 11:18:21 +08:00
Dan Poltawski
bcd510e36d Merge branch 'MDL-57658-master-3' of git://github.com/junpataleta/moodle 2017-03-14 16:06:19 +00:00
Andrew Nicols
815c6b203f MDL-51853 calendar: Whitespace fix 2017-03-13 09:18:07 +08:00
Andrew Nicols
4c6edf9dd8 Merge branch 'MDL-51853_m33v3' of https://github.com/sbourget/moodle 2017-03-13 08:40:45 +08:00
Jun Pataleta
8ddc656739 MDL-57658 calendar: Fix rrulemanager and unit tests
Issues fixed:
* Additional rule validations.
* Rewrote recurrence logic.
* Additional unit tests, especially from the examples in the RFC.
* The date format "YmdThis" results into an incorrect date for the
  "UNTIL" parameter. The literal "T" should be escaped, and a literal
  "Z" is also needed at the end of the format string to indicate UTC.
* Implemented handling of negative modifier values for BYxxx rules.
* Implemented handling of BYWEEKNO, BYYEARDAY, BYSETPOS, BYHOUR,
  BYMINUTE, BYSECOND rules.
2017-03-09 16:10:08 +08:00
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
Stephen Bourget
c3feaf269e MDL-51853 calendar: allow entries imported from a file to be updated. 2017-02-28 10:14:25 -05: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