From ee905caef50a41d6cd152522cc538646b4ce950d Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 3 Jul 2019 09:23:31 +0800 Subject: [PATCH] MDL-65958 calendar: fix adminseesall logic in the event form --- calendar/classes/local/event/forms/eventtype.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar/classes/local/event/forms/eventtype.php b/calendar/classes/local/event/forms/eventtype.php index b3d582694f1..d615a50804b 100644 --- a/calendar/classes/local/event/forms/eventtype.php +++ b/calendar/classes/local/event/forms/eventtype.php @@ -98,7 +98,7 @@ trait eventtype { $mform->hideIf('categoryid', 'eventtype', 'noteq', 'category'); } - $showall = $CFG->calendar_adminseesall && !has_capability('moodle/calendar:manageentries', \context_system::instance()); + $showall = is_siteadmin() && !empty($CFG->calendar_adminseesall); if (!empty($eventtypes['course'])) { $mform->addElement('course', 'courseid', get_string('course'), ['limittoenrolled' => !$showall]); $mform->hideIf('courseid', 'eventtype', 'noteq', 'course');