-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a table in step email and inserted the logging in the task
- Loading branch information
1 parent
95a4b22
commit acdb195
Showing
7 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?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/>. | ||
|
||
/** | ||
* Update script for lifecyclestep_email plugin | ||
* | ||
* @package lifecyclestep_email | ||
* @copyright 2024 Nina Herrmann University of Münster | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
/** | ||
* Update script for lifecyclestep_email. | ||
* @param int $oldversion Version id of the previously installed version. | ||
* @return bool | ||
* @throws ddl_exception | ||
* @throws ddl_field_missing_exception | ||
* @throws ddl_table_missing_exception | ||
* @throws dml_exception | ||
* @throws downgrade_exception | ||
* @throws upgrade_exception | ||
*/ | ||
function xmldb_lifecyclestep_email_upgrade($oldversion) { | ||
|
||
global $DB; | ||
$dbman = $DB->get_manager(); | ||
if ($oldversion < 2024061301) { | ||
$table = new xmldb_table('lifecyclestep_email_notified'); | ||
|
||
// Adding fields to table tool_lifecycle_proc_error. | ||
$table->add_field('id', XMLDB_TYPE_INTEGER, '20', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); | ||
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '20', null, XMLDB_NOTNULL, null, null); | ||
$table->add_field('userid', XMLDB_TYPE_INTEGER, '20', null, XMLDB_NOTNULL, null, null); | ||
$table->add_field('timemailsent', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); | ||
|
||
// Adding keys to table tool_lifecycle_proc_error. | ||
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); | ||
$table->add_key('courseid_fk', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); | ||
$table->add_key('userid_fk', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); | ||
|
||
// Conditionally launch create table for tool_lifecycle_proc_error. | ||
if (!$dbman->table_exists($table)) { | ||
$dbman->create_table($table); | ||
} | ||
|
||
// Lifecycle savepoint reached. | ||
upgrade_plugin_savepoint(true, 2024061301, 'tool', 'lifecycle'); | ||
} | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters