From b5b112f62cbb104af365a06024edc1544baf335a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Monlla=C3=B3?= Date: Fri, 8 Feb 2019 13:46:43 +0100 Subject: [PATCH] MDL-64314 messaging: Web notifications for insights --- lib/db/messages.php | 5 ++++- lib/db/upgrade.php | 7 +++++++ version.php | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/db/messages.php b/lib/db/messages.php index 7a088411c94..9c0593c10a3 100644 --- a/lib/db/messages.php +++ b/lib/db/messages.php @@ -104,7 +104,10 @@ $messageproviders = array ( // User insights. 'insights' => array ( - 'capability' => 'moodle/analytics:listinsights' + 'defaults' => [ + 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF, + 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF, + ] ), // Message contact requests. diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index cf8ad44ffe4..d3a2ff8fdb9 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2719,5 +2719,12 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2019011801.03); } + if ($oldversion < 2019021500.01) { + $insights = $DB->get_record('message_providers', ['component' => 'moodle', 'name' => 'insights']); + $insights->capability = null; + $DB->update_record('message_providers', $insights); + upgrade_main_savepoint(true, 2019021500.01); + } + return true; } diff --git a/version.php b/version.php index e978fadd5b2..1cdcc82c2e6 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2019021500.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2019021500.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.