MDL-64314 messaging: Web notifications for insights
authorDavid Monllaó <davidm@moodle.com>
Fri, 8 Feb 2019 12:46:43 +0000 (13:46 +0100)
committerDavid Monllaó <davidm@moodle.com>
Fri, 15 Feb 2019 07:47:01 +0000 (08:47 +0100)
lib/db/messages.php
lib/db/upgrade.php
version.php

index 7a08841..9c0593c 100644 (file)
@@ -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.
index cf8ad44..d3a2ff8 100644 (file)
@@ -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;
 }
index e978fad..1cdcc82 100644 (file)
@@ -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.