mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-48285 webservices: default timeend to infinity and beyond
This commit is contained in:
parent
951af91e08
commit
e07e04c123
@ -142,8 +142,8 @@ class core_calendar_external extends external_api {
|
||||
"Time from which events should be returned",
|
||||
VALUE_DEFAULT, 0, NULL_ALLOWED),
|
||||
'timeend' => new external_value(PARAM_INT,
|
||||
"Time to which the events should be returned",
|
||||
VALUE_DEFAULT, time(), NULL_ALLOWED),
|
||||
"Time to which the events should be returned. We treat 0 and null as no end",
|
||||
VALUE_DEFAULT, 0, NULL_ALLOWED),
|
||||
'ignorehidden' => new external_value(PARAM_BOOL,
|
||||
"Ignore hidden events or not",
|
||||
VALUE_DEFAULT, true, NULL_ALLOWED),
|
||||
@ -215,6 +215,11 @@ class core_calendar_external extends external_api {
|
||||
$funcparam['courses'][] = $SITE->id;
|
||||
}
|
||||
|
||||
// We treat 0 and null as no end.
|
||||
if (empty($params['options']['timeend'])) {
|
||||
$params['options']['timeend'] = PHP_INT_MAX;
|
||||
}
|
||||
|
||||
$eventlist = calendar_get_events($params['options']['timestart'], $params['options']['timeend'], $funcparam['users'], $funcparam['groups'],
|
||||
$funcparam['courses'], true, $params['options']['ignorehidden']);
|
||||
// WS expects arrays.
|
||||
|
@ -1,6 +1,11 @@
|
||||
This files describes API changes in /calendar/* ,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 2.9 ===
|
||||
default values changes in code:
|
||||
* core_calendar_external::get_calendar_events_parameters() 'timeend' default option changed; now, by default,
|
||||
all events are returned, not only the past ones.
|
||||
|
||||
=== 2.5 ===
|
||||
required changes in code:
|
||||
* calendar_add_icalendar_event() now requires a valid subscriptionid
|
||||
|
Loading…
x
Reference in New Issue
Block a user