Merge branch 'MDL-64739_master' of git://github.com/dmonllao/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 21 Oct 2019 11:29:29 +0000 (13:29 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 21 Oct 2019 11:31:12 +0000 (13:31 +0200)
1  2 
admin/tool/analytics/db/services.php
lib/db/upgrade.php
version.php

index 0000000,6d7d0b8..fefbfb8
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,38 +1,37 @@@
 -
+ <?php
+ // This file is part of Moodle - http://moodle.org/
+ //
+ // Moodle is free software: you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation, either version 3 of the License, or
+ // (at your option) any later version.
+ //
+ // Moodle is distributed in the hope that it will be useful,
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+ /**
+  * Tool analytics webservice definitions.
+  *
+  * @package    tool_analytics
+  * @copyright  2019 David Monllao {@link http://www.davidmonllao.com}
+  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+  */
+ defined('MOODLE_INTERNAL') || die();
+ $functions = array(
+     'tool_analytics_potential_contexts' => array(
+         'classname'   => 'tool_analytics\external',
+         'methodname'  => 'potential_contexts',
+         'description' => 'Retrieve the list of potential contexts for a model.',
+         'type'        => 'read',
+         'ajax'          => true,
+         'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
+     ),
+ );
@@@ -3619,5 -3619,24 +3619,24 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2019101600.01);
      }
  
 -    if ($oldversion < 2019101800.12) {
++    if ($oldversion < 2019101800.02) {
+         // Get the table by its previous name.
+         $table = new xmldb_table('analytics_models');
+         if ($dbman->table_exists($table)) {
+             // Define field contextids to be added to analytics_models.
+             $field = new xmldb_field('contextids', XMLDB_TYPE_TEXT, null, null, null, null, null, 'version');
+             // Conditionally launch add field contextids.
+             if (!$dbman->field_exists($table, $field)) {
+                 $dbman->add_field($table, $field);
+             }
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2019101800.12);
++        upgrade_main_savepoint(true, 2019101800.02);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2019101800.01;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2019101800.12;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2019101800.02;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.