mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-59650 core_calendar: remove limit from event exporter
This commit is contained in:
parent
a866c5c238
commit
e099259a46
@ -100,9 +100,6 @@ class event_vault implements event_vault_interface {
|
||||
$ignorehidden = true,
|
||||
callable $filter = null
|
||||
) {
|
||||
if ($limitnum < 1 || $limitnum > 200) {
|
||||
throw new limit_invalid_parameter_exception("Limit must be between 1 and 200 (inclusive)");
|
||||
}
|
||||
|
||||
$fromquery = function($field, $timefrom, $lastseenmethod, $afterevent, $withduration) {
|
||||
if (!$timefrom) {
|
||||
@ -186,7 +183,11 @@ class event_vault implements event_vault_interface {
|
||||
}
|
||||
}
|
||||
|
||||
$offset += $limitnum;
|
||||
if (!$limitnum) {
|
||||
break;
|
||||
} else {
|
||||
$offset += $limitnum;
|
||||
}
|
||||
}
|
||||
|
||||
return $events;
|
||||
|
@ -186,9 +186,9 @@ if(!empty($what) && !empty($time)) {
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
$limitnum = 0;
|
||||
$events = calendar_get_legacy_events($timestart, $timeend, $users, $groups, array_keys($paramcourses), false, true,
|
||||
$paramcategory);
|
||||
$paramcategory, $limitnum);
|
||||
|
||||
$ical = new iCalendar;
|
||||
$ical->add_property('method', 'PUBLISH');
|
||||
|
@ -3237,10 +3237,12 @@ function core_calendar_user_preferences() {
|
||||
* or events in progress/already started selected as well
|
||||
* @param boolean $ignorehidden whether to select only visible events or all events
|
||||
* @param array $categories array of category ids and/or objects.
|
||||
* @param int $limitnum Number of events to fetch or zero to fetch all.
|
||||
*
|
||||
* @return array $events of selected events or an empty array if there aren't any (or there was an error)
|
||||
*/
|
||||
function calendar_get_legacy_events($tstart, $tend, $users, $groups, $courses,
|
||||
$withduration = true, $ignorehidden = true, $categories = []) {
|
||||
$withduration = true, $ignorehidden = true, $categories = [], $limitnum = 0) {
|
||||
// Normalise the users, groups and courses parameters so that they are compliant with \core_calendar\local\api::get_events().
|
||||
// Existing functions that were using the old calendar_get_events() were passing a mixture of array, int, boolean for these
|
||||
// parameters, but with the new API method, only null and arrays are accepted.
|
||||
@ -3277,7 +3279,7 @@ function calendar_get_legacy_events($tstart, $tend, $users, $groups, $courses,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
40,
|
||||
$limitnum,
|
||||
null,
|
||||
$userparam,
|
||||
$groupparam,
|
||||
|
Loading…
x
Reference in New Issue
Block a user