Skip to content
Snippets Groups Projects
Commit 7fcc9f5c authored by TamaraGunkel's avatar TamaraGunkel
Browse files

Upgrade steps

parent 2177b9ab
Branches
Tags
No related merge requests found
<?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/>.
/**
* Capability definitions for the tool_cleanupcourses plugin
* @package tool_cleanupcourses
* @copyright 2018 Tamara Gunkel, Jan Dageförde (WWU)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$capabilities = array(
'tool_cleanupcourses/view:managecourse' => array(
'contextlevel' => CONTEXT_SYSTEM,
'captype' => 'write',
'archetypes' => array(
'manager' => CAP_PREVENT,
'editingteacher' => CAP_ALLOW,
'teacher' => CAP_PREVENT,
'students' => CAP_PREVENT,
),
'clonepermissionsfrom' => 'moodle/course:update'
),
);
......@@ -207,7 +207,7 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2018021302, 'tool', 'cleanupcourses');
}
if ($oldversion < 2018022000) {
if ($oldversion < 2018022001) {
// Define field manual to be added to tool_cleanupcourses_workflow.
$table = new xmldb_table('tool_cleanupcourses_workflow');
......@@ -219,7 +219,20 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
}
// Cleanupcourses savepoint reached.
upgrade_plugin_savepoint(true, 2018022000, 'tool', 'cleanupcourses');
upgrade_plugin_savepoint(true, 2018022001, 'tool', 'cleanupcourses');
}
if ($oldversion < 2018022002) {
// Define field manual to be added to tool_cleanupcourses_workflow.
$table = new xmldb_table('tool_cleanupcourses_procdata');
$field = new xmldb_field('key', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, null, 'subpluginname');
// Launch rename field key.
$dbman->rename_field($table, $field, 'keyname');
// Cleanupcourses savepoint reached.
upgrade_plugin_savepoint(true, 2018022002, 'tool', 'cleanupcourses');
}
return true;
......
......@@ -23,5 +23,5 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2018022000;
$plugin->version = 2018022002;
$plugin->component = 'tool_cleanupcourses';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment