diff --git a/blocks/calendar_month/tests/behat/block_calendar_month.feature b/blocks/calendar_month/tests/behat/block_calendar_month.feature index f8f159753c5..b921b624aaa 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month.feature @@ -26,7 +26,7 @@ Feature: Enable the calendar block in a course and test it's functionality Then "Calendar" "block" should exist @javascript - Scenario: View a global event in the calendar block + Scenario: View a site event in the calendar block Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | @@ -52,7 +52,7 @@ Feature: Enable the calendar block in a course and test it's functionality | id_eventtype | Course | | id_name | Course Event | And I am on "Course 1" course homepage - And I follow "Hide global events" + And I follow "Hide site events" And I hover over today in the calendar Then I should not see "Site Event" And I should see "Course Event" diff --git a/blocks/calendar_month/tests/behat/block_calendar_month_course.feature b/blocks/calendar_month/tests/behat/block_calendar_month_course.feature index 23605721544..f0ed21f8500 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month_course.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month_course.feature @@ -5,7 +5,7 @@ Feature: Enable the calendar block in a course I can add the calendar block to a course @javascript - Scenario: View a global event in the calendar block in a course + Scenario: View a site event in the calendar block in a course Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | diff --git a/blocks/calendar_month/tests/behat/block_calendar_month_dashboard.feature b/blocks/calendar_month/tests/behat/block_calendar_month_dashboard.feature index aa74c43d5c8..e22b4e8e885 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month_dashboard.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month_dashboard.feature @@ -5,7 +5,7 @@ Feature: View a site event on the dashboard I can view the event in the calendar @javascript - Scenario: View a global event in the calendar block on the dashboard + Scenario: View a site event in the calendar block on the dashboard Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | diff --git a/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature b/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature index b7ef68e40e6..e67c327047e 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature @@ -5,7 +5,7 @@ Feature: Enable the calendar block on the site front page I can add the calendar block on the site front page @javascript - Scenario: View a global event in the calendar block on the front page + Scenario: View a site event in the calendar block on the front page Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature index 9e092bfb0d7..1b4d9e06961 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature @@ -16,7 +16,7 @@ Feature: Enable the upcoming events block in a course | teacher1 | C1 | editingteacher | @javascript - Scenario: View a global event in the calendar block + Scenario: View a site event in the calendar block Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature index 0b7c739f83b..96bd2163ab0 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature @@ -9,7 +9,7 @@ Feature: View a upcoming site event on the dashboard | student1 | Student | 1 | student1@example.com | S1 | @javascript - Scenario: View a global event in the upcoming events block on the dashboard + Scenario: View a site event in the upcoming events block on the dashboard Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature index dd31e37cac4..8336f521fba 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature @@ -10,7 +10,7 @@ Feature: View a site event on the frontpage | teacher1 | Teacher | 1 | teacher1@example.com | T1 | @javascript - Scenario: View a global event in the upcoming events block on the frontpage + Scenario: View a site event in the upcoming events block on the frontpage Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | diff --git a/calendar/classes/external/event_icon_exporter.php b/calendar/classes/external/event_icon_exporter.php index 79d30daab26..1949a9e42b0 100644 --- a/calendar/classes/external/event_icon_exporter.php +++ b/calendar/classes/external/event_icon_exporter.php @@ -55,7 +55,7 @@ class event_icon_exporter extends exporter { $user = $event->get_user(); $userid = $user ? $user->get('id') : null; $isactivityevent = !empty($coursemodule); - $isglobalevent = ($course && $courseid == SITEID); + $issiteevent = ($course && $courseid == SITEID); $iscategoryevent = ($category && !empty($categoryid)); $iscourseevent = ($course && !empty($courseid) && $courseid != SITEID && empty($groupid)); $isgroupevent = ($group && !empty($groupid)); @@ -70,7 +70,7 @@ class event_icon_exporter extends exporter { } else { $alttext = get_string('activityevent', 'calendar'); } - } else if ($isglobalevent) { + } else if ($issiteevent) { $key = 'i/siteevent'; $component = 'core'; $alttext = get_string('typesite', 'calendar'); diff --git a/calendar/classes/local/event/forms/eventtype.php b/calendar/classes/local/event/forms/eventtype.php index d615a50804b..8475e294124 100644 --- a/calendar/classes/local/event/forms/eventtype.php +++ b/calendar/classes/local/event/forms/eventtype.php @@ -57,19 +57,19 @@ trait eventtype { $options = []; if (!empty($eventtypes['user'])) { - $options['user'] = get_string('user'); + $options['user'] = get_string('user', 'calendar'); } if (!empty($eventtypes['group'])) { - $options['group'] = get_string('group'); + $options['group'] = get_string('group', 'calendar'); } if (!empty($eventtypes['course'])) { - $options['course'] = get_string('course'); + $options['course'] = get_string('course', 'calendar'); } if (!empty($eventtypes['category'])) { - $options['category'] = get_string('category'); + $options['category'] = get_string('category', 'calendar'); } if (!empty($eventtypes['site'])) { - $options['site'] = get_string('site'); + $options['site'] = get_string('site', 'calendar'); } // If we only have one event type and it's 'user' event then don't bother diff --git a/calendar/classes/local/event/forms/managesubscriptions.php b/calendar/classes/local/event/forms/managesubscriptions.php index 61ef73f087c..6063f403411 100644 --- a/calendar/classes/local/event/forms/managesubscriptions.php +++ b/calendar/classes/local/event/forms/managesubscriptions.php @@ -85,7 +85,7 @@ class managesubscriptions extends \moodleform { // Add the select elements for the available event types. $this->add_event_type_elements($mform, $eventtypes); - // Eventtype: 0 = user, 1 = global, anything else = course ID. + // Eventtype: 0 = user, 1 = site, anything else = course ID. $mform->addElement('submit', 'add', get_string('add')); // Add the javascript required to enhance this mform. diff --git a/calendar/export_execute.php b/calendar/export_execute.php index 17b55010e8e..a06f3286cc6 100644 --- a/calendar/export_execute.php +++ b/calendar/export_execute.php @@ -76,7 +76,7 @@ if(!empty($what) && !empty($time)) { if ($what == 'all') { $users = $user->id; $courses[SITEID] = new stdClass; - $courses[SITEID]->shortname = get_string('globalevents', 'calendar'); + $courses[SITEID]->shortname = get_string('siteevents', 'calendar'); $paramcourses[SITEID] = $courses[SITEID]; $paramcategory = true; } else if ($what == 'groups') { diff --git a/calendar/externallib.php b/calendar/externallib.php index 4bc93881ffc..eccd04eb896 100644 --- a/calendar/externallib.php +++ b/calendar/externallib.php @@ -147,7 +147,7 @@ class core_calendar_external extends external_api { "Set to true to return current user's user events", VALUE_DEFAULT, true, NULL_ALLOWED), 'siteevents' => new external_value(PARAM_BOOL, - "Set to true to return global events", + "Set to true to return site events", VALUE_DEFAULT, true, NULL_ALLOWED), 'timestart' => new external_value(PARAM_INT, "Time from which events should be returned", diff --git a/calendar/lib.php b/calendar/lib.php index a5f772e810f..da878b80b4a 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -70,10 +70,16 @@ define('CALENDAR_TF_24', '%H:%M'); define('CALENDAR_TF_12', '%I:%M %p'); /** - * CALENDAR_EVENT_GLOBAL - Global calendar event types + * CALENDAR_EVENT_GLOBAL - Site calendar event types + * @deprecated since 3.8 */ define('CALENDAR_EVENT_GLOBAL', 1); +/** + * CALENDAR_EVENT_SITE - Site calendar event types + */ +define('CALENDAR_EVENT_SITE', 1); + /** * CALENDAR_EVENT_COURSE - Course calendar event types */ @@ -1551,8 +1557,8 @@ function calendar_add_event_metadata($event) { $event->cmid = $module->id; } else if ($event->courseid == SITEID) { // Site event. $event->icon = '' .
-            get_string('globalevent', 'calendar') . ''; - $event->cssclass = 'calendar_event_global'; + get_string('siteevent', 'calendar') . '" class="icon" />'; + $event->cssclass = 'calendar_event_site'; } else if ($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { // Course event. $event->icon = '' .
             get_string('courseevent', 'calendar') . ''; @@ -1958,7 +1964,7 @@ function calendar_sub_month($month, $year) { * @param int $year the number of the year * @param array $eventsbyday event on specific day * @param array $durationbyday duration of the event in days - * @param array $typesbyday event type (eg: global, course, user, or group) + * @param array $typesbyday event type (eg: site, course, user, or group) * @param array $courses list of courses * @return void */ @@ -1995,9 +2001,9 @@ function calendar_events_by_day($events, $month, $year, &$eventsbyday, &$duratio // Mark the day as having such an event. if ($event->courseid == SITEID && $event->groupid == 0) { - $typesbyday[$eventdaystart]['startglobal'] = true; - // Set event class for global event. - $events[$event->id]->class = 'calendar_event_global'; + $typesbyday[$eventdaystart]['startsite'] = true; + // Set event class for site event. + $events[$event->id]->class = 'calendar_event_site'; } else if ($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { $typesbyday[$eventdaystart]['startcourse'] = true; // Set event class for course event. @@ -2036,7 +2042,7 @@ function calendar_events_by_day($events, $month, $year, &$eventsbyday, &$duratio for ($i = $lowerbound + 1; $i <= $upperbound; ++$i) { $durationbyday[$i][] = $event->id; if ($event->courseid == SITEID && $event->groupid == 0) { - $typesbyday[$i]['durationglobal'] = true; + $typesbyday[$i]['durationsite'] = true; } else if ($event->courseid != 0 && $event->courseid != SITEID && $event->groupid == 0) { $typesbyday[$i]['durationcourse'] = true; } else if ($event->groupid) { @@ -2077,7 +2083,7 @@ function calendar_set_filters(array $courseeventsfrom, $ignorefilters = false, s if ($ignorefilters || calendar_show_event_type(CALENDAR_EVENT_COURSE, $user)) { $courses = array_keys($courseeventsfrom); } - if ($ignorefilters || calendar_show_event_type(CALENDAR_EVENT_GLOBAL, $user)) { + if ($ignorefilters || calendar_show_event_type(CALENDAR_EVENT_SITE, $user)) { $courses[] = SITEID; } $courses = array_unique($courses); @@ -2472,7 +2478,7 @@ function calendar_format_event_time($event, $now, $linkparams = null, $usecommon * @return bool True if the tyep should be displayed false otherwise */ function calendar_show_event_type($type, $user = null) { - $default = CALENDAR_EVENT_GLOBAL + CALENDAR_EVENT_COURSE + CALENDAR_EVENT_GROUP + CALENDAR_EVENT_USER; + $default = CALENDAR_EVENT_SITE + CALENDAR_EVENT_COURSE + CALENDAR_EVENT_GROUP + CALENDAR_EVENT_USER; if (get_user_preferences('calendar_persistflt', 0, $user) === 0) { global $SESSION; @@ -2498,7 +2504,7 @@ function calendar_show_event_type($type, $user = null) { */ function calendar_set_event_type_display($type, $display = null, $user = null) { $persist = get_user_preferences('calendar_persistflt', 0, $user); - $default = CALENDAR_EVENT_GLOBAL + CALENDAR_EVENT_COURSE + CALENDAR_EVENT_GROUP + $default = CALENDAR_EVENT_SITE + CALENDAR_EVENT_COURSE + CALENDAR_EVENT_GROUP + CALENDAR_EVENT_USER + CALENDAR_EVENT_COURSECAT; if ($persist === 0) { global $SESSION; diff --git a/calendar/tests/behat/category_events.feature b/calendar/tests/behat/category_events.feature index 5382c8fc9c7..021126ad4fe 100644 --- a/calendar/tests/behat/category_events.feature +++ b/calendar/tests/behat/category_events.feature @@ -48,7 +48,7 @@ Feature: Course Category Events | student2 | B2i | student | And the following "events" exist: | name | eventtype | - | Site event | global | + | Site event | site | And the following "events" exist: | name | eventtype | course | | CA1i event | course | A1i | diff --git a/calendar/tests/container_test.php b/calendar/tests/container_test.php index 011464bad38..bc72391ce38 100644 --- a/calendar/tests/container_test.php +++ b/calendar/tests/container_test.php @@ -532,7 +532,7 @@ class core_calendar_container_testcase extends advanced_testcase { protected function create_event($properties = []) { $record = new \stdClass(); $record->name = 'event name'; - $record->eventtype = 'global'; + $record->eventtype = 'site'; $record->timestart = time(); $record->timeduration = 0; $record->timesort = 0; diff --git a/calendar/tests/event_factory_test.php b/calendar/tests/event_factory_test.php index abf40ea5410..f1c8b44b974 100644 --- a/calendar/tests/event_factory_test.php +++ b/calendar/tests/event_factory_test.php @@ -467,7 +467,7 @@ class core_calendar_event_factory_testcase extends advanced_testcase { protected function create_event($properties = []) { $record = new \stdClass(); $record->name = 'event name'; - $record->eventtype = 'global'; + $record->eventtype = 'site'; $record->timestart = time(); $record->timeduration = 0; $record->timesort = 0; diff --git a/calendar/tests/event_mapper_test.php b/calendar/tests/event_mapper_test.php index d59bccc6da7..a9a39a5cc93 100644 --- a/calendar/tests/event_mapper_test.php +++ b/calendar/tests/event_mapper_test.php @@ -141,7 +141,7 @@ class core_calendar_event_mapper_testcase extends advanced_testcase { protected function create_event($properties = []) { $record = new \stdClass(); $record->name = 'event name'; - $record->eventtype = 'global'; + $record->eventtype = 'site'; $record->timestart = time(); $record->timeduration = 0; $record->timesort = 0; diff --git a/calendar/tests/helpers.php b/calendar/tests/helpers.php index 92f2e2e4ac8..9a875f88746 100644 --- a/calendar/tests/helpers.php +++ b/calendar/tests/helpers.php @@ -48,7 +48,7 @@ use core_calendar\local\event\factories\event_factory_interface; function create_event($properties) { $record = new \stdClass(); $record->name = 'event name'; - $record->eventtype = 'global'; + $record->eventtype = 'site'; $record->repeat = 0; $record->repeats = 0; $record->timestart = time(); diff --git a/calendar/tests/repeat_event_collection_test.php b/calendar/tests/repeat_event_collection_test.php index 7d335eae1fa..8c963bd07bc 100644 --- a/calendar/tests/repeat_event_collection_test.php +++ b/calendar/tests/repeat_event_collection_test.php @@ -155,7 +155,7 @@ class core_calendar_repeat_event_collection_testcase extends advanced_testcase { protected function create_event($properties = []) { $record = new \stdClass(); $record->name = 'event name'; - $record->eventtype = 'global'; + $record->eventtype = 'site'; $record->repeat = 0; $record->repeats = 0; $record->timestart = time(); diff --git a/lang/en/calendar.php b/lang/en/calendar.php index 8ed97c428b2..cea9d7e6128 100644 --- a/lang/en/calendar.php +++ b/lang/en/calendar.php @@ -32,6 +32,7 @@ $string['calendarheading'] = '{$a} Calendar'; $string['calendarpreferences'] = 'Calendar preferences'; $string['calendartypes'] = 'Calendar types'; $string['calendarurl'] = 'Calendar URL: {$a}'; +$string['category'] = 'Category'; $string['categoryevent'] = 'Category event'; $string['clickhide'] = 'click to hide'; $string['clickshow'] = 'click to show'; @@ -142,16 +143,12 @@ $string['forcecalendartype'] = 'Force calendar'; $string['fri'] = 'Fri'; $string['friday'] = 'Friday'; $string['generateurlbutton'] = 'Get calendar URL'; -$string['global'] = 'Global'; -$string['globalevent'] = 'Global event'; -$string['globalevents'] = 'Global events'; $string['gotoactivity'] = 'Go to activity'; $string['gotocalendar'] = 'Go to calendar'; $string['group'] = 'Group'; $string['groupevent'] = 'Group event'; $string['groupevents'] = 'Group events'; -$string['eventtypeglobal'] = 'global'; -$string['eventtypesite'] = 'global'; +$string['eventtypesite'] = 'site'; $string['eventtypecategory'] = 'category'; $string['eventtypecourse'] = 'course'; $string['eventtypemodule'] = 'module'; @@ -225,6 +222,8 @@ $string['repeatweeksr'] = 'events'; $string['sat'] = 'Sat'; $string['saturday'] = 'Saturday'; $string['shown'] = 'shown'; +$string['site'] = 'Site'; +$string['siteevent'] = 'Site event'; $string['siteevents'] = 'Site events'; $string['spanningevents'] = 'Events underway'; $string['subscriptions'] = 'Subscriptions'; @@ -271,3 +270,9 @@ $string['when'] = 'When'; $string['whendate'] = 'When: {$a}'; $string['yesterday'] = 'Yesterday'; $string['youcandeleteallrepeats'] = 'This event is part of a repeating event series. You can delete this event only, or all {$a} events in the series at once.'; + +// Deprecated since Moodle 3.8. +$string['global'] = 'Global'; +$string['globalevent'] = 'Global event'; +$string['globalevents'] = 'Global events'; +$string['eventtypeglobal'] = 'global'; diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt index 861c15a494b..f343ba6adaa 100644 --- a/lang/en/deprecated.txt +++ b/lang/en/deprecated.txt @@ -116,4 +116,8 @@ registersite,core_hub updatesite,core_hub unregisterexplained,core_hub configrequestcategoryselection,core_admin -requestcategoryselection,core_admin \ No newline at end of file +requestcategoryselection,core_admin +global,core_calendar +globalevent,core_calendar +globalevents,core_calendar +eventtypeglobal,core_calendar diff --git a/lib/classes/output/icon_system_fontawesome.php b/lib/classes/output/icon_system_fontawesome.php index 5bbb84152d6..c3446801a03 100644 --- a/lib/classes/output/icon_system_fontawesome.php +++ b/lib/classes/output/icon_system_fontawesome.php @@ -210,7 +210,7 @@ class icon_system_fontawesome extends icon_system_font { 'core:i/lock' => 'fa-lock', 'core:i/categoryevent' => 'fa-cubes', 'core:i/course' => 'fa-graduation-cap', - 'core:i/courseevent' => 'fa-university', + 'core:i/courseevent' => 'fa-graduation-cap', 'core:i/customfield' => 'fa-hand-o-right', 'core:i/db' => 'fa-database', 'core:i/delete' => 'fa-trash', diff --git a/lib/testing/generator/data_generator.php b/lib/testing/generator/data_generator.php index cda6868f128..2e46b8b4377 100644 --- a/lib/testing/generator/data_generator.php +++ b/lib/testing/generator/data_generator.php @@ -1145,7 +1145,6 @@ EOD; require_once($CFG->dirroot . '/calendar/lib.php'); $record = new \stdClass(); $record->name = 'event name'; - $record->eventtype = 'global'; $record->repeat = 0; $record->repeats = 0; $record->timestart = time(); @@ -1176,7 +1175,7 @@ EOD; unset($record->courseid); unset($record->groupid); break; - case 'global': + case 'site': unset($record->categoryid); unset($record->courseid); unset($record->groupid); diff --git a/pix/i/courseevent.png b/pix/i/courseevent.png index c8e3f481815..ba6768fdccb 100644 Binary files a/pix/i/courseevent.png and b/pix/i/courseevent.png differ diff --git a/pix/i/courseevent.svg b/pix/i/courseevent.svg index db668126edb..7d02ff9d5af 100644 --- a/pix/i/courseevent.svg +++ b/pix/i/courseevent.svg @@ -1,3 +1,2 @@ - -]> \ No newline at end of file + + \ No newline at end of file