MDL-65958 calendar: fix adminseesall logic in the event form

This commit is contained in:
Simey Lameze
2019-07-03 20:41:19 +08:00
parent 82002907b5
commit ee905caef5
@@ -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');