*/
define('CALENDAR_SUBSCRIPTION_REMOVE', 2);
+/**
+ * CALENDAR_EVENT_USER_OVERRIDE_PRIORITY - Constant for the user override priority.
+ */
+define('CALENDAR_EVENT_USER_OVERRIDE_PRIORITY', 9999999);
+
/**
* Return the days of the week
*
<FIELD NAME="sequence" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="subscriptionid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="The event_subscription id this event is associated with."/>
+ <FIELD NAME="priority" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="The event's display priority. For multiple events with the same module name, instance and eventtype (e.g. for group overrides), the one with the higher priority will be displayed."/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
upgrade_main_savepoint(true, 2017021400.00);
}
+ if ($oldversion < 2017030300.01) {
+
+ // Define field priority to be added to event.
+ $table = new xmldb_table('event');
+ $field = new xmldb_field('priority', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'subscriptionid');
+
+ // Conditionally launch add field priority.
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ // Create adhoc task for upgrading of existing calendar events.
+ $record = new \stdClass();
+ $record->classname = "\\core\\task\\refresh_mod_calendar_events_task";
+ $record->component = 'core';
+ // Next run time based from nextruntime computation in \core\task\manager::queue_adhoc_task().
+ $nextruntime = time() - 1;
+ $record->nextruntime = $nextruntime;
+ $DB->insert_record('task_adhoc', $record);
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2017030300.01);
+ }
+
return true;
}
the submitted capability. The parameter 'fieldsexceptid' will now accept context fields which can be used for preloading.
* The caching option 'immutable' has been added to send_stored_file() and send_file().
* New adhoc task refresh_mod_calendar_events_task that updates existing calendar events of modules.
+* New 'priority' column for the event table to determine which event to show in case of events with user and group overrides.
=== 3.2 ===
defined('MOODLE_INTERNAL') || die();
-$version = 2017030300.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2017030300.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.