1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

MDL-66455 calendar: show site level subscriptions

This commit is contained in:
Simey Lameze 2019-09-02 06:59:03 +08:00
parent d7699706da
commit 19bea57b90

@ -127,7 +127,8 @@ $searches = [];
$params = [];
$usedefaultfilters = true;
if (!empty($courseid) && $courseid == SITEID && !empty($types['site'])) {
if (!empty($types['site'])) {
$searches[] = "(eventtype = 'site')";
$usedefaultfilters = false;
}
@ -144,9 +145,14 @@ if (!empty($courseid) && !empty($types['course'])) {
$usedefaultfilters = false;
}
if (!empty($categoryid) && !empty($types['category'])) {
$searches[] = "(eventtype = 'category' AND categoryid = :categoryid)";
$params += ['categoryid' => $categoryid];
if (!empty($types['category'])) {
if (!empty($categoryid)) {
$searches[] = "(eventtype = 'category' AND categoryid = :categoryid)";
$params += ['categoryid' => $categoryid];
} else {
$searches[] = "(eventtype = 'category')";
}
$usedefaultfilters = false;
}