diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml
index 8adbd0f6..cc8943b7 100644
--- a/.github/workflows/moodle-ci.yml
+++ b/.github/workflows/moodle-ci.yml
@@ -8,8 +8,8 @@ jobs:
strategy:
matrix:
- php: ['8.0']
- moodle-branch: ['MOODLE_401_STABLE']
+ php: ['8.2']
+ moodle-branch: ['MOODLE_404_STABLE']
database: ['pgsql']
steps:
@@ -17,7 +17,7 @@ jobs:
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14
- name: Check out repository code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: plugin
@@ -28,29 +28,9 @@ jobs:
ini-values: max_input_vars=5000
coverage: none
- - name: Get composer cache directory
- id: composer-cache
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
-
- - name: Composer cache
- uses: actions/cache@v3
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
-
- - name: npm cache
- uses: actions/cache@v3
- with:
- path: ~/.npm
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-node-
-
- name: Initialise moodle-plugin-ci
run: |
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
+ composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
@@ -107,16 +87,21 @@ jobs:
strategy:
fail-fast: false
matrix:
- php: ['8.0']
- moodle-branch: ['MOODLE_311_STABLE', 'MOODLE_400_STABLE', 'MOODLE_401_STABLE']
+ php: ['8.0', '8.1', '8.2']
+ moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE', 'MOODLE_403_STABLE', 'MOODLE_404_STABLE']
database: ['mariadb', 'pgsql']
+ exclude:
+ - php: '8.0'
+ moodle-branch: 'MOODLE_404_STABLE'
+ - php: '8.2'
+ moodle-branch: 'MOODLE_401_STABLE'
include:
- php: '7.4'
- moodle-branch: 'MOODLE_39_STABLE'
- database: 'mariadb'
- - php: '7.4'
- moodle-branch: 'MOODLE_39_STABLE'
+ moodle-branch: 'MOODLE_401_STABLE'
database: 'pgsql'
+ - php: '7.4'
+ moodle-branch: 'MOODLE_401_STABLE'
+ database: 'mariadb'
steps:
- name: Start MariaDB
@@ -128,7 +113,7 @@ jobs:
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14
- name: Check out repository code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
path: plugin
@@ -139,24 +124,6 @@ jobs:
ini-values: max_input_vars=5000
coverage: none
- - name: Get composer cache directory
- id: composer-cache
- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- - name: Composer cache
- uses: actions/cache@v3
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-composer-
- - name: npm cache
- uses: actions/cache@v3
- with:
- path: ~/.npm
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-node-
-
- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
@@ -179,3 +146,15 @@ jobs:
- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome --auto-rerun 0
+
+ # This step allows to upload Behat faildump (screenshots) as workflow artifact,
+ # so it can be downloaded and inspected. You don't need this step if you
+ # are not running Behat test. Artifact will be retained for 7 days.
+ - name: Upload Behat Faildump
+ if: ${{ failure() && steps.behat.outcome == 'failure' }}
+ uses: actions/upload-artifact@v4
+ with:
+ name: Behat Faildump (${{ join(matrix.*, ', ') }})
+ path: ${{ github.workspace }}/moodledata/behat_dump
+ retention-days: 7
+ if-no-files-found: ignore
diff --git a/.github/workflows/moodle-release.yml b/.github/workflows/moodle-release.yml
index 8d1c5bab..1e0fa321 100644
--- a/.github/workflows/moodle-release.yml
+++ b/.github/workflows/moodle-release.yml
@@ -28,10 +28,11 @@ jobs:
steps:
- name: Call the service function
id: add-version
+ env:
+ TAGNAME: ${{ github.event.release.tag_name }}
+ BODY: ${{ github.event.release.body }}
+ ZIPURL: ${{ github.event.release.zipball_url }}
run: |
- TAGNAME="${{ github.event.release.tag_name }}"
- BODY="${{ github.event.release.body }}"
- ZIPURL="${{ github.event.release.zipball_url }}"
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
--data-urlencode "wsfunction=${FUNCTION}" \
--data-urlencode "moodlewsrestformat=json" \
@@ -42,9 +43,9 @@ jobs:
--data-urlencode "vcstag=${TAGNAME}" \
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
--data-urlencode "altdownloadurl=${ZIPURL}" \
- --data-urlencode "releasenotes=${BODY}" \
+ --data-urlencode "releasenotes=${BODY@Q}" \
--data-urlencode "releasenotesformat=4")
- echo "::set-output name=response::${RESPONSE}"
+ echo "response=${RESPONSE}" >> $GITHUB_OUTPUT
- name: Evaluate the response
id: evaluate-response
env:
diff --git a/README.md b/README.md
index 8e4c64c3..7c8bf9a2 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,14 @@ Possible use cases are (not limited to):
To be adaptable to the needs of different institutions the plugin provides two subplugin types:
-**Trigger**: These subplugins control the conditions a course have to meet so that a specific process is started for it.
+**Trigger**: These subplugins control the conditions a course must meet so that a specific process is started.
**Step**: These subplugins represent atomic, reusable tasks that should be executed for a specific course.
+## Subplugins
Requirements that are specific to your institution can be added through additional subplugins.
-For more information please have a look at the [wiki](https://github.com/learnweb/moodle-tool_lifecycle/wiki).
-It provides instructions for administrators as well as for developers to implement own requirements into subplugins.
+A list of all subplugins and more information can be found in the [Wiki](https://github.com/learnweb/moodle-tool_lifecycle/wiki/List-of-Additional-Subplugins) ([subpluginslist](https://github.com/learnweb/moodle-tool_lifecycle/wiki/List-of-Additional-Subplugins)).
+It provides instructions for administrators as well as for developers to implement their own requirements into subplugins.
Installation
============
@@ -31,7 +32,7 @@ Moodle version
==============
The plugin is continously tested with all moodle versions, which are security supported by the moodle headquarter.
Therefore, Travis uses the most current release to build a test instance and run the behat and unit tests on them.
-In addition to all stable branches the version is also tested against the master branch to support early adopters.
+In addition to all stable branches the version is tested against the master branch to support early adopters.
Changelog
=========
diff --git a/activeprocesses.php b/activeprocesses.php
index 7efdd38d..1f49b72b 100644
--- a/activeprocesses.php
+++ b/activeprocesses.php
@@ -21,6 +21,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_login();
diff --git a/activeworkflows.php b/activeworkflows.php
index 9ce9c0a2..aca0133d 100644
--- a/activeworkflows.php
+++ b/activeworkflows.php
@@ -56,7 +56,7 @@
'inputname' => 'search',
'extraclasses' => 'mb-3',
'inform' => false,
- 'searchstring' => 'Search for courses'
+ 'searchstring' => 'Search for courses',
]);
echo $OUTPUT->heading(get_string('active_automatic_workflows_heading', 'tool_lifecycle'));
diff --git a/classes/event/process_proceeded.php b/classes/event/process_proceeded.php
index c3c9ac93..5aada6de 100644
--- a/classes/event/process_proceeded.php
+++ b/classes/event/process_proceeded.php
@@ -53,15 +53,15 @@ class process_proceeded extends \core\event\base {
* @throws \dml_exception
*/
public static function event_from_process($process) {
- $data = array(
+ $data = [
'context' => \context_system::instance(),
- 'other' => array(
+ 'other' => [
'processid' => $process->id,
'workflowid' => $process->workflowid,
'stepindex' => $process->stepindex,
- 'courseid' => $process->courseid
- )
- );
+ 'courseid' => $process->courseid,
+ ],
+ ];
return self::create($data);
}
diff --git a/classes/event/process_rollback.php b/classes/event/process_rollback.php
index 5fadca09..cafc1031 100644
--- a/classes/event/process_rollback.php
+++ b/classes/event/process_rollback.php
@@ -53,15 +53,15 @@ class process_rollback extends \core\event\base {
* @throws \dml_exception
*/
public static function event_from_process($process) {
- $data = array(
+ $data = [
'context' => \context_system::instance(),
- 'other' => array(
+ 'other' => [
'processid' => $process->id,
'workflowid' => $process->workflowid,
'stepindex' => $process->stepindex,
- 'courseid' => $process->courseid
- )
- );
+ 'courseid' => $process->courseid,
+ ],
+ ];
return self::create($data);
}
diff --git a/classes/event/process_triggered.php b/classes/event/process_triggered.php
index 0648b501..a71507ad 100644
--- a/classes/event/process_triggered.php
+++ b/classes/event/process_triggered.php
@@ -52,14 +52,14 @@ class process_triggered extends \core\event\base {
* @throws \dml_exception
*/
public static function event_from_process($process) {
- $data = array(
+ $data = [
'context' => \context_system::instance(),
- 'other' => array(
+ 'other' => [
'processid' => $process->id,
'workflowid' => $process->workflowid,
- 'courseid' => $process->courseid
- )
- );
+ 'courseid' => $process->courseid,
+ ],
+ ];
return self::create($data);
}
diff --git a/classes/local/backup/backup_lifecycle_workflow.php b/classes/local/backup/backup_lifecycle_workflow.php
index 743a0561..2e768894 100644
--- a/classes/local/backup/backup_lifecycle_workflow.php
+++ b/classes/local/backup/backup_lifecycle_workflow.php
@@ -107,7 +107,9 @@ public function send_temp_file() {
*/
private function write_workflow() {
foreach (get_object_vars($this->workflow) as $prop => $value) {
- $this->writer->writeAttribute($prop, $value);
+ if (!is_null($value)) {
+ $this->writer->writeAttribute($prop, $value);
+ }
}
}
@@ -118,13 +120,17 @@ private function write_triggers() {
foreach ($this->trigger as $trigger) {
$this->writer->startElement("trigger");
foreach (get_object_vars($trigger) as $prop => $value) {
- $this->writer->writeAttribute($prop, $value);
+ if (!is_null($value)) {
+ $this->writer->writeAttribute($prop, $value);
+ }
}
$settings = settings_manager::get_settings($trigger->id, settings_type::TRIGGER);
foreach ($settings as $name => $value) {
$this->writer->startElement("setting");
$this->writer->writeAttribute('name', $name);
- $this->writer->writeAttribute('value', $value);
+ if (!is_null($value)) {
+ $this->writer->writeAttribute('value', $value);
+ }
$this->writer->endElement();
}
$this->writer->endElement();
@@ -139,13 +145,17 @@ private function write_steps() {
foreach ($this->steps as $step) {
$this->writer->startElement("step");
foreach (get_object_vars($step) as $prop => $value) {
- $this->writer->writeAttribute($prop, $value);
+ if (!is_null($value)) {
+ $this->writer->writeAttribute($prop, $value);
+ }
}
$settings = settings_manager::get_settings($step->id, settings_type::STEP);
foreach ($settings as $name => $value) {
$this->writer->startElement("setting");
$this->writer->writeAttribute('name', $name);
- $this->writer->writeAttribute('value', $value);
+ if (!is_null($value)) {
+ $this->writer->writeAttribute('value', $value);
+ }
$this->writer->endElement();
}
$this->writer->endElement();
diff --git a/classes/local/backup/restore_lifecycle_workflow.php b/classes/local/backup/restore_lifecycle_workflow.php
index 1cb3ff1c..5e9b1fe9 100644
--- a/classes/local/backup/restore_lifecycle_workflow.php
+++ b/classes/local/backup/restore_lifecycle_workflow.php
@@ -25,6 +25,7 @@
use tool_lifecycle\local\entity\step_subplugin;
use tool_lifecycle\local\entity\trigger_subplugin;
use tool_lifecycle\local\entity\workflow;
+use tool_lifecycle\local\manager\lib_manager;
use tool_lifecycle\local\manager\workflow_manager;
use tool_lifecycle\local\manager\step_manager;
use tool_lifecycle\local\manager\trigger_manager;
@@ -59,27 +60,35 @@ class restore_lifecycle_workflow {
public function __construct($xmldata) {
$this->reader = new \XMLReader();
$this->reader->XML($xmldata);
-
}
/**
* Executes the restore process. It loads the workflow with all steps and triggers from the xml data.
* If all data is valid, it restores the workflow with all subplugins and settings.
* Otherwise an array with error strings is returned.
+ * @param bool $force force import, even if there are errors.
* @return string[] Errors, which occurred during the restore process.
* @throws \coding_exception
* @throws \moodle_exception
*/
- public function execute() {
+ public function execute(bool $force = false) {
$this->reader->read();
$this->load_workflow();
// If the workflow could be loaded continue with the subplugins.
if ($this->workflow) {
$this->load_subplugins();
+
+ if (!$this->all_subplugins_installed()) {
+ return $this->errors;
+ }
+
// Validate the subplugin data.
- if (empty($this->errors) && $this->all_subplugins_installed()) {
+ $this->check_subplugin_validity();
+ if (empty($this->errors) || $force) {
// If all loaded data is valid, the new workflow and the steps can be stored in the database.
+ // If we force the import, we empty the errors;
+ $this->errors = [];
$this->persist();
}
}
@@ -174,6 +183,41 @@ private function all_subplugins_installed() {
return true;
}
+ /**
+ * Calls the subplugins to check the consistency and validity of the step and trigger settings.
+ */
+ private function check_subplugin_validity() {
+ foreach ($this->steps as $step) {
+ $steplib = lib_manager::get_step_lib($step->subpluginname);
+ $filteredsettings = [];
+ foreach ($this->settings as $setting) {
+ if ($setting->pluginid === $step->id) {
+ $filteredsettings[$setting->name] = $setting->value;
+ }
+ }
+ $errors = array_map(
+ fn($x) => get_string('restore_error_in_step', 'tool_lifecycle', $step->instancename) . $x,
+ $steplib->ensure_validity($filteredsettings)
+ );
+ $this->errors = array_merge($this->errors, $errors);
+ }
+
+ foreach ($this->trigger as $trigger) {
+ $steplib = lib_manager::get_trigger_lib($trigger->subpluginname);
+ $filteredsettings = [];
+ foreach ($this->settings as $setting) {
+ if ($setting->pluginid === $trigger->id) {
+ $filteredsettings[$setting->name] = $setting->value;
+ }
+ }
+ $errors = array_map(
+ fn($x) => get_string('restore_error_in_trigger', 'tool_lifecycle', $trigger->instancename) . $x,
+ $steplib->ensure_validity($filteredsettings)
+ );
+ $this->errors = array_merge($this->errors, $errors);
+ }
+ }
+
/**
* Stores all loaded data in the database.
* @throws \moodle_exception
diff --git a/classes/local/form/form_courses_filter.php b/classes/local/form/form_courses_filter.php
index f589bcea..a7b52ba9 100644
--- a/classes/local/form/form_courses_filter.php
+++ b/classes/local/form/form_courses_filter.php
@@ -53,11 +53,11 @@ public function definition() {
$mform->setType('fullname', PARAM_TEXT);
// Edited from $this->add_action_buttons to allow custom cancel text.
- $buttonarray = array();
+ $buttonarray = [];
$buttonarray[] = &$mform->createElement('submit', 'submitbutton',
get_string('apply', 'tool_lifecycle'));
$buttonarray[] = &$mform->createElement('cancel', 'cancel', get_string('reset'));
- $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
+ $mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->closeHeaderBefore('buttonar');
}
diff --git a/classes/local/form/form_delays_filter.php b/classes/local/form/form_delays_filter.php
index 845e2163..3abcf120 100644
--- a/classes/local/form/form_delays_filter.php
+++ b/classes/local/form/form_delays_filter.php
@@ -48,7 +48,7 @@ public function definition() {
$activeworkflows = workflow_manager::get_active_workflows();
$workflowoptions = [
'' => get_string('all_delays', 'tool_lifecycle'),
- 'global' => get_string('globally', 'tool_lifecycle')
+ 'global' => get_string('globally', 'tool_lifecycle'),
];
foreach ($activeworkflows as $activeworkflow) {
// Only show non-static workflows.
diff --git a/classes/local/form/form_step_instance.php b/classes/local/form/form_step_instance.php
index f080413d..647df64c 100644
--- a/classes/local/form/form_step_instance.php
+++ b/classes/local/form/form_step_instance.php
@@ -139,9 +139,9 @@ private function add_cancel_button() {
$mform =& $this->_form;
// Add a group 'buttonar' to allow excluding it from freezing.
- $buttonarray = array();
+ $buttonarray = [];
$buttonarray[] = &$mform->createElement('cancel');
- $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
+ $mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->closeHeaderBefore('buttonar');
}
diff --git a/classes/local/form/form_trigger_instance.php b/classes/local/form/form_trigger_instance.php
index 0ac8f901..3646a6af 100644
--- a/classes/local/form/form_trigger_instance.php
+++ b/classes/local/form/form_trigger_instance.php
@@ -144,9 +144,9 @@ public function definition() {
private function add_cancel_button() {
$mform =& $this->_form;
- $buttonarray = array();
+ $buttonarray = [];
$buttonarray[] = &$mform->createElement('cancel');
- $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
+ $mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->closeHeaderBefore('buttonar');
}
@@ -191,7 +191,8 @@ public function definition_after_data() {
}
}
- /** Validate the form.
+ /**
+ * Validate the form.
* @param array $data array of ("fieldname"=>value) of submitted data
* @param array $files array of uploaded files "element_name"=>tmp_file_path
* @return array of "element_name"=>"error_description" if there are errors,
diff --git a/classes/local/form/form_upload_workflow.php b/classes/local/form/form_upload_workflow.php
index 5ce328c7..ee30d441 100644
--- a/classes/local/form/form_upload_workflow.php
+++ b/classes/local/form/form_upload_workflow.php
@@ -42,7 +42,13 @@ public function definition() {
$mform = $this->_form;
$mform->addElement('filepicker', 'backupfile', get_string('file'), null,
- array('accepted_types' => 'xml'));
+ ['accepted_types' => 'xml']);
+
+ $showforce = isset($this->_customdata['showforce']) && $this->_customdata['showforce'];
+ $mform->addElement($showforce ? 'checkbox' : 'hidden', 'force', get_string('force_import', 'tool_lifecycle'));
+ $mform->setDefault('force', 0);
+ $mform->setType('force', PARAM_BOOL);
+
$this->add_action_buttons('true', get_string('upload'));
}
diff --git a/classes/local/manager/backup_manager.php b/classes/local/manager/backup_manager.php
index f7752b45..4ad70e31 100644
--- a/classes/local/manager/backup_manager.php
+++ b/classes/local/manager/backup_manager.php
@@ -102,7 +102,7 @@ public static function create_course_backup($courseid) {
*/
public static function restore_course_backup($backupid) {
global $DB, $CFG;
- $backuprecord = $DB->get_record('tool_lifecycle_backups', array('id' => $backupid));
+ $backuprecord = $DB->get_record('tool_lifecycle_backups', ['id' => $backupid]);
// Check if backup tmp dir exists.
$backuptmpdir = $CFG->tempdir . DIRECTORY_SEPARATOR . 'backup';
@@ -125,10 +125,10 @@ public static function restore_course_backup($backupid) {
$context = \context_system::instance();
$restoreurl = new \moodle_url('/backup/restore.php',
- array(
+ [
'contextid' => $context->id,
'filename' => $targetfilename,
- )
+ ]
);
redirect($restoreurl);
diff --git a/classes/local/manager/delayed_courses_manager.php b/classes/local/manager/delayed_courses_manager.php
index b2520a9b..37d112f5 100644
--- a/classes/local/manager/delayed_courses_manager.php
+++ b/classes/local/manager/delayed_courses_manager.php
@@ -60,7 +60,7 @@ public static function set_course_delayed_for_workflow($courseid, $becauserollba
} else {
$delayeduntil = time() + $duration;
$record = $DB->get_record('tool_lifecycle_delayed_workf',
- array('courseid' => $courseid, 'workflowid' => $workflow->id));
+ ['courseid' => $courseid, 'workflowid' => $workflow->id]);
if (!$record) {
$record = new \stdClass();
$record->courseid = $courseid;
@@ -86,7 +86,7 @@ public static function set_course_delayed_for_workflow($courseid, $becauserollba
public static function get_delayed_courses_for_workflow($workflowid) {
global $DB;
$sql = 'SELECT courseid FROM {tool_lifecycle_delayed_workf} WHERE delayeduntil > :now AND workflowid = :workflowid';
- return $DB->get_fieldset_sql($sql, array('now' => time(), 'workflowid' => $workflowid));
+ return $DB->get_fieldset_sql($sql, ['now' => time(), 'workflowid' => $workflowid]);
}
/**
@@ -98,7 +98,7 @@ public static function get_delayed_courses_for_workflow($workflowid) {
public static function set_course_delayed($courseid, $duration) {
global $DB;
$delayeduntil = time() + $duration;
- $record = $DB->get_record('tool_lifecycle_delayed', array('courseid' => $courseid));
+ $record = $DB->get_record('tool_lifecycle_delayed', ['courseid' => $courseid]);
if (!$record) {
$record = new \stdClass();
$record->courseid = $courseid;
@@ -120,7 +120,7 @@ public static function set_course_delayed($courseid, $duration) {
*/
public static function get_course_delayed($courseid) {
global $DB;
- $record = $DB->get_record('tool_lifecycle_delayed', array('courseid' => $courseid));
+ $record = $DB->get_record('tool_lifecycle_delayed', ['courseid' => $courseid]);
if ($record) {
return $record->delayeduntil;
} else {
@@ -134,8 +134,8 @@ public static function get_course_delayed($courseid) {
*/
public static function get_course_delayed_wheresql() {
$where = "{course}.id IN (SELECT courseid FROM {tool_lifecycle_delayed} WHERE delayeduntil > :now)";
- $params = array("now" => time());
- return array($where, $params);
+ $params = ["now" => time()];
+ return [$where, $params];
}
/**
@@ -146,7 +146,7 @@ public static function get_course_delayed_wheresql() {
public static function get_globally_delayed_courses() {
global $DB;
$sql = 'SELECT courseid FROM {tool_lifecycle_delayed} WHERE delayeduntil > :now';
- return $DB->get_fieldset_sql($sql, array('now' => time()));
+ return $DB->get_fieldset_sql($sql, ['now' => time()]);
}
/**
@@ -156,6 +156,6 @@ public static function get_globally_delayed_courses() {
*/
public static function remove_delay_entry($courseid) {
global $DB;
- $DB->delete_records('tool_lifecycle_delayed', array('courseid' => $courseid));
+ $DB->delete_records('tool_lifecycle_delayed', ['courseid' => $courseid]);
}
}
diff --git a/classes/local/manager/process_data_manager.php b/classes/local/manager/process_data_manager.php
index 722e2a6a..ce06ae64 100644
--- a/classes/local/manager/process_data_manager.php
+++ b/classes/local/manager/process_data_manager.php
@@ -53,10 +53,10 @@ class process_data_manager {
*/
public static function get_process_data($processid, $stepid, $key) {
global $DB;
- $params = array(
+ $params = [
'processid' => $processid,
'keyname' => $key,
- );
+ ];
if (step_manager::is_process_data_instance_dependent($stepid)) {
$params['stepid'] = $stepid;
} else {
@@ -78,10 +78,10 @@ public static function get_process_data($processid, $stepid, $key) {
*/
public static function set_process_data($processid, $stepid, $key, $value) {
global $DB;
- $entry = array(
+ $entry = [
'processid' => $processid,
'keyname' => $key,
- );
+ ];
if (step_manager::is_process_data_instance_dependent($stepid)) {
$entry['stepid'] = $stepid;
} else {
diff --git a/classes/local/manager/process_manager.php b/classes/local/manager/process_manager.php
index b0b92039..ca92f0de 100644
--- a/classes/local/manager/process_manager.php
+++ b/classes/local/manager/process_manager.php
@@ -88,7 +88,7 @@ public static function manually_trigger_process($courseid, $triggerid) {
public static function get_processes() {
global $DB;
$records = $DB->get_records('tool_lifecycle_process');
- $processes = array();
+ $processes = [];
foreach ($records as $record) {
$processes[] = process::from_record($record);
}
@@ -103,7 +103,7 @@ public static function get_processes() {
*/
public static function get_process_by_id($processid) {
global $DB;
- $record = $DB->get_record('tool_lifecycle_process', array('id' => $processid));
+ $record = $DB->get_record('tool_lifecycle_process', ['id' => $processid]);
if ($record) {
return process::from_record($record);
} else {
@@ -119,7 +119,7 @@ public static function get_process_by_id($processid) {
*/
public static function count_processes_by_workflow($workflowid) {
global $DB;
- return $DB->count_records('tool_lifecycle_process', array('workflowid' => $workflowid));
+ return $DB->count_records('tool_lifecycle_process', ['workflowid' => $workflowid]);
}
/**
@@ -130,8 +130,8 @@ public static function count_processes_by_workflow($workflowid) {
*/
public static function get_processes_by_workflow($workflowid) {
global $DB;
- $records = $DB->get_records('tool_lifecycle_process', array('workflowid' => $workflowid));
- $processes = array();
+ $records = $DB->get_records('tool_lifecycle_process', ['workflowid' => $workflowid]);
+ $processes = [];
foreach ($records as $record) {
$processes[] = process::from_record($record);
}
@@ -201,7 +201,7 @@ public static function rollback_process($process) {
*/
private static function remove_process($process) {
global $DB;
- $DB->delete_records('tool_lifecycle_procdata', array('processid' => $process->id));
+ $DB->delete_records('tool_lifecycle_procdata', ['processid' => $process->id]);
$DB->delete_records('tool_lifecycle_process', (array) $process);
}
@@ -213,7 +213,7 @@ private static function remove_process($process) {
*/
public static function get_process_by_course_id($courseid) {
global $DB;
- $record = $DB->get_record('tool_lifecycle_process', array('courseid' => $courseid));
+ $record = $DB->get_record('tool_lifecycle_process', ['courseid' => $courseid]);
if ($record) {
return process::from_record($record);
} else {
diff --git a/classes/local/manager/settings_manager.php b/classes/local/manager/settings_manager.php
index 4db7be7e..6f0aade4 100644
--- a/classes/local/manager/settings_manager.php
+++ b/classes/local/manager/settings_manager.php
@@ -109,10 +109,10 @@ public static function save_settings($instanceid, $type, $subpluginname, $data,
$cleanedvalue = clean_param($value, $setting->paramtype);
}
$record = $DB->get_record('tool_lifecycle_settings',
- array(
+ [
'instanceid' => $instanceid,
'type' => $type,
- 'name' => $setting->name)
+ 'name' => $setting->name, ]
);
if ($record) {
if ($record->value != $cleanedvalue) {
@@ -164,11 +164,11 @@ public static function get_settings($instanceid, $type) {
$lib = lib_manager::get_step_lib($instance->subpluginname);
}
- $settingsvalues = array();
+ $settingsvalues = [];
foreach ($lib->instance_settings() as $setting) {
- $record = $DB->get_record('tool_lifecycle_settings', array('instanceid' => $instanceid,
+ $record = $DB->get_record('tool_lifecycle_settings', ['instanceid' => $instanceid,
'type' => $type,
- 'name' => $setting->name));
+ 'name' => $setting->name, ]);
if ($record) {
$value = clean_param($record->value, $setting->paramtype);
$settingsvalues[$setting->name] = $value;
@@ -189,8 +189,8 @@ public static function remove_settings($instanceid, $type) {
self::validate_type($type);
$DB->delete_records('tool_lifecycle_settings',
- array('instanceid' => $instanceid,
- 'type' => $type));
+ ['instanceid' => $instanceid,
+ 'type' => $type, ]);
}
/**
diff --git a/classes/local/manager/step_manager.php b/classes/local/manager/step_manager.php
index cd58d1a5..3158cd40 100644
--- a/classes/local/manager/step_manager.php
+++ b/classes/local/manager/step_manager.php
@@ -44,7 +44,7 @@ class step_manager extends subplugin_manager {
*/
public static function get_step_instance($stepinstanceid) {
global $DB;
- $record = $DB->get_record('tool_lifecycle_step', array('id' => $stepinstanceid));
+ $record = $DB->get_record('tool_lifecycle_step', ['id' => $stepinstanceid]);
if ($record) {
$subplugin = step_subplugin::from_record($record);
return $subplugin;
@@ -63,9 +63,9 @@ public static function get_step_instance($stepinstanceid) {
public static function get_step_instance_by_workflow_index($workflowid, $sortindex) {
global $DB;
$record = $DB->get_record('tool_lifecycle_step',
- array(
+ [
'workflowid' => $workflowid,
- 'sortindex' => $sortindex)
+ 'sortindex' => $sortindex, ]
);
if ($record) {
$subplugin = step_subplugin::from_record($record);
@@ -118,7 +118,7 @@ public static function remove_all_instances($subpluginname) {
private static function remove($stepinstanceid) {
global $DB;
$transaction = $DB->start_delegated_transaction();
- if ($record = $DB->get_record('tool_lifecycle_step', array('id' => $stepinstanceid))) {
+ if ($record = $DB->get_record('tool_lifecycle_step', ['id' => $stepinstanceid])) {
$step = step_subplugin::from_record($record);
self::remove_from_sortindex($step);
settings_manager::remove_settings($step->id, settings_type::STEP);
@@ -137,8 +137,8 @@ private static function remove_from_sortindex(&$toberemoved) {
global $DB;
if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_step',
- "sortindex > $toberemoved->sortindex",
- array('workflowid' => $toberemoved->workflowid));
+ 'workflowid = :workflowid AND sortindex > :sortindex',
+ ['workflowid' => $toberemoved->workflowid, 'sortindex' => $toberemoved->sortindex]);
foreach ($subplugins as $record) {
$subplugin = step_subplugin::from_record($record);
$subplugin->sortindex--;
@@ -174,9 +174,9 @@ public static function change_sortindex($stepid, $up) {
$transaction = $DB->start_delegated_transaction();
$otherrecord = $DB->get_record('tool_lifecycle_step',
- array(
+ [
'sortindex' => $otherindex,
- 'workflowid' => $step->workflowid)
+ 'workflowid' => $step->workflowid, ]
);
$otherstep = step_subplugin::from_record($otherrecord);
@@ -196,10 +196,10 @@ public static function change_sortindex($stepid, $up) {
*/
public static function get_step_instances($workflowid) {
global $DB;
- $records = $DB->get_records('tool_lifecycle_step', array(
- 'workflowid' => $workflowid
- ), 'sortindex');
- $steps = array();
+ $records = $DB->get_records('tool_lifecycle_step', [
+ 'workflowid' => $workflowid,
+ ], 'sortindex');
+ $steps = [];
foreach ($records as $id => $record) {
$steps[$id] = step_subplugin::from_record($record);
}
@@ -214,8 +214,8 @@ public static function get_step_instances($workflowid) {
*/
public static function get_step_instances_by_subpluginname($subpluginname) {
global $DB;
- $records = $DB->get_records('tool_lifecycle_step', array('subpluginname' => $subpluginname));
- $steps = array();
+ $records = $DB->get_records('tool_lifecycle_step', ['subpluginname' => $subpluginname]);
+ $steps = [];
foreach ($records as $id => $record) {
$steps[$id] = step_subplugin::from_record($record);
}
@@ -229,7 +229,7 @@ public static function get_step_instances_by_subpluginname($subpluginname) {
*/
public static function get_step_types() {
$subplugins = \core_component::get_plugin_list('lifecyclestep');
- $result = array();
+ $result = [];
foreach (array_keys($subplugins) as $plugin) {
$result[$plugin] = get_string('pluginname', 'lifecyclestep_' . $plugin);
}
@@ -291,7 +291,7 @@ public static function is_process_data_instance_dependent($stepid) {
public static function count_steps_of_workflow($workflowid) {
global $DB;
return $DB->count_records('tool_lifecycle_step',
- array('workflowid' => $workflowid)
+ ['workflowid' => $workflowid]
);
}
@@ -307,7 +307,7 @@ public static function remove_instances_of_workflow($workflowid) {
foreach ($instances as $instance) {
settings_manager::remove_settings($instance->id, settings_type::STEP);
}
- $DB->delete_records('tool_lifecycle_step', array('workflowid' => $workflowid));
+ $DB->delete_records('tool_lifecycle_step', ['workflowid' => $workflowid]);
}
/**
diff --git a/classes/local/manager/trigger_manager.php b/classes/local/manager/trigger_manager.php
index dc33b086..656d4233 100644
--- a/classes/local/manager/trigger_manager.php
+++ b/classes/local/manager/trigger_manager.php
@@ -74,8 +74,8 @@ public static function get_instance($instanceid) {
*/
public static function get_instances($subpluginname) {
global $DB;
- $result = array();
- $records = $DB->get_records('tool_lifecycle_trigger', array('subpluginname' => $subpluginname));
+ $result = [];
+ $records = $DB->get_records('tool_lifecycle_trigger', ['subpluginname' => $subpluginname]);
foreach ($records as $record) {
$subplugin = trigger_subplugin::from_record($record);
$result[] = $subplugin;
@@ -91,7 +91,7 @@ public static function get_instances($subpluginname) {
*/
private static function get_subplugin_by_id($subpluginid) {
global $DB;
- $record = $DB->get_record('tool_lifecycle_trigger', array('id' => $subpluginid));
+ $record = $DB->get_record('tool_lifecycle_trigger', ['id' => $subpluginid]);
if ($record) {
$subplugin = trigger_subplugin::from_record($record);
return $subplugin;
@@ -142,7 +142,7 @@ public static function remove_all_instances($subpluginname) {
private static function remove($triggerinstanceid) {
global $DB;
$transaction = $DB->start_delegated_transaction();
- if ($record = $DB->get_record('tool_lifecycle_trigger', array('id' => $triggerinstanceid))) {
+ if ($record = $DB->get_record('tool_lifecycle_trigger', ['id' => $triggerinstanceid])) {
$trigger = trigger_subplugin::from_record($record);
self::remove_from_sortindex($trigger);
settings_manager::remove_settings($trigger->id, settings_type::TRIGGER);
@@ -160,8 +160,8 @@ private static function remove($triggerinstanceid) {
*/
public static function get_triggers_for_workflow($workflowid) {
global $DB;
- $records = $DB->get_records('tool_lifecycle_trigger', array('workflowid' => $workflowid), 'sortindex');
- $output = array();
+ $records = $DB->get_records('tool_lifecycle_trigger', ['workflowid' => $workflowid], 'sortindex');
+ $output = [];
foreach ($records as $record) {
$subplugin = trigger_subplugin::from_record($record);
$output[] = $subplugin;
@@ -179,8 +179,8 @@ private static function remove_from_sortindex(&$toberemoved) {
global $DB;
if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_trigger',
- "sortindex > $toberemoved->sortindex",
- array('workflowid' => $toberemoved->workflowid));
+ 'workflowid = :workflowid AND sortindex > :sortindex',
+ ['workflowid' => $toberemoved->workflowid, 'sortindex' => $toberemoved->sortindex]);
foreach ($subplugins as $record) {
$subplugin = trigger_subplugin::from_record($record);
$subplugin->sortindex--;
@@ -216,9 +216,9 @@ public static function change_sortindex($triggerid, $up) {
$transaction = $DB->start_delegated_transaction();
$otherrecord = $DB->get_record('tool_lifecycle_trigger',
- array(
+ [
'sortindex' => $otherindex,
- 'workflowid' => $trigger->workflowid)
+ 'workflowid' => $trigger->workflowid, ]
);
$othertrigger = trigger_subplugin::from_record($otherrecord);
@@ -237,7 +237,7 @@ public static function change_sortindex($triggerid, $up) {
*/
public static function get_trigger_types() {
$subplugins = \core_component::get_plugin_list('lifecycletrigger');
- $result = array();
+ $result = [];
foreach (array_keys($subplugins) as $plugin) {
$result[$plugin] = get_string('pluginname', 'lifecycletrigger_' . $plugin);
}
@@ -251,7 +251,7 @@ public static function get_trigger_types() {
*/
public static function get_chooseable_trigger_types() {
$triggers = self::get_trigger_types();
- $result = array();
+ $result = [];
foreach ($triggers as $id => $trigger) {
$lib = lib_manager::get_trigger_lib($id);
if ($lib->has_multiple_instances()) {
@@ -300,7 +300,7 @@ public static function handle_action($action, $subpluginid, $workflowid) {
public static function count_triggers_of_workflow($workflowid) {
global $DB;
return $DB->count_records('tool_lifecycle_trigger',
- array('workflowid' => $workflowid)
+ ['workflowid' => $workflowid]
);
}
@@ -316,7 +316,7 @@ public static function remove_instances_of_workflow($workflowid) {
foreach ($instances as $instance) {
settings_manager::remove_settings($instance->id, settings_type::TRIGGER);
}
- $DB->delete_records('tool_lifecycle_trigger', array('workflowid' => $workflowid));
+ $DB->delete_records('tool_lifecycle_trigger', ['workflowid' => $workflowid]);
}
/**
diff --git a/classes/local/manager/workflow_manager.php b/classes/local/manager/workflow_manager.php
index 9a107aa1..4d395090 100644
--- a/classes/local/manager/workflow_manager.php
+++ b/classes/local/manager/workflow_manager.php
@@ -55,6 +55,7 @@ public static function insert_or_update(workflow &$workflow) {
$workflow->id = $DB->insert_record('tool_lifecycle_workflow', $workflow);
}
$transaction->allow_commit();
+ return $workflow->id;
}
/**
@@ -67,9 +68,11 @@ public static function insert_or_update(workflow &$workflow) {
public static function remove($workflowid, $hard = false) {
global $DB;
if ($hard || self::is_removable($workflowid)) {
+ $workflow = self::get_workflow($workflowid);
+ self::remove_from_sortindex($workflow);
trigger_manager::remove_instances_of_workflow($workflowid);
step_manager::remove_instances_of_workflow($workflowid);
- $DB->delete_records('tool_lifecycle_workflow', array('id' => $workflowid));
+ $DB->delete_records('tool_lifecycle_workflow', ['id' => $workflowid]);
}
}
@@ -81,12 +84,36 @@ public static function remove($workflowid, $hard = false) {
* @throws \dml_transaction_exception
*/
public static function disable($workflowid) {
+ global $DB;
+ $transaction = $DB->start_delegated_transaction();
$workflow = self::get_workflow($workflowid);
if ($workflow && self::is_disableable($workflowid)) {
$workflow->timeactive = null;
+ self::remove_from_sortindex($workflow);
$workflow->sortindex = null;
$workflow->timedeactive = time();
- self::insert_or_update($workflow);
+ $DB->update_record('tool_lifecycle_workflow', $workflow);
+ }
+ $transaction->allow_commit();
+ }
+
+ /**
+ * Removes a workflow from the sortindex.
+ *
+ * @param workflow $toberemoved
+ * @throws \dml_exception
+ * @throws \dml_transaction_exception
+ */
+ public static function remove_from_sortindex($toberemoved) {
+ global $DB;
+ if (isset($toberemoved->sortindex)) {
+ $workflows = self::get_active_automatic_workflows();
+ foreach ($workflows as $workflow) {
+ if ($workflow->sortindex > $toberemoved->sortindex) {
+ $workflow->sortindex--;
+ $DB->update_record('tool_lifecycle_workflow', $workflow);
+ }
+ }
}
}
@@ -113,7 +140,7 @@ public static function abortprocesses($workflowid) {
*/
public static function get_workflow($workflowid) {
global $DB;
- $record = $DB->get_record('tool_lifecycle_workflow', array('id' => $workflowid));
+ $record = $DB->get_record('tool_lifecycle_workflow', ['id' => $workflowid]);
if ($record) {
$workflow = workflow::from_record($record);
return $workflow;
@@ -130,7 +157,7 @@ public static function get_workflow($workflowid) {
*/
public static function get_workflows() {
global $DB;
- $result = array();
+ $result = [];
$records = $DB->get_records('tool_lifecycle_workflow');
foreach ($records as $record) {
$result[] = workflow::from_record($record);
@@ -149,7 +176,7 @@ public static function get_active_workflows() {
$records = $DB->get_records_sql(
'SELECT * FROM {tool_lifecycle_workflow}
WHERE timeactive IS NOT NULL ORDER BY sortindex');
- $result = array();
+ $result = [];
foreach ($records as $record) {
$result[] = workflow::from_record($record);
}
@@ -167,8 +194,8 @@ public static function get_active_automatic_workflows() {
$records = $DB->get_records_sql(
'SELECT * FROM {tool_lifecycle_workflow}
WHERE timeactive IS NOT NULL AND
- manual = ? ORDER BY sortindex', array(false));
- $result = array();
+ manual = ? ORDER BY sortindex', [false]);
+ $result = [];
foreach ($records as $record) {
$result[] = workflow::from_record($record);
}
@@ -185,8 +212,8 @@ public static function get_active_manual_workflow_triggers() {
global $DB;
$sql = 'SELECT t.* FROM {tool_lifecycle_workflow} w JOIN {tool_lifecycle_trigger} t ON t.workflowid = w.id' .
' WHERE w.timeactive IS NOT NULL AND w.manual = ?';
- $records = $DB->get_records_sql($sql, array(true));
- $result = array();
+ $records = $DB->get_records_sql($sql, [true]);
+ $result = [];
foreach ($records as $record) {
$result[] = trigger_subplugin::from_record($record);
}
@@ -203,7 +230,7 @@ public static function get_active_manual_workflow_triggers() {
*/
public static function get_manual_trigger_tools_for_active_workflows() {
$triggers = self::get_active_manual_workflow_triggers();
- $tools = array();
+ $tools = [];
foreach ($triggers as $trigger) {
$settings = settings_manager::get_settings($trigger->id, settings_type::TRIGGER);
$tools[] = new manual_trigger_tool($trigger->id, $settings['icon'], $settings['displayname'], $settings['capability']);
@@ -243,6 +270,14 @@ public static function activate_workflow($workflowid) {
$transaction->allow_commit();
}
+ /**
+ * Resets the 'does a manual workflow exist?'-cache.
+ */
+ private static function reset_has_workflow_cache() {
+ $cache = \cache::make('tool_lifecycle', 'application');
+ $cache->delete('workflowactive');
+ }
+
/**
* Handles an action of the subplugin_settings.
*
@@ -259,6 +294,7 @@ public static function handle_action($action, $workflowid) {
}
if ($action === action::WORKFLOW_ACTIVATE) {
self::activate_workflow($workflowid);
+ self::reset_has_workflow_cache();
} else if ($action === action::UP_WORKFLOW) {
self::change_sortindex($workflowid, true);
} else if ($action === action::DOWN_WORKFLOW) {
@@ -269,10 +305,12 @@ public static function handle_action($action, $workflowid) {
self::backup_workflow($workflowid);
} else if ($action === action::WORKFLOW_DISABLE) {
self::disable($workflowid);
+ self::reset_has_workflow_cache();
return; // Return, since we do not want to redirect outside to deactivated workflows.
} else if ($action === action::WORKFLOW_ABORTDISABLE) {
self::disable($workflowid);
self::abortprocesses($workflowid);
+ self::reset_has_workflow_cache();
return; // Return, since we do not want to redirect outside to deactivated workflows.
} else if ($action === action::WORKFLOW_ABORT) {
self::abortprocesses($workflowid);
@@ -282,6 +320,7 @@ public static function handle_action($action, $workflowid) {
if (self::get_workflow($workflowid) &&
self::is_removable($workflowid)) {
self::remove($workflowid);
+ self::reset_has_workflow_cache();
} else {
\core\notification::add(get_string('workflow_not_removeable', 'tool_lifecycle')
, \core\notification::WARNING);
@@ -324,8 +363,8 @@ public static function change_sortindex($workflowid, $up) {
$transaction = $DB->start_delegated_transaction();
$otherrecord = $DB->get_record('tool_lifecycle_workflow',
- array(
- 'sortindex' => $otherindex)
+ [
+ 'sortindex' => $otherindex, ]
);
$otherworkflow = workflow::from_record($otherrecord);
diff --git a/classes/local/table/active_manual_workflows_table.php b/classes/local/table/active_manual_workflows_table.php
index 90c95e5f..32faf8a3 100644
--- a/classes/local/table/active_manual_workflows_table.php
+++ b/classes/local/table/active_manual_workflows_table.php
@@ -73,7 +73,7 @@ public function init() {
get_string('workflow_processes', 'tool_lifecycle'),
get_string('workflow_tools', 'tool_lifecycle'),
]);
- $this->sortable(true, 'title');
+ $this->sortable(false, 'title');
$this->setup();
}
diff --git a/classes/local/table/active_processes_table.php b/classes/local/table/active_processes_table.php
index 2c2a3c70..3e3a7a40 100644
--- a/classes/local/table/active_processes_table.php
+++ b/classes/local/table/active_processes_table.php
@@ -89,7 +89,7 @@ public function __construct($uniqueid, $filterdata) {
get_string('fullnamecourse'),
get_string('workflow', 'tool_lifecycle'),
get_string('step', 'tool_lifecycle'),
- get_string('tools', 'tool_lifecycle')]);
+ get_string('tools', 'tool_lifecycle'), ]);
$this->column_nosort = ['tools'];
}
diff --git a/classes/local/table/active_workflows_table.php b/classes/local/table/active_workflows_table.php
index c3142d03..d0bd1222 100644
--- a/classes/local/table/active_workflows_table.php
+++ b/classes/local/table/active_workflows_table.php
@@ -56,9 +56,9 @@ public function col_tools($row) {
$alt = get_string('viewsteps', 'tool_lifecycle');
$icon = 't/viewdetails';
$overviewurl = new \moodle_url(urls::WORKFLOW_DETAILS,
- array('wf' => $row->id));
- $output .= $OUTPUT->action_icon($overviewurl, new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
- null, array('title' => $alt));
+ ['wf' => $row->id]);
+ $output .= $OUTPUT->action_icon($overviewurl, new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
+ null, ['title' => $alt]);
if (workflow_manager::is_disableable($row->id)) {
$action = action::WORKFLOW_BACKUP;
@@ -69,22 +69,22 @@ public function col_tools($row) {
$alt = get_string('disableworkflow', 'tool_lifecycle');
$icon = 't/disable';
$url = new \moodle_url(urls::DEACTIVATED_WORKFLOWS,
- array('workflowid' => $row->id, 'action' => action::WORKFLOW_DISABLE, 'sesskey' => sesskey()));
+ ['workflowid' => $row->id, 'action' => action::WORKFLOW_DISABLE, 'sesskey' => sesskey()]);
$confirmaction = new \confirm_action(get_string('disableworkflow_confirm', 'tool_lifecycle'));
$output .= $OUTPUT->action_icon($url,
- new \pix_icon($icon, $alt, 'tool_lifecycle', array('title' => $alt)),
+ new \pix_icon($icon, $alt, 'tool_lifecycle', ['title' => $alt]),
$confirmaction,
- array('title' => $alt));
+ ['title' => $alt]);
$alt = get_string('abortdisableworkflow', 'tool_lifecycle');
$icon = 't/stop';
$url = new \moodle_url(urls::DEACTIVATED_WORKFLOWS,
- array('workflowid' => $row->id, 'action' => action::WORKFLOW_ABORTDISABLE, 'sesskey' => sesskey()));
+ ['workflowid' => $row->id, 'action' => action::WORKFLOW_ABORTDISABLE, 'sesskey' => sesskey()]);
$confirmaction = new \confirm_action(get_string('abortdisableworkflow_confirm', 'tool_lifecycle'));
$output .= $OUTPUT->action_icon($url,
- new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
+ new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
$confirmaction,
- array('title' => $alt)
+ ['title' => $alt]
);
}
diff --git a/classes/local/table/course_backups_table.php b/classes/local/table/course_backups_table.php
index 6444969a..0739ab3c 100644
--- a/classes/local/table/course_backups_table.php
+++ b/classes/local/table/course_backups_table.php
@@ -86,7 +86,7 @@ public function init() {
get_string('fullnamecourse'),
get_string('backupcreated', 'tool_lifecycle'),
get_string('download', 'tool_lifecycle'),
- get_string('restore', 'tool_lifecycle')]);
+ get_string('restore', 'tool_lifecycle'), ]);
$this->setup();
}
@@ -147,7 +147,7 @@ public function col_backupcreated($row) {
*/
public function col_download($row) {
return \html_writer::link(
- new \moodle_url('/admin/tool/lifecycle/downloadbackup.php', array('backupid' => $row->id)),
+ new \moodle_url('/admin/tool/lifecycle/downloadbackup.php', ['backupid' => $row->id]),
get_string('download', 'tool_lifecycle')
);
}
@@ -161,7 +161,7 @@ public function col_download($row) {
*/
public function col_restore($row) {
return \html_writer::link(
- new \moodle_url('/admin/tool/lifecycle/restore.php', array('backupid' => $row->id)),
+ new \moodle_url('/admin/tool/lifecycle/restore.php', ['backupid' => $row->id]),
get_string('restore', 'tool_lifecycle')
);
}
diff --git a/classes/local/table/courses_in_step_table.php b/classes/local/table/courses_in_step_table.php
index f23d1ef0..d14a57ae 100644
--- a/classes/local/table/courses_in_step_table.php
+++ b/classes/local/table/courses_in_step_table.php
@@ -73,7 +73,7 @@ public function __construct($step, $courseid) {
$where = "p.stepindex = :stepindex AND p.workflowid = :wfid";
- $this->column_nosort = array('status', 'tools');
+ $this->column_nosort = ['status', 'tools'];
$this->set_sql($fields, $from, $where, ['stepindex' => $step->sortindex, 'wfid' => $step->workflowid]);
if ($courseid) {
$this->set_sortdata([]);
diff --git a/classes/local/table/deactivated_workflows_table.php b/classes/local/table/deactivated_workflows_table.php
index e6d3d182..37f867e5 100644
--- a/classes/local/table/deactivated_workflows_table.php
+++ b/classes/local/table/deactivated_workflows_table.php
@@ -89,20 +89,20 @@ public function col_tools($row) {
$alt = get_string('viewsteps', 'tool_lifecycle');
$icon = 't/viewdetails';
$url = new \moodle_url(urls::WORKFLOW_DETAILS,
- array('wf' => $row->id));
- $output .= $OUTPUT->action_icon($url, new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
- null, array('title' => $alt));
+ ['wf' => $row->id]);
+ $output .= $OUTPUT->action_icon($url, new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
+ null, ['title' => $alt]);
if (workflow_manager::is_abortable($row->id)) {
$alt = get_string('abortprocesses', 'tool_lifecycle');
$icon = 't/stop';
$url = new \moodle_url(urls::DEACTIVATED_WORKFLOWS,
- array('workflowid' => $row->id, 'action' => action::WORKFLOW_ABORT, 'sesskey' => sesskey()));
+ ['workflowid' => $row->id, 'action' => action::WORKFLOW_ABORT, 'sesskey' => sesskey()]);
$confirmaction = new \confirm_action(get_string('abortprocesses_confirm', 'tool_lifecycle'));
$output .= $OUTPUT->action_icon($url,
- new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
+ new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
$confirmaction,
- array('title' => $alt)
+ ['title' => $alt]
);
}
@@ -110,12 +110,12 @@ public function col_tools($row) {
$alt = get_string('deleteworkflow', 'tool_lifecycle');
$icon = 't/delete';
$url = new \moodle_url(urls::DEACTIVATED_WORKFLOWS,
- array('workflowid' => $row->id, 'action' => action::WORKFLOW_DELETE, 'sesskey' => sesskey()));
+ ['workflowid' => $row->id, 'action' => action::WORKFLOW_DELETE, 'sesskey' => sesskey()]);
$confirmaction = new \confirm_action(get_string('deleteworkflow_confirm', 'tool_lifecycle'));
$output .= $OUTPUT->action_icon($url,
- new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
+ new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
$confirmaction,
- array('title' => $alt)
+ ['title' => $alt]
);
}
diff --git a/classes/local/table/delayed_courses_table.php b/classes/local/table/delayed_courses_table.php
index fe2c1e9b..b87e9c7c 100644
--- a/classes/local/table/delayed_courses_table.php
+++ b/classes/local/table/delayed_courses_table.php
@@ -145,7 +145,7 @@ public function __construct($filterdata) {
get_string('coursename', 'tool_lifecycle'),
get_string('category'),
get_string('delays', 'tool_lifecycle'),
- get_string('tools', 'tool_lifecycle')
+ get_string('tools', 'tool_lifecycle'),
]);
}
@@ -175,13 +175,13 @@ public function col_workflow($row) {
$dateformat = get_string('strftimedatetimeshort', 'core_langconfig');
$date = userdate($row->workflowdelay, $dateformat);
$text = get_string('delayed_for_workflow_until', 'tool_lifecycle',
- array('name' => $row->workflow, 'date' => $date));
+ ['name' => $row->workflow, 'date' => $date]);
} else {
$text = get_string('delayed_for_workflows', 'tool_lifecycle', $row->workflowcount);
}
}
- return \html_writer::start_span('tool_lifecycle-hint', array('title' => $this->get_mouseover($row))) .
+ return \html_writer::start_span('tool_lifecycle-hint', ['title' => $this->get_mouseover($row)]) .
$text .
\html_writer::end_span();
}
@@ -205,7 +205,7 @@ private function get_mouseover($row) {
if ($row->workflowcount == 1) {
$date = userdate($row->workflowdelay, $dateformat);
$text .= get_string('name_until_date', 'tool_lifecycle',
- array('name' => $row->workflow, 'date' => $date)) . '
';
+ ['name' => $row->workflow, 'date' => $date]) . '
';
} else if ($row->workflowcount > 1) {
$sql = 'SELECT dw.id, dw.delayeduntil, w.title
FROM {tool_lifecycle_delayed_workf} dw
@@ -216,7 +216,7 @@ private function get_mouseover($row) {
foreach ($records as $record) {
$date = userdate($record->delayeduntil, $dateformat);
$text .= get_string('name_until_date', 'tool_lifecycle',
- array('name' => $record->title, 'date' => $date)) . '
';
+ ['name' => $record->title, 'date' => $date]) . '
';
}
}
return $text;
@@ -233,11 +233,11 @@ private function get_mouseover($row) {
public function col_tools($row) {
global $PAGE, $OUTPUT;
- $params = array(
+ $params = [
'action' => 'delete',
'cid' => $row->courseid,
- 'sesskey' => sesskey()
- );
+ 'sesskey' => sesskey(),
+ ];
if ($this->workflow) {
$params['workflow'] = $this->workflow;
diff --git a/classes/local/table/interaction_attention_table.php b/classes/local/table/interaction_attention_table.php
index 6cf8c504..2624831d 100644
--- a/classes/local/table/interaction_attention_table.php
+++ b/classes/local/table/interaction_attention_table.php
@@ -84,7 +84,7 @@ public function __construct($uniqueid, $courseids, $filterdata = null) {
}
}
- $this->column_nosort = array('status', 'tools');
+ $this->column_nosort = ['status', 'tools'];
$this->set_sql($fields, $from, join(" AND ", $where), $params);
$this->define_baseurl($PAGE->url);
$this->init();
@@ -155,12 +155,12 @@ private function format_icon_link($action, $processid, $stepinstanceid, $alt) {
global $PAGE, $OUTPUT;
$button = new \single_button(new \moodle_url($PAGE->url,
- array(
+ [
'stepid' => $stepinstanceid,
'action' => $action,
'processid' => $processid,
- 'sesskey' => sesskey()
- )), $alt
+ 'sesskey' => sesskey(),
+ ]), $alt
);
return $OUTPUT->render($button);
}
diff --git a/classes/local/table/interaction_remaining_table.php b/classes/local/table/interaction_remaining_table.php
index 039dc7e5..710ffa68 100644
--- a/classes/local/table/interaction_remaining_table.php
+++ b/classes/local/table/interaction_remaining_table.php
@@ -89,7 +89,7 @@ public function __construct($uniqueid, $courseids) {
$where = 'c.id IN ('. $ids . ')';
}
- $this->column_nosort = array('status', 'tools');
+ $this->column_nosort = ['status', 'tools'];
$this->sortable(true, 'lastmodified', 'DESC');
$this->set_sql($fields, $from, $where, []);
$this->set_count_sql("SELECT COUNT(1) FROM {course} c WHERE $where");
@@ -131,9 +131,9 @@ public function col_tools($row) {
foreach ($this->availabletools as $tool) {
if (has_capability($tool->capability, \context_course::instance($row->courseid), null, false)) {
$actions[$tool->triggerid] = new \action_menu_link_secondary(
- new \moodle_url($PAGE->url, array('triggerid' => $tool->triggerid,
- 'courseid' => $row->courseid, 'sesskey' => sesskey())),
- new \pix_icon($tool->icon, $tool->displayname, 'moodle', array('class' => 'iconsmall', 'title' => '')),
+ new \moodle_url($PAGE->url, ['triggerid' => $tool->triggerid,
+ 'courseid' => $row->courseid, 'sesskey' => sesskey(), ]),
+ new \pix_icon($tool->icon, $tool->displayname, 'moodle', ['class' => 'iconsmall', 'title' => '']),
$tool->displayname
);
}
diff --git a/classes/local/table/process_errors_table.php b/classes/local/table/process_errors_table.php
index 545a883d..d7463d17 100644
--- a/classes/local/table/process_errors_table.php
+++ b/classes/local/table/process_errors_table.php
@@ -53,7 +53,7 @@ public function __construct() {
$this->strings = [
'proceed' => get_string('proceed', 'tool_lifecycle'),
- 'rollback' => get_string('rollback', 'tool_lifecycle')
+ 'rollback' => get_string('rollback', 'tool_lifecycle'),
];
$fields = 'c.fullname as course, w.title as workflow, s.instancename as step, pe.*';
@@ -80,7 +80,7 @@ public function __construct() {
get_string('courseid', 'tool_lifecycle'),
get_string('course'),
get_string('error'),
- get_string('tools', 'tool_lifecycle')
+ get_string('tools', 'tool_lifecycle'),
]);
}
@@ -94,9 +94,9 @@ public function __construct() {
*/
public function col_error($row) {
return "" .
- nl2br(htmlentities($row->errormessage)) .
+ nl2br(htmlentities($row->errormessage, ENT_COMPAT)) .
"
" .
- nl2br(htmlentities($row->errortrace)) .
+ nl2br(htmlentities($row->errortrace, ENT_COMPAT)) .
"
Bitte besuchen Sie die Übersichtsseite.';
+$string['notifyerrorsemailsubject'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!';
+$string['overview:add_trigger'] = 'Trigger hinzufügen';
+$string['overview:add_trigger_help'] = 'Es kann nur eine Instanz jedes Triggertyps hinzugefügt werden.';
+$string['overview:trigger'] = 'Trigger';
+$string['overview:trigger_help'] = 'Ein Kurs fängt nur dann an, einen Workflow zu durchlaufen, wenn alle Trigger des Workflows dies übereinstimmend (UND-Verknüpfung) aussagen.
+In den hier genannten Zahlen werden Kurse, die verzögert werden oder sich bereits in anderen Workflows befinden, nicht mitgezählt.
+Trotzdem sind die Zahlen nur approximiert, da es sein könnte, dass die Kurse vor diesem einen anderen Workflow auslösen.';
+$string['pluginname'] = 'Kurs-Lebenszyklus';
+$string['plugintitle'] = 'Kurs-Lebenszyklus';
+$string['proceed'] = 'Fortfahren';
+$string['process_errors_header'] = 'Fehlermanagement';
+$string['process_proceeded_event'] = 'Ein Prozess wurde fortgeführt';
+$string['process_rollback_event'] = 'Ein Prozess wurde zurückgesetzt';
+$string['process_triggered_event'] = 'Ein Prozess wurde ausgelöst';
+$string['restore'] = 'Wiederherstellen';
+$string['restore_step_does_not_exist'] = 'Der Schritt {$a} ist nicht installiert, aber in der Sicherungsdatei enthalten. Bitte installieren Sie ihn zuerst und versuchen es dann erneut.';
+$string['restore_subplugins_invalid'] = 'Falsches Format der Sicherungsdatei. Das Format der Subpluginelemente ist nicht wie erwartet.';
+$string['restore_trigger_does_not_exist'] = 'Der Trigger {$a} ist nicht installiert, aber in der Sicherungsdatei enthalten. Bitte installieren Sie ihn zuerst und versuchen es dann erneut.';
+$string['restore_workflow_not_found'] = 'Falsches Format der Sicherungsdatei. Der Workflow konnte nicht gefunden werden.';
+$string['see_in_workflow'] = 'In Workflow ansehen';
+$string['status'] = 'Status';
+$string['step'] = 'Schritt';
+$string['step_delete'] = 'Entfernen';
+$string['step_edit'] = 'Bearbeiten';
+$string['step_instancename'] = 'Instanzname';
+$string['step_instancename_help'] = 'Titel der Schritt/Trigger-Instanz (nur für Admins sichtbar).';
+$string['step_settings_header'] = 'Spezifische Einstellungen des Schritttypen';
+$string['step_show'] = 'Anzeigen';
+$string['step_sortindex'] = 'Hoch/Runter';
+$string['step_subpluginname'] = 'Subpluginname';
+$string['step_subpluginname_help'] = 'Name des Schritt/Trigger-Subplugins (nur für Admins sichtbar).';
+$string['step_type'] = 'Typ';
+$string['subplugintype_lifecyclestep'] = 'Schritt eines Lifecycle-Prozesses';
+$string['subplugintype_lifecyclestep_plural'] = 'Schritte eines Lifecycle-Prozesses';
+$string['subplugintype_lifecycletrigger'] = 'Trigger zum Starten eines Lifecycle-Prozesses';
+$string['subplugintype_lifecycletrigger_plural'] = 'Trigger zum Starten eines Lifecycle-Prozesses';
+$string['tablecourseslog'] = 'Vergangene Aktionen';
+$string['tablecoursesremaining'] = 'Restliche Kurse';
+$string['tablecoursesrequiringattention'] = 'Kurse, die Ihre Aufmerksamkeit erfordern!';
+$string['tools'] = 'Aktionen';
+$string['trigger'] = 'Trigger';
+$string['trigger_does_not_exist'] = 'Der Trigger existiert nicht.';
+$string['trigger_enabled'] = 'Aktiviert';
$string['trigger_instancename'] = 'Instanzname';
$string['trigger_instancename_help'] = 'Titel der Trigger-Instanz (nur sichtbar für Admins).';
-$string['trigger_enabled'] = 'Aktiviert';
+$string['trigger_settings_header'] = 'Spezifische Einstellungen des Triggertypen';
$string['trigger_sortindex'] = 'Hoch/Runter';
+$string['trigger_subpluginname'] = 'Subplugin Name';
+$string['trigger_subpluginname_help'] = 'Name des Schritt/Trigger-Subplugins (nur für Admins sichtbar).';
$string['trigger_workflow'] = 'Workflow';
-
-$string['workflow'] = 'Workflow';
-$string['workflow_drafts_header'] = 'Workflow-Entwürfe';
-$string['active_workflows_header'] = 'Aktive Workflows';
-$string['add_workflow'] = 'Neuen Workflow hinzufügen';
$string['upload_workflow'] = 'Workflow hochladen';
-$string['create_workflow_from_existing'] = 'Kopie von bestehendem Workflow erstellen';
-$string['workflow_title'] = 'Titel';
-$string['workflow_title_help'] = 'Titel des Workflows (nur sichtbar für Admins).';
+$string['viewheading'] = 'Kurse verwalten';
+$string['viewsteps'] = 'Zeige Workflowschritte';
+$string['workflow'] = 'Workflow';
+$string['workflow_active'] = 'Aktiv';
+$string['workflow_definition_heading'] = 'Workflowdefinitionen';
+$string['workflow_delayforallworkflows'] = 'Ausschluss für alle Workflows?';
+$string['workflow_delayforallworkflows_help'] = 'Falls ja, wird ein Kurs für die oben genannte Zeit nicht nur von diesem, sondern
+ von allen Workflows ausgeschlossen. Das heißt, bis die Zeit abgelaufen ist, kann kein Prozess für den Kurs gestartet werden.';
$string['workflow_displaytitle'] = 'Angezeigter Titel des Workflows';
$string['workflow_displaytitle_help'] = 'Dieser Titel wird Nutzern beim Verwalten ihrer Kurse angezeigt.';
-$string['workflow_rollbackdelay'] = 'Kursauschluss beim Zurücksetzen';
-$string['workflow_rollbackdelay_help'] = 'Dieser Wert beschreibt die Zeit, bis wieder ein Prozess für diesen Workflow und einen Kurs
- gestartet werden kann, nachdem der Kurs innerhalb eines Prozesses dieses Workflows zurückgesetzt wurde.';
+$string['workflow_drafts_header'] = 'Workflow-Entwürfe';
+$string['workflow_drafts_list'] = 'Zeige Workflow-Entwürfe';
+$string['workflow_duplicate_title'] = '{$a} (Kopie)';
$string['workflow_finishdelay'] = 'Kursauschluss bei Beendigung';
$string['workflow_finishdelay_help'] = 'Dieser Wert beschreibt die Zeit, bis wieder ein Prozess für diesen Workflow und einen Kurs
gestartet werden kann, nachdem der Kurs einen Prozess dieses Workflows beendingt hat.';
-$string['workflow_delayforallworkflows'] = 'Ausschluss für alle Workflows?';
-$string['workflow_delayforallworkflows_help'] = 'Falls ja, wird ein Kurs für die oben genannte Zeit nicht nur von diesem, sondern
- von allen Workflows ausgeschlossen. Das heißt, bis die Zeit abgelaufen ist, kann kein Prozess für den Kurs gestartet werden.';
-$string['workflow_active'] = 'Aktiv';
+$string['workflow_is_running'] = 'Workflow läuft.';
+$string['workflow_not_removeable'] = 'Es ist nicht möglich, diese Workflow-Instanz zu entfernen. Vielleicht hat sie noch laufende Prozesse?';
$string['workflow_processes'] = 'Aktive Prozesse';
-$string['workflow_timeactive'] = 'Aktiv seit';
+$string['workflow_rollbackdelay'] = 'Kursauschluss beim Zurücksetzen';
+$string['workflow_rollbackdelay_help'] = 'Dieser Wert beschreibt die Zeit, bis wieder ein Prozess für diesen Workflow und einen Kurs
+ gestartet werden kann, nachdem der Kurs innerhalb eines Prozesses dieses Workflows zurückgesetzt wurde.';
$string['workflow_sortindex'] = 'Hoch/RUnter';
-$string['workflow_tools'] = 'Aktionen';
-$string['viewsteps'] = 'Zeige Workflowschritte';
-$string['editworkflow'] = 'Allgemeine Einstellungen bearbeiten';
-$string['backupworkflow'] = 'Workflow sichern';
-$string['duplicateworkflow'] = 'Workflow duplizieren';
-$string['deleteworkflow'] = 'Workflow löschen';
-$string['deleteworkflow_confirm'] = 'Sie sind dabei, den Workflow zu löschen. Das kann nicht rückgängig gemacht werden. Sind Sie sicher?';
-$string['activateworkflow'] = 'Aktivieren';
-$string['disableworkflow'] = 'Workflow deaktivieren (Prozesse laufen weiter)';
-$string['disableworkflow_confirm'] = 'Sie sind dabei, den Workflow zu deaktivieren. Sind Sie sicher?';
-$string['abortdisableworkflow'] = 'Workfow deaktivieren (Prozesse werden abgebrochen, eventuell unsicher!)';
-$string['abortdisableworkflow_confirm'] = 'Sie sind dabei, den Workflow zu deaktivieren. Alle laufenden Prozesse werden abgebrochen. Sind Sie sicher?';
-$string['abortprocesses'] = 'Laufende Prozesse abbrechen (eventuell unsicher!)';
-$string['abortprocesses_confirm'] = 'Alle laufenden Prozesse dieses Workflows werden abgebrochen. Sind Sie sicher?';
-$string['workflow_duplicate_title'] = '{$a} (Kopie)';
-
-// Deactivated workflows.
-$string['deactivated_workflows_list'] = 'Zeige deaktivierte Workflows';
-$string['deactivated_workflows_list_header'] = 'Deaktivierte Workflows';
+$string['workflow_started'] = 'Workflow gestartet.';
+$string['workflow_timeactive'] = 'Aktiv seit';
$string['workflow_timedeactive'] = 'Deaktiviert seit';
-$string['active_workflows_list'] = 'Zeige aktive Workflows';
-$string['workflow_drafts_list'] = 'Zeige Workflow-Entwürfe';
-
-$string['step_type'] = 'Typ';
-$string['step_subpluginname'] = 'Subpluginname';
-$string['step_subpluginname_help'] = 'Name des Schritt/Trigger-Subplugins (nur für Admins sichtbar).';
-$string['step_instancename'] = 'Instanzname';
-$string['step_instancename_help'] = 'Titel der Schritt/Trigger-Instanz (nur für Admins sichtbar).';
-$string['step_sortindex'] = 'Hoch/Runter';
-$string['step_edit'] = 'Bearbeiten';
-$string['step_show'] = 'Anzeigen';
-$string['step_delete'] = 'Entfernen';
-
-$string['trigger'] = 'Trigger';
-$string['step'] = 'Schritt';
-
+$string['workflow_title'] = 'Titel';
+$string['workflow_title_help'] = 'Titel des Workflows (nur sichtbar für Admins).';
+$string['workflow_tools'] = 'Aktionen';
$string['workflow_trigger'] = 'Trigger für den Workflow';
-
-$string['lifecycletrigger'] = 'Trigger';
-$string['lifecyclestep'] = 'Schritt';
-
-$string['subplugintype_lifecycletrigger'] = 'Trigger zum Starten eines Lifecycle-Prozesses';
-$string['subplugintype_lifecycletrigger_plural'] = 'Trigger zum Starten eines Lifecycle-Prozesses';
-$string['subplugintype_lifecyclestep'] = 'Schritt eines Lifecycle-Prozesses';
-$string['subplugintype_lifecyclestep_plural'] = 'Schritte eines Lifecycle-Prozesses';
-
-$string['nointeractioninterface'] = 'Keine Interaktionsschnittstelle verfügbar!';
-$string['tools'] = 'Aktionen';
-$string['status'] = 'Status';
-$string['date'] = 'Fällligkeitsdatum';
-
-$string['nostepfound'] = 'Es konnte kein Schritt mit der gegeben Schrittid gefunden werden!';
-$string['noprocessfound'] = 'Es konnte kein Prozess mit der gegebenen Prozessid gefunden werden!';
-
-$string['nocoursestodisplay'] = 'Es gibt derzeit keine Kurse, die Ihre Aufmerksamkeit erfordern!';
-$string['noremainingcoursestodisplay'] = 'Es gibt derzeit keine verbleibenden Kurse!';
-
-$string['course_backups_list_header'] = 'Kurssicherungen';
-$string['backupcreated'] = 'Erstellt am';
-$string['restore'] = 'Wiederherstellen';
-$string['download'] = 'Herunterladen';
-
$string['workflownotfound'] = 'Es konnte kein Workflow mit der ID {$a} gefunden werden!';
-
-// View.php.
-$string['tablecoursesrequiringattention'] = 'Kurse, die Ihre Aufmerksamkeit erfordern!';
-$string['tablecoursesremaining'] = 'Restliche Kurse';
-$string['tablecourseslog'] = 'Vergangene Aktionen';
-$string['viewheading'] = 'Kurse verwalten';
-$string['interaction_success'] = 'Aktion erfolgreich gespeichert.';
-$string['manual_trigger_success'] = 'Workflow erfolgreich gestartet.';
-$string['manual_trigger_process_existed'] = 'Es existiert bereits ein Workflow für diesen Kurs.';
-
-$string['coursename'] = 'Kursname';
-$string['lastaction'] = 'Letzte Aktion am';
-
-$string['workflow_started'] = 'Workflow gestartet.';
-$string['workflow_is_running'] = 'Workflow läuft.';
-
-// Backup & Restore.
-$string['restore_workflow_not_found'] = 'Falsches Format der Sicherungsdatei. Der Workflow konnte nicht gefunden werden.';
-$string['restore_subplugins_invalid'] = 'Falsches Format der Sicherungsdatei. Das Format der Subpluginelemente ist nicht wie erwartet.';
-$string['restore_step_does_not_exist'] = 'Der Schritt {$a} ist nicht installiert, aber in der Sicherungsdatei enthalten. Bitte installieren Sie ihn zuerst und versuchen es dann erneut.';
-$string['restore_trigger_does_not_exist'] = 'Der Trigger {$a} ist nicht installiert, aber in der Sicherungsdatei enthalten. Bitte installieren Sie ihn zuerst und versuchen es dann erneut.';
-
-$string['process_triggered_event'] = 'Ein Prozess wurde ausgelöst';
-$string['process_proceeded_event'] = 'Ein Prozess wurde fortgeführt';
-$string['process_rollback_event'] = 'Ein Prozess wurde zurückgesetzt';
-
-$string['courseid'] = 'Kurs-ID';
-$string['process_errors_header'] = 'Fehlermanagement';
-$string['proceed'] = 'Fortfahren';
-$string['forselected'] = 'Für alle ausgewählten Prozesse';
-$string['noprocesserrors'] = 'Es gibt keine fehlerhaften Prozesse, die behandelt werden müssen!';
-
-$string['lifecycle_error_notify_task'] = 'Benachrichtigt die Administratoren bei Fehlern in tool_lifecycle-Prozessen.';
-$string['notifyerrorsemailsubject'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!';
-$string['notifyerrorsemailcontent'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!' . "\n" . 'Bitte besuchen Sie {$a->url}.';
-$string['notifyerrorsemailcontenthtml'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!
Bitte besuchen Sie die Übersichtsseite.';
-$string['errorbackuppath'] = "Ein Fehler ist aufgetreten beim Versuchen das Backup Verzeichnis zu erstellen.
-Ihnen fehlen wahrscheinlich die Berechtigung dazu. Bitte überprüfen Sie den Pfad unter
-Seitenadministration/Plugins/Dienstprogramme/Kurs-Lebenszyklus/Allgemein & Subplugins.";
-$string['errornobackup'] = "Es wurde kein Backup in dem angegebenen Pfad erstellt.";
-
-// Workflowoverview.
$string['workflowoverview'] = 'Workflow ansehen';
$string['workflowoverview_list_header'] = 'Details zu Workflows';
-$string['create_step'] = 'Step erstellen';
-$string['create_trigger'] = 'Trigger erstellen';
-$string['edit_step'] = 'Step bearbeiten';
-$string['edit_trigger'] = 'Trigger bearbeiten';
-$string['move_up'] = 'Nach oben bewegen';
-$string['move_down'] = 'Nach unten bewegen';
-$string['courses_triggered'] = 'Kurse insgesamt getriggered: {$a}';
-$string['courses_excluded'] = 'Kurse insgesamt ausgeschlossen: {$a}';
-$string['courses_size'] = 'Kurse insgesamt genauer betrachtet: {$a}';
-$string['details:displaytitle'] = 'Wird Lehrenden als {$a} angezeigt.';
-$string['details:rollbackdelay'] = 'Nachdem ein Kurs zurückgesetzt wird, wird er für {$a} verzögert.';
-$string['details:finishdelay'] = 'Nachdem ein Kurs einen Workflow beendet, wird er für {$a} verzögert.';
-$string['details:globaldelay_yes'] = 'Diese Verzögerungen gelten für alle Workflows.';
-$string['details:globaldelay_no'] = 'Diese Verzögerungen gelten nur für diesen Workflow.';
-$string['courses_will_be_triggered_total'] = '{$a} Kurse werden insgesamt getriggert';
-$string['courses_will_be_excluded_total'] = '{$a} Kurse werden insgesamt ausgeschlossen';
-$string['courses_will_be_triggered'] = '{$a} Kurse werden getriggert';
-$string['courses_will_be_excluded'] = '{$a} Kurse werden ausgeschlossen';
-$string['overview:trigger'] = 'Trigger';
-$string['overview:trigger_help'] = 'Ein Kurs fängt nur dann an, einen Workflow zu durchlaufen, wenn alle Trigger des Workflows dies übereinstimmend (UND-Verknüpfung) aussagen.
-In den hier genannten Zahlen werden Kurse, die verzögert werden oder sich bereits in anderen Workflows befinden, nicht mitgezählt.
-Trotzdem sind die Zahlen nur approximiert, da es sein könnte, dass die Kurse vor diesem einen anderen Workflow auslösen.';
-$string['overview:add_trigger'] = 'Trigger hinzufügen';
-$string['overview:add_trigger_help'] = 'Es kann nur eine Instanz jedes Triggertyps hinzugefügt werden.';
-
-// Create copy from existing.
-$string['create_copy'] = 'Kopie erstellen';
-$string['active'] = 'Aktiv';
-$string['deactivated'] = 'Deaktiviert';
-$string['draft'] = 'Entwurf';
diff --git a/lang/en/tool_lifecycle.php b/lang/en/tool_lifecycle.php
index 9d0bb75e..1d96728d 100644
--- a/lang/en/tool_lifecycle.php
+++ b/lang/en/tool_lifecycle.php
@@ -22,244 +22,216 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-$string['pluginname'] = 'Life Cycle';
-$string['plugintitle'] = 'Course Life Cycle';
+$string['abortdisableworkflow'] = 'Disable workflow (abort processes, maybe unsafe!)';
+$string['abortdisableworkflow_confirm'] = 'The workflow is going to be disabled and all running processes of this workflow will be aborted. Are you sure?';
+$string['abortprocesses'] = 'Abort running processes (maybe unsafe!)';
+$string['abortprocesses_confirm'] = 'All running processes of this workflow will be aborted. Are you sure?';
+$string['activateworkflow'] = 'Activate';
+$string['active'] = 'Active';
+$string['active_automatic_workflows_heading'] = 'Active automatic workflows';
+$string['active_manual_workflows_heading'] = 'Active manual workflows';
+$string['active_workflow_not_changeable'] = 'The workflow instance was already activated. Depending on the step type, some of its settings might be still editable. Changes to triggers will not affect already triggered courses.';
+$string['active_workflow_not_removeable'] = 'The workflow instance is active. It is not possible to remove it.';
+$string['active_workflows_header'] = 'Active workflows';
+$string['active_workflows_list'] = 'List active workflows';
+$string['add_new_step_instance'] = 'Add new step instance...';
+$string['add_new_trigger_instance'] = 'Add new trigger instance...';
+$string['add_workflow'] = 'Create new workflow';
+$string['adminsettings_edit_step_instance_heading'] = 'Step instance for workflow \'{$a}\'';
+$string['adminsettings_edit_trigger_instance_heading'] = 'Trigger for workflow \'{$a}\'';
+$string['adminsettings_edit_workflow_definition_heading'] = 'Workflow definition';
+$string['adminsettings_heading'] = 'Workflow settings';
+$string['adminsettings_workflow_definition_steps_heading'] = 'Workflow steps';
+$string['all_delays'] = 'All delays';
+$string['anonymous_user'] = 'Anonymous User';
+$string['apply'] = 'Apply';
+$string['backupcreated'] = 'Created at';
+$string['backupworkflow'] = 'Backup workflow';
$string['cachedef_mformdata'] = 'Caches the mform data.';
-
-$string['lifecycle:managecourses'] = 'May manage courses in tool_lifecycle';
-$string['managecourses_link'] = 'Manage courses';
-
-$string['general_config_header'] = "General & subplugins";
+$string['cannot_trigger_workflow_manually'] = 'The requested workflow could not be triggered manually.';
+$string['config_backup_path'] = 'Path of the lifecycle backup folder';
+$string['config_backup_path_desc'] = 'This settings defines the storage location of the backups created by the backup step.
+The path has to be specified as an absolute path on your server.';
$string['config_delay_duration'] = 'Default duration of a course delay';
$string['config_delay_duration_desc'] = 'This setting defines the default delay duration of a workflow
in case one of its processes is rolled back or finishes.
The delay duration determines how long a course will be excepted from being processed again in either of the cases.';
-$string['config_backup_path'] = 'Path of the lifecycle backup folder';
-$string['config_backup_path_desc'] = 'This settings defines the storage location of the backups created by the backup step.
-The path has to be specified as an absolute path on your server.';
+$string['config_showcoursecounts'] = 'Show amount of courses which will be triggered';
+$string['config_showcoursecounts_desc'] = 'The workflow overview page by default shows the amount of courses which will be
+triggered by the configured triggers which can be load heavy. Disable this option if you experience issues loading the workflow
+overview.';
+$string['course_backups_list_header'] = 'Course backups';
+$string['courseid'] = 'Course ID';
+$string['coursename'] = 'Course name';
+$string['courses_will_be_excluded'] = '{$a} Courses will be excluded';
+$string['courses_will_be_excluded_total'] = '{$a} courses will be excluded in total';
+$string['courses_will_be_triggered'] = '{$a} Courses will be triggered';
+$string['courses_will_be_triggered_total'] = '{$a} courses will be triggered in total';
+$string['create_copy'] = 'Create copy';
+$string['create_step'] = 'Create step';
+$string['create_trigger'] = 'Create trigger';
+$string['create_workflow_from_existing'] = 'Copy new workflow from existing';
+$string['date'] = 'Due date';
+$string['deactivated'] = 'Deactivated';
+$string['deactivated_workflows_list'] = 'List deactivated workflows';
+$string['deactivated_workflows_list_header'] = 'Deactivated workflows';
+$string['delayed_courses_header'] = 'Delayed courses';
+$string['delayed_for_workflow_until'] = 'Delayed for "{$a->name}" until {$a->date}';
+$string['delayed_for_workflows'] = 'Delayed for {$a} workflows';
+$string['delayed_globally'] = 'Delayed globally until {$a}';
+$string['delayed_globally_and_seperately'] = 'Delayed globally and seperately for {$a} workflows';
+$string['delayed_globally_and_seperately_for_one'] = 'Delayed globally and seperately for 1 workflow';
+$string['delays'] = 'Delays';
+$string['delays_for_workflow'] = 'Delays for "{$a}"';
+$string['delete_all_delays'] = 'Delete all delays';
+$string['delete_delay'] = 'Delete delay';
+$string['deleteworkflow'] = 'Delete workflow';
+$string['deleteworkflow_confirm'] = 'The workflow is going to be deleted. This can\'t be undone. Are you sure?';
+$string['details:displaytitle'] = 'Displayed to teachers as {$a}.';
+$string['details:finishdelay'] = 'When a course has finished the workflow, it will be delayed for {$a}.';
+$string['details:globaldelay_no'] = 'These delays apply only to this workflow.';
+$string['details:globaldelay_yes'] = 'These delays apply to all workflows.';
+$string['details:rollbackdelay'] = 'When a course is rolled back, it will be delayed for {$a}.';
+$string['disableworkflow'] = 'Disable workflow (processes keep running)';
+$string['disableworkflow_confirm'] = 'The workflow is going to be disabled. Are you sure?';
+$string['download'] = 'Download';
+$string['draft'] = 'Draft';
+$string['duplicateworkflow'] = 'Duplicate workflow';
+$string['edit_step'] = 'Edit step';
+$string['edit_trigger'] = 'Edit trigger';
+$string['editworkflow'] = 'Edit general settings';
+$string['error_wrong_trigger_selected'] = 'You tried to request a non-manual trigger.';
+$string['errorbackuppath'] = "Error while trying to create the backup directory. You might be missing the permission to do so.
+Please check your path at Site administration/Plugins/Admin tools/Life Cycle/General & subplugins/backup_path.";
+$string['errornobackup'] = "No backup was created at the specified directory, reasons unknown.";
$string['find_course_list_header'] = 'Find courses';
-$string['adminsettings_heading'] = 'Workflow settings';
-$string['active_manual_workflows_heading'] = 'Active manual workflows';
-$string['active_automatic_workflows_heading'] = 'Active automatic workflows';
-$string['see_in_workflow'] = 'See in workflow';
-$string['workflow_definition_heading'] = 'Workflow definitions';
-$string['adminsettings_edit_workflow_definition_heading'] = 'Workflow definition';
-$string['adminsettings_workflow_definition_steps_heading'] = 'Workflow steps';
-$string['adminsettings_edit_trigger_instance_heading'] = 'Trigger for workflow \'{$a}\'';
-$string['adminsettings_edit_step_instance_heading'] = 'Step instance for workflow \'{$a}\'';
-$string['add_new_step_instance'] = 'Add new step instance...';
-$string['add_new_trigger_instance'] = 'Add new trigger instance...';
-$string['step_settings_header'] = 'Specific settings of the step type';
-$string['trigger_settings_header'] = 'Specific settings of the trigger type';
-$string['general_settings_header'] = 'General settings';
$string['followedby_none'] = 'None';
+$string['force_import'] = 'Try ignoring errors and import the workflow anyway. Use this at your own risk!';
+$string['forselected'] = 'For all selected processes';
+$string['general_config_header'] = "General & subplugins";
+$string['general_settings_header'] = 'General settings';
+$string['globally'] = 'Global delays';
+$string['globally_until_date'] = 'Globally until {$a}';
+$string['interaction_success'] = 'Action successfully saved.';
$string['invalid_workflow'] = 'Invalid workflow configuration';
-$string['invalid_workflow_details'] = 'Go to details view, to create a trigger for this workflow';
-$string['active_workflow_not_changeable'] = 'The workflow instance was already activated. Depending on the step type, some of its settings might be still editable. Changes to triggers will not affect already triggered courses.';
-$string['active_workflow_not_removeable'] = 'The workflow instance is active. It is not possible to remove it.';
-$string['workflow_not_removeable'] = 'It is not possible to remove this workflow instance. Maybe it still has running processes?';
$string['invalid_workflow_cannot_be_activated'] = 'The workflow definition is invalid, thus it cannot be activated.';
-$string['trigger_does_not_exist'] = 'The requested trigger could not be found.';
-$string['cannot_trigger_workflow_manually'] = 'The requested workflow could not be triggered manually.';
-$string['error_wrong_trigger_selected'] = 'You tried to request a non-manual trigger.';
-
-$string['lifecycle_task'] = 'Run the life cycle processes';
+$string['invalid_workflow_details'] = 'Go to details view, to create a trigger for this workflow';
+$string['lastaction'] = 'Last action on';
+$string['lifecycle:managecourses'] = 'May manage courses in tool_lifecycle';
$string['lifecycle_cleanup_task'] = 'Delete old delay entries for life cycle workflows';
-
-$string['trigger_subpluginname'] = 'Subplugin name';
-$string['trigger_subpluginname_help'] = 'Step subplugin/trigger title (visible for admins only).';
+$string['lifecycle_error_notify_task'] = 'Notify the admin upon errors in tool_lifecycle processes';
+$string['lifecycle_task'] = 'Run the life cycle processes';
+$string['lifecyclestep'] = 'Process step';
+$string['lifecycletrigger'] = 'Trigger';
+$string['managecourses_link'] = 'Manage courses';
+$string['manual_trigger_process_existed'] = 'A workflow for this course already exists.';
+$string['manual_trigger_success'] = 'Workflow started successfully.';
+$string['move_down'] = 'Move down';
+$string['move_up'] = 'Move up';
+$string['name_until_date'] = '"{$a->name}" until {$a->date}';
+$string['nocoursestodisplay'] = 'There are currently no courses which require your attention!';
+$string['nointeractioninterface'] = 'No interaction interface available!';
+$string['noprocesserrors'] = 'There are no process errors to handle!';
+$string['noprocessfound'] = 'A process with the given processid could not be found!';
+$string['noremainingcoursestodisplay'] = 'There are currently no remaining courses!';
+$string['nostepfound'] = 'A step with the given stepid could not be found!';
+$string['notifyerrorsemailcontent'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!' . "\n" . 'Please review them at {$a->url}.';
+$string['notifyerrorsemailcontenthtml'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!
Please review them at the error handling overview.';
+$string['notifyerrorsemailsubject'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!';
+$string['overview:add_trigger'] = 'Add trigger';
+$string['overview:add_trigger_help'] = 'You can only add one instance of each trigger type.';
+$string['overview:trigger'] = 'Trigger';
+$string['overview:trigger_help'] = 'A course will only trigger a workflow, if all triggers agree on it (AND operation).
+Courses which are delayed, or already in another workflow are not included in the displayed counts.
+Still, these numbers are only approximates, since it could be that a course is excluded by another workflow, or will trigger another workflow before this one.';
+$string['pluginname'] = 'Life Cycle';
+$string['plugintitle'] = 'Course Life Cycle';
+$string['privacy:metadata:tool_lifecycle_action_log'] = 'A log of actions done by course managers.';
+$string['privacy:metadata:tool_lifecycle_action_log:action'] = 'Identifier of the action that was done.';
+$string['privacy:metadata:tool_lifecycle_action_log:courseid'] = 'ID of the Course the action was done for';
+$string['privacy:metadata:tool_lifecycle_action_log:processid'] = 'ID of the Process the action was done in.';
+$string['privacy:metadata:tool_lifecycle_action_log:stepindex'] = 'Index of the Step in the Workflow, the action was done for.';
+$string['privacy:metadata:tool_lifecycle_action_log:time'] = 'Time when the action was done.';
+$string['privacy:metadata:tool_lifecycle_action_log:userid'] = 'ID of the user that did the action.';
+$string['privacy:metadata:tool_lifecycle_action_log:workflowid'] = 'ID of the Workflow the action was done in.';
+$string['proceed'] = 'Proceed';
+$string['process_errors_header'] = 'Error handling';
+$string['process_proceeded_event'] = 'A process has been proceeded';
+$string['process_rollback_event'] = 'A process has been rolled back';
+$string['process_triggered_event'] = 'A process has been triggered';
+$string['restore'] = 'Restore';
+$string['restore_error_in_step'] = 'An error occurred when importing step "{$a}": ';
+$string['restore_error_in_trigger'] = 'An error occurred when importing trigger "{$a}": ';
+$string['restore_step_does_not_exist'] = 'The step {$a} is not installed, but is included in the backup file. Please installed it first and try again.';
+$string['restore_subplugins_invalid'] = 'Wrong format of the backup file. The structure of the subplugin elements is not as expected.';
+$string['restore_trigger_does_not_exist'] = 'The trigger {$a} is not installed, but is included in the backup file. Please installed it first and try again.';
+$string['restore_workflow_not_found'] = 'Wrong format of the backup file. The workflow could not be found.';
+$string['rollback'] = 'Rollback';
+$string['see_in_workflow'] = 'See in workflow';
+$string['show_delays'] = 'Kind of view';
+$string['status'] = 'Status';
+$string['step'] = 'Process step';
+$string['step_delete'] = 'Delete';
+$string['step_edit'] = 'Edit';
+$string['step_instancename'] = 'Instance name';
+$string['step_instancename_help'] = 'Step instance title (visible for admins only).';
+$string['step_settings_header'] = 'Specific settings of the step type';
+$string['step_show'] = 'Show';
+$string['step_sortindex'] = 'Up/Down';
+$string['step_subpluginname'] = 'Subplugin name';
+$string['step_subpluginname_help'] = 'Step subplugin/trigger title (visible for admins only).';
+$string['step_type'] = 'Type';
+$string['subplugintype_lifecyclestep'] = 'Step within a lifecycle process';
+$string['subplugintype_lifecyclestep_plural'] = 'Steps within a lifecycle process';
+$string['subplugintype_lifecycletrigger'] = 'Trigger for starting a lifecycle process';
+$string['subplugintype_lifecycletrigger_plural'] = 'Triggers for starting a lifecycle process';
+$string['tablecourseslog'] = 'Past actions';
+$string['tablecoursesremaining'] = 'Remaining courses';
+$string['tablecoursesrequiringattention'] = 'Courses that require your attention';
+$string['tools'] = 'Tools';
+$string['trigger'] = 'Trigger';
+$string['trigger_does_not_exist'] = 'The requested trigger could not be found.';
+$string['trigger_enabled'] = 'Enabled';
$string['trigger_instancename'] = 'Instance name';
$string['trigger_instancename_help'] = 'Trigger instance title (visible for admins only).';
-$string['trigger_enabled'] = 'Enabled';
+$string['trigger_settings_header'] = 'Specific settings of the trigger type';
$string['trigger_sortindex'] = 'Up/Down';
+$string['trigger_subpluginname'] = 'Subplugin name';
+$string['trigger_subpluginname_help'] = 'Step subplugin/trigger title (visible for admins only).';
$string['trigger_workflow'] = 'Workflow';
-
-$string['workflow'] = 'Workflow';
-$string['workflow_drafts_header'] = 'Workflow drafts';
-$string['active_workflows_header'] = 'Active workflows';
-$string['add_workflow'] = 'Create new workflow';
$string['upload_workflow'] = 'Upload workflow';
-$string['create_workflow_from_existing'] = 'Copy new workflow from existing';
-$string['workflow_title'] = 'Title';
-$string['workflow_title_help'] = 'Workflow title (visible for admins only).';
+$string['viewheading'] = 'Manage courses';
+$string['viewsteps'] = 'View workflow steps';
+$string['workflow'] = 'Workflow';
+$string['workflow_active'] = 'Active';
+$string['workflow_definition_heading'] = 'Workflow definitions';
+$string['workflow_delayforallworkflows'] = 'Delay for all workflows?';
+$string['workflow_delayforallworkflows_help'] = 'If ticked, the durations on top do not only delay the execution
+of this workflow for a course, but for all other workflows as well. Thus, until the time passes no process can be started
+for the respective course.';
$string['workflow_displaytitle'] = 'Displayed workflow title';
$string['workflow_displaytitle_help'] = 'This title is displayed to users when managing their courses.';
-$string['workflow_rollbackdelay'] = 'Delay in case of rollback';
-$string['workflow_rollbackdelay_help'] = 'If a course was rolled back within a process instance of this workflow,
-this value describes the time until a process for this combination of course and workflow can be started again.';
+$string['workflow_drafts_header'] = 'Workflow drafts';
+$string['workflow_drafts_list'] = 'List workflow drafts';
+$string['workflow_duplicate_title'] = '{$a} (Copy)';
$string['workflow_finishdelay'] = 'Delay in case of finished course';
$string['workflow_finishdelay_help'] = 'If a course has finished a process instance of this workflow,
this value describes the time until a process for this combination of course and workflow can be started again.';
-$string['workflow_delayforallworkflows'] = 'Delay for all workflows?';
-$string['workflow_delayforallworkflows_help'] = 'If ticked, the durations on top do not only delay the execution
-of this workflow for a course, but for all other workflows as well. Thus, until the time passes no process can be started
-for the respective course.';
-$string['workflow_active'] = 'Active';
+$string['workflow_is_running'] = 'Workflow is running.';
+$string['workflow_not_removeable'] = 'It is not possible to remove this workflow instance. Maybe it still has running processes?';
$string['workflow_processes'] = 'Active processes';
-$string['workflow_timeactive'] = 'Active since';
+$string['workflow_rollbackdelay'] = 'Delay in case of rollback';
+$string['workflow_rollbackdelay_help'] = 'If a course was rolled back within a process instance of this workflow,
+this value describes the time until a process for this combination of course and workflow can be started again.';
$string['workflow_sortindex'] = 'Up/Down';
-$string['workflow_tools'] = 'Actions';
-$string['viewsteps'] = 'View workflow steps';
-$string['editworkflow'] = 'Edit general settings';
-$string['backupworkflow'] = 'Backup workflow';
-$string['duplicateworkflow'] = 'Duplicate workflow';
-$string['deleteworkflow'] = 'Delete workflow';
-$string['deleteworkflow_confirm'] = 'The workflow is going to be deleted. This can\'t be undone. Are you sure?';
-$string['activateworkflow'] = 'Activate';
-$string['disableworkflow'] = 'Disable workflow (processes keep running)';
-$string['disableworkflow_confirm'] = 'The workflow is going to be disabled. Are you sure?';
-$string['abortdisableworkflow'] = 'Disable workflow (abort processes, maybe unsafe!)';
-$string['abortdisableworkflow_confirm'] = 'The workflow is going to be disabled and all running processes of this workflow will be aborted. Are you sure?';
-$string['abortprocesses'] = 'Abort running processes (maybe unsafe!)';
-$string['abortprocesses_confirm'] = 'All running processes of this workflow will be aborted. Are you sure?';
-$string['workflow_duplicate_title'] = '{$a} (Copy)';
-
-// Deactivated workflows.
-$string['deactivated_workflows_list'] = 'List deactivated workflows';
-$string['deactivated_workflows_list_header'] = 'Deactivated workflows';
+$string['workflow_started'] = 'Workflow started.';
+$string['workflow_timeactive'] = 'Active since';
$string['workflow_timedeactive'] = 'Deactivated since';
-$string['active_workflows_list'] = 'List active workflows';
-$string['workflow_drafts_list'] = 'List workflow drafts';
-
-$string['step_type'] = 'Type';
-$string['step_subpluginname'] = 'Subplugin name';
-$string['step_subpluginname_help'] = 'Step subplugin/trigger title (visible for admins only).';
-$string['step_instancename'] = 'Instance name';
-$string['step_instancename_help'] = 'Step instance title (visible for admins only).';
-$string['step_sortindex'] = 'Up/Down';
-$string['step_edit'] = 'Edit';
-$string['step_show'] = 'Show';
-$string['step_delete'] = 'Delete';
-
-$string['trigger'] = 'Trigger';
-$string['step'] = 'Process step';
-
+$string['workflow_title'] = 'Title';
+$string['workflow_title_help'] = 'Workflow title (visible for admins only).';
+$string['workflow_tools'] = 'Actions';
$string['workflow_trigger'] = 'Trigger for the workflow';
-
-$string['lifecycletrigger'] = 'Trigger';
-$string['lifecyclestep'] = 'Process step';
-
-$string['subplugintype_lifecycletrigger'] = 'Trigger for starting a lifecycle process';
-$string['subplugintype_lifecycletrigger_plural'] = 'Triggers for starting a lifecycle process';
-$string['subplugintype_lifecyclestep'] = 'Step within a lifecycle process';
-$string['subplugintype_lifecyclestep_plural'] = 'Steps within a lifecycle process';
-
-$string['nointeractioninterface'] = 'No interaction interface available!';
-$string['tools'] = 'Tools';
-$string['status'] = 'Status';
-$string['date'] = 'Due date';
-
-$string['nostepfound'] = 'A step with the given stepid could not be found!';
-$string['noprocessfound'] = 'A process with the given processid could not be found!';
-
-$string['nocoursestodisplay'] = 'There are currently no courses which require your attention!';
-$string['noremainingcoursestodisplay'] = 'There are currently no remaining courses!';
-
-$string['course_backups_list_header'] = 'Course backups';
-$string['backupcreated'] = 'Created at';
-$string['restore'] = 'Restore';
-$string['download'] = 'Download';
-
+$string['workflow_was_not_imported'] = 'The workflow was not imported!';
$string['workflownotfound'] = 'Workflow with id {$a} could not be found';
-
-// View.php.
-$string['tablecoursesrequiringattention'] = 'Courses that require your attention';
-$string['tablecoursesremaining'] = 'Remaining courses';
-$string['tablecourseslog'] = 'Past actions';
-$string['viewheading'] = 'Manage courses';
-$string['interaction_success'] = 'Action successfully saved.';
-$string['manual_trigger_success'] = 'Workflow started successfully.';
-$string['manual_trigger_process_existed'] = 'A workflow for this course already exists.';
-
-$string['coursename'] = 'Course name';
-$string['lastaction'] = 'Last action on';
-$string['anonymous_user'] = 'Anonymous User';
-
-$string['workflow_started'] = 'Workflow started.';
-$string['workflow_is_running'] = 'Workflow is running.';
-
-// Backup & Restore.
-$string['restore_workflow_not_found'] = 'Wrong format of the backup file. The workflow could not be found.';
-$string['restore_subplugins_invalid'] = 'Wrong format of the backup file. The structure of the subplugin elements is not as expected.';
-$string['restore_step_does_not_exist'] = 'The step {$a} is not installed, but is included in the backup file. Please installed it first and try again.';
-$string['restore_trigger_does_not_exist'] = 'The trigger {$a} is not installed, but is included in the backup file. Please installed it first and try again.';
-
-// Events.
-$string['process_triggered_event'] = 'A process has been triggered';
-$string['process_proceeded_event'] = 'A process has been proceeded';
-$string['process_rollback_event'] = 'A process has been rolled back';
-
-// Privacy API.
-$string['privacy:metadata:tool_lifecycle_action_log'] = 'A log of actions done by course managers.';
-$string['privacy:metadata:tool_lifecycle_action_log:processid'] = 'ID of the Process the action was done in.';
-$string['privacy:metadata:tool_lifecycle_action_log:workflowid'] = 'ID of the Workflow the action was done in.';
-$string['privacy:metadata:tool_lifecycle_action_log:courseid'] = 'ID of the Course the action was done for';
-$string['privacy:metadata:tool_lifecycle_action_log:stepindex'] = 'Index of the Step in the Workflow, the action was done for.';
-$string['privacy:metadata:tool_lifecycle_action_log:time'] = 'Time when the action was done.';
-$string['privacy:metadata:tool_lifecycle_action_log:userid'] = 'ID of the user that did the action.';
-$string['privacy:metadata:tool_lifecycle_action_log:action'] = 'Identifier of the action that was done.';
-
-// Delays.
-$string['delayed_courses_header'] = 'Delayed courses';
-$string['delete_delay'] = 'Delete delay';
-$string['globally_until_date'] = 'Globally until {$a}';
-$string['name_until_date'] = '"{$a->name}" until {$a->date}';
-$string['delayed_globally_and_seperately'] = 'Delayed globally and seperately for {$a} workflows';
-$string['delayed_globally_and_seperately_for_one'] = 'Delayed globally and seperately for 1 workflow';
-$string['delayed_globally'] = 'Delayed globally until {$a}';
-$string['delayed_for_workflow_until'] = 'Delayed for "{$a->name}" until {$a->date}';
-$string['delayed_for_workflows'] = 'Delayed for {$a} workflows';
-$string['delays'] = 'Delays';
-$string['apply'] = 'Apply';
-$string['show_delays'] = 'Kind of view';
-$string['all_delays'] = 'All delays';
-$string['globally'] = 'Global delays';
-$string['delays_for_workflow'] = 'Delays for "{$a}"';
-$string['delete_all_delays'] = 'Delete all delays';
-
-$string['courseid'] = 'Course ID';
-$string['process_errors_header'] = 'Error handling';
-$string['proceed'] = 'Proceed';
-$string['rollback'] = 'Rollback';
-$string['forselected'] = 'For all selected processes';
-$string['noprocesserrors'] = 'There are no process errors to handle!';
-
-$string['lifecycle_error_notify_task'] = 'Notify the admin upon errors in tool_lifecycle processes';
-$string['notifyerrorsemailsubject'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!';
-$string['notifyerrorsemailcontent'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!' . "\n" . 'Please review them at {$a->url}.';
-$string['notifyerrorsemailcontenthtml'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!
Please review them at the error handling overview.';
-$string['errorbackuppath'] = "Error while trying to create the backup directory. You might be missing the permission to do so.
-Please check your path at Site administration/Plugins/Admin tools/Life Cycle/General & subplugins/backup_path.";
-$string['errornobackup'] = "No backup was created at the specified directory, reasons unknown.";
-
-// Workflowoverview.
$string['workflowoverview'] = 'View workflow';
$string['workflowoverview_list_header'] = 'Details of Workflows';
-$string['create_step'] = 'Create step';
-$string['create_trigger'] = 'Create trigger';
-$string['edit_step'] = 'Edit step';
-$string['edit_trigger'] = 'Edit trigger';
-$string['move_up'] = 'Move up';
-$string['move_down'] = 'Move down';
-$string['details:displaytitle'] = 'Displayed to teachers as {$a}.';
-$string['details:rollbackdelay'] = 'When a course is rolled back, it will be delayed for {$a}.';
-$string['details:finishdelay'] = 'When a course has finished the workflow, it will be delayed for {$a}.';
-$string['details:globaldelay_yes'] = 'These delays apply to all workflows.';
-$string['details:globaldelay_no'] = 'These delays apply only to this workflow.';
-$string['courses_will_be_triggered_total'] = '{$a} courses will be triggered in total';
-$string['courses_will_be_excluded_total'] = '{$a} courses will be excluded in total';
-$string['courses_will_be_triggered'] = '{$a} Courses will be triggered';
-$string['courses_will_be_excluded'] = '{$a} Courses will be excluded';
-$string['overview:trigger'] = 'Trigger';
-$string['overview:trigger_help'] = 'A course will only trigger a workflow, if all triggers agree on it (AND operation).
-Courses which are delayed, or already in another workflow are not included in the displayed counts.
-Still, these numbers are only approximates, since it could be that a course is excluded by another workflow, or will trigger another workflow before this one.';
-$string['overview:add_trigger'] = 'Add trigger';
-$string['overview:add_trigger_help'] = 'You can only add one instance of each trigger type.';
-
-// Create copy from existing workflow.
-$string['create_copy'] = 'Create copy';
-$string['active'] = 'Active';
-$string['deactivated'] = 'Deactivated';
-$string['draft'] = 'Draft';
diff --git a/lib.php b/lib.php
index fa4532ae..072cff6c 100644
--- a/lib.php
+++ b/lib.php
@@ -32,7 +32,7 @@
* @throws moodle_exception
*/
function tool_lifecycle_extend_navigation_course($navigation, $course, $context) {
- global $PAGE;
+ global $DB, $PAGE;
// Only add this settings item on non-site course pages.
if (!$PAGE->course || $PAGE->course->id == SITEID) {
@@ -43,12 +43,23 @@ function tool_lifecycle_extend_navigation_course($navigation, $course, $context)
return null;
}
- $url = null;
- $settingnode = null;
+ $cache = cache::make('tool_lifecycle', 'application');
+ if ($cache->has('workflowactive')) {
+ $wfexists = $cache->get('workflowactive');
+ } else {
+ $wfexists = $DB->record_exists_sql("SELECT 'yes' FROM {tool_lifecycle_workflow} wf " .
+ "JOIN {tool_lifecycle_trigger} t ON wf.id = t.workflowid " .
+ "WHERE wf.timeactive IS NOT NULL AND t.subpluginname NOT IN ('sitecourse', 'delayedcourses')");
+ $cache->set('workflowactive', $wfexists);
+ }
+
+ if (!$wfexists) {
+ return null;
+ }
- $url = new moodle_url('/admin/tool/lifecycle/view.php', array(
- 'contextid' => $context->id
- ));
+ $url = new moodle_url('/admin/tool/lifecycle/view.php', [
+ 'contextid' => $context->id,
+ ]);
// Add the course life cycle link.
$linktext = get_string('managecourses_link', 'tool_lifecycle');
diff --git a/renderer.php b/renderer.php
index f17197d3..6d3db9e7 100644
--- a/renderer.php
+++ b/renderer.php
@@ -53,15 +53,11 @@ public function header($title = null) {
/**
* Renders the workflow upload form including errors, which occured during upload.
* @param \tool_lifecycle\local\form\form_upload_workflow $form
- * @param array $errors
* @throws coding_exception
*/
- public function render_workflow_upload_form($form, $errors = array()) {
+ public function render_workflow_upload_form($form) {
$this->header(get_string('adminsettings_edit_workflow_definition_heading', 'tool_lifecycle'));
- foreach ($errors as $error) {
- \core\notification::add($error, \core\notification::ERROR);
- }
- echo $form->render();
+ $form->display();
$this->footer();
}
diff --git a/restore.php b/restore.php
index 48551f0d..40ee3367 100644
--- a/restore.php
+++ b/restore.php
@@ -21,6 +21,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
require_once(__DIR__ . '/../../../config.php');
use tool_lifecycle\local\manager\backup_manager;
diff --git a/settings.php b/settings.php
index f1d37919..3f37c086 100644
--- a/settings.php
+++ b/settings.php
@@ -42,6 +42,11 @@
get_string('config_backup_path_desc', 'tool_lifecycle'),
$CFG->dataroot . DIRECTORY_SEPARATOR . 'lifecycle_backups'));
+ $settings->add(new admin_setting_configcheckbox('tool_lifecycle/showcoursecounts',
+ get_string('config_showcoursecounts', 'tool_lifecycle'),
+ get_string('config_showcoursecounts_desc', 'tool_lifecycle'),
+ 1));
+
$ADMIN->add('lifecycle_category', new admin_externalpage('tool_lifecycle_workflow_drafts',
get_string('workflow_drafts_header', 'tool_lifecycle'),
new moodle_url(\tool_lifecycle\urls::WORKFLOW_DRAFTS)));
diff --git a/step/createbackup/classes/privacy/provider.php b/step/createbackup/classes/privacy/provider.php
index 306f0a82..9fba71a4 100644
--- a/step/createbackup/classes/privacy/provider.php
+++ b/step/createbackup/classes/privacy/provider.php
@@ -34,7 +34,7 @@ class provider implements null_provider {
*
* @return string the reason
*/
- public static function get_reason() : string {
+ public static function get_reason(): string {
return 'privacy:metadata';
}
}
diff --git a/step/createbackup/db/upgrade.php b/step/createbackup/db/upgrade.php
index d1583cd7..56a1a62b 100644
--- a/step/createbackup/db/upgrade.php
+++ b/step/createbackup/db/upgrade.php
@@ -45,7 +45,7 @@ function xmldb_lifecyclestep_createbackup_upgrade($oldversion) {
foreach ($coursedeletesteps as $step) {
if (empty(settings_manager::get_settings($step->id, 'step'))) {
settings_manager::save_settings($step->id, 'step', 'createbackup',
- array($settingsname => $settingsvalue));
+ [$settingsname => $settingsvalue]);
}
}
diff --git a/step/createbackup/lang/de/lifecyclestep_createbackup.php b/step/createbackup/lang/de/lifecyclestep_createbackup.php
index 12cc46d4..285e96e2 100644
--- a/step/createbackup/lang/de/lifecyclestep_createbackup.php
+++ b/step/createbackup/lang/de/lifecyclestep_createbackup.php
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['maximumbackupspercron'] = 'Maximale Anzahl an Sicherungen per cron';
$string['pluginname'] = 'Kurssicherungs-Schritt';
$string['privacy:metadata'] = 'Dieses Subplugin speichert keine persönlichen Daten.';
-$string['maximumbackupspercron'] = 'Maximale Anzahl an Sicherungen per cron';
diff --git a/step/createbackup/lang/en/lifecyclestep_createbackup.php b/step/createbackup/lang/en/lifecyclestep_createbackup.php
index 693e7fa6..bbea16bc 100644
--- a/step/createbackup/lang/en/lifecyclestep_createbackup.php
+++ b/step/createbackup/lang/en/lifecyclestep_createbackup.php
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['maximumbackupspercron'] = 'Maximum number of backups per cron';
$string['pluginname'] = 'Create backup step';
$string['privacy:metadata'] = 'This subplugin does not store any personal data.';
-$string['maximumbackupspercron'] = 'Maximum number of backups per cron';
diff --git a/step/createbackup/lib.php b/step/createbackup/lib.php
index ae38c21c..18724439 100644
--- a/step/createbackup/lib.php
+++ b/step/createbackup/lib.php
@@ -100,9 +100,9 @@ public function get_subpluginname() {
* @return instance_setting[] containing settings keys and PARAM_TYPES
*/
public function instance_settings() {
- return array(
+ return [
new instance_setting('maximumbackupspercron', PARAM_INT, true),
- );
+ ];
}
/**
diff --git a/step/deletecourse/classes/privacy/provider.php b/step/deletecourse/classes/privacy/provider.php
index 6ab29e62..affe4e59 100644
--- a/step/deletecourse/classes/privacy/provider.php
+++ b/step/deletecourse/classes/privacy/provider.php
@@ -34,7 +34,7 @@ class provider implements null_provider {
*
* @return string the reason
*/
- public static function get_reason() : string {
+ public static function get_reason(): string {
return 'privacy:metadata';
}
}
diff --git a/step/deletecourse/db/upgrade.php b/step/deletecourse/db/upgrade.php
index c8467c5e..43560660 100644
--- a/step/deletecourse/db/upgrade.php
+++ b/step/deletecourse/db/upgrade.php
@@ -49,7 +49,7 @@ function xmldb_lifecyclestep_deletecourse_upgrade($oldversion) {
foreach ($coursedeletesteps as $step) {
if (empty(settings_manager::get_settings($step->id, 'step'))) {
settings_manager::save_settings($step->id, 'step', 'deletecourse',
- array($settingsname => $settingsvalue));
+ [$settingsname => $settingsvalue]);
}
}
diff --git a/step/deletecourse/lang/de/lifecyclestep_deletecourse.php b/step/deletecourse/lang/de/lifecyclestep_deletecourse.php
index 62c1f8fd..316d0281 100644
--- a/step/deletecourse/lang/de/lifecyclestep_deletecourse.php
+++ b/step/deletecourse/lang/de/lifecyclestep_deletecourse.php
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['deletecourse_maximumdeletionspercron'] = 'Maximale Anzahl an Kurslöschungen per cron';
$string['pluginname'] = 'Kurslöschen-Schritt';
$string['privacy:metadata'] = 'Dieses Subplugin speichert keine persönlichen Daten.';
-$string['deletecourse_maximumdeletionspercron'] = 'Maximale Anzahl an Kurslöschungen per cron';
diff --git a/step/deletecourse/lang/en/lifecyclestep_deletecourse.php b/step/deletecourse/lang/en/lifecyclestep_deletecourse.php
index 5e6f337f..90819692 100644
--- a/step/deletecourse/lang/en/lifecyclestep_deletecourse.php
+++ b/step/deletecourse/lang/en/lifecyclestep_deletecourse.php
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['deletecourse_maximumdeletionspercron'] = 'Maximum number of courses deleted per cron';
$string['pluginname'] = 'Delete course step';
$string['privacy:metadata'] = 'This subplugin does not store any personal data.';
-$string['deletecourse_maximumdeletionspercron'] = 'Maximum number of courses deleted per cron';
diff --git a/step/deletecourse/lib.php b/step/deletecourse/lib.php
index 3503f159..098f512a 100644
--- a/step/deletecourse/lib.php
+++ b/step/deletecourse/lib.php
@@ -94,9 +94,9 @@ public function get_subpluginname() {
* @return instance_setting[] containing settings keys and PARAM_TYPES
*/
public function instance_settings() {
- return array(
+ return [
new instance_setting('maximumdeletionspercron', PARAM_INT, true),
- );
+ ];
}
/**
diff --git a/step/duplicate/classes/privacy/provider.php b/step/duplicate/classes/privacy/provider.php
index 136ee7ca..b17e946e 100644
--- a/step/duplicate/classes/privacy/provider.php
+++ b/step/duplicate/classes/privacy/provider.php
@@ -34,7 +34,7 @@ class provider implements null_provider {
*
* @return string the reason
*/
- public static function get_reason() : string {
+ public static function get_reason(): string {
return 'privacy:metadata';
}
}
diff --git a/step/duplicate/db/access.php b/step/duplicate/db/access.php
index 85169b97..78e62082 100644
--- a/step/duplicate/db/access.php
+++ b/step/duplicate/db/access.php
@@ -22,17 +22,17 @@
*/
defined('MOODLE_INTERNAL') || die();
-$capabilities = array(
+$capabilities = [
- 'lifecyclestep/duplicate:enterdata' => array(
+ 'lifecyclestep/duplicate:enterdata' => [
'contextlevel' => CONTEXT_COURSE,
'captype' => 'write',
- 'archetypes' => array(
+ 'archetypes' => [
'editingteacher' => CAP_ALLOW,
- ),
- 'clonepermissionsfrom' => 'tool/lifecycle:managecourses'
- ),
-);
+ ],
+ 'clonepermissionsfrom' => 'tool/lifecycle:managecourses',
+ ],
+];
diff --git a/step/duplicate/interactionlib.php b/step/duplicate/interactionlib.php
index f8d389f8..6cece993 100644
--- a/step/duplicate/interactionlib.php
+++ b/step/duplicate/interactionlib.php
@@ -70,13 +70,13 @@ public function get_action_tools($process) {
$shortname = process_data_manager::get_process_data($process->id, $step->id, duplicate::PROC_DATA_COURSESHORTNAME);
$fullname = process_data_manager::get_process_data($process->id, $step->id, duplicate::PROC_DATA_COURSEFULLNAME);
if (!empty($fullname) && !empty($shortname)) {
- return array();
+ return [];
}
- return array(
- array('action' => self::ACTION_DUPLICATE_FORM,
+ return [
+ ['action' => self::ACTION_DUPLICATE_FORM,
'alt' => get_string('duplicate_form', 'lifecyclestep_duplicate'),
- ),
- );
+ ],
+ ];
}
/**
@@ -116,7 +116,7 @@ public function handle_interaction($process, $step, $action = 'default') {
return step_interactive_response::rollback();
}
if ($data = $form->get_submitted_data()) {
- if ($foundcourses = $DB->get_records('course', array('shortname' => $data->shortname))) {
+ if ($foundcourses = $DB->get_records('course', ['shortname' => $data->shortname])) {
foreach ($foundcourses as $foundcourse) {
$foundcoursenames[] = $foundcourse->fullname;
}
diff --git a/step/duplicate/lang/de/lifecyclestep_duplicate.php b/step/duplicate/lang/de/lifecyclestep_duplicate.php
index 39f01957..c2e3e806 100644
--- a/step/duplicate/lang/de/lifecyclestep_duplicate.php
+++ b/step/duplicate/lang/de/lifecyclestep_duplicate.php
@@ -22,14 +22,14 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['action_new_course_data'] = '{$a} hat neuen Kursnamen eingegeben';
+$string['duplicate:enterdata'] = 'Daten für Kursduplikation eingeben';
+$string['duplicate_course_header'] = 'Kurs duplizieren';
+$string['duplicate_form'] = 'Daten eingeben';
$string['pluginname'] = 'Kurs-Duplizieren-Schritt';
$string['privacy:metadata'] = 'Dieses Subplugin speichert keine persönlichen Daten.';
-$string['duplicate_form'] = 'Daten eingeben';
-$string['duplicate_course_header'] = 'Kurs duplizieren';
$string['status_message_duplication'] = 'Duplizierter Kurs wird bald verfügbar sein.';
$string['status_message_form'] = 'Zusätzliche Informationen benötigt';
-$string['action_new_course_data'] = '{$a} hat neuen Kursnamen eingegeben';
-$string['duplicate:enterdata'] = 'Daten für Kursduplikation eingeben';
diff --git a/step/duplicate/lang/en/lifecyclestep_duplicate.php b/step/duplicate/lang/en/lifecyclestep_duplicate.php
index b71b5a15..bf15ef60 100644
--- a/step/duplicate/lang/en/lifecyclestep_duplicate.php
+++ b/step/duplicate/lang/en/lifecyclestep_duplicate.php
@@ -22,14 +22,14 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['action_new_course_data'] = '{$a} supplied new course name';
+$string['duplicate:enterdata'] = 'Enter data for course duplication';
+$string['duplicate_course_header'] = 'Duplicate course';
+$string['duplicate_form'] = 'Enter data';
$string['pluginname'] = 'Duplicate step';
$string['privacy:metadata'] = 'This subplugin does not store any personal data.';
-$string['duplicate_form'] = 'Enter data';
-$string['duplicate_course_header'] = 'Duplicate course';
$string['status_message_duplication'] = 'Duplicated course will be available shortly.';
$string['status_message_form'] = 'Additional information required';
-$string['action_new_course_data'] = '{$a} supplied new course name';
-$string['duplicate:enterdata'] = 'Enter data for course duplication';
diff --git a/step/duplicate/lib.php b/step/duplicate/lib.php
index 201c997d..d730b8df 100644
--- a/step/duplicate/lib.php
+++ b/step/duplicate/lib.php
@@ -71,7 +71,7 @@ public function process_course($processid, $instanceid, $course) {
$shortname,
$course->category,
$course->visible,
- array());
+ []);
} catch (\moodle_exception $e) {
if ($e->getCode() == 'shortnametaken') {
process_data_manager::set_process_data($processid, $instanceid, self::PROC_DATA_COURSESHORTNAME, '');
@@ -130,18 +130,18 @@ public function duplicate_course($courseid, $fullname, $shortname, $categoryid,
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
// Parameter validation.
- $params = array(
+ $params = [
'courseid' => $courseid,
'fullname' => $fullname,
'shortname' => $shortname,
'categoryid' => $categoryid,
'visible' => $visible,
- 'options' => $options
- );
+ 'options' => $options,
+ ];
// Context validation.
- if (! ($course = $DB->get_record('course', array('id' => $params['courseid'])))) {
+ if (! ($course = $DB->get_record('course', ['id' => $params['courseid']]))) {
throw new \moodle_exception('invalidcourseid', 'error');
}
@@ -151,7 +151,7 @@ public function duplicate_course($courseid, $fullname, $shortname, $categoryid,
// Course to be duplicated.
$coursecontext = \context_course::instance($course->id);
- $backupdefaults = array(
+ $backupdefaults = [
'activities' => 1,
'blocks' => 1,
'filters' => 1,
@@ -161,10 +161,10 @@ public function duplicate_course($courseid, $fullname, $shortname, $categoryid,
'comments' => 0,
'userscompletion' => 0,
'logs' => 0,
- 'grade_histories' => 0
- );
+ 'grade_histories' => 0,
+ ];
- $backupsettings = array();
+ $backupsettings = [];
// Check for backup and restore options.
if (!empty($params['options'])) {
foreach ($params['options'] as $option) {
@@ -172,7 +172,7 @@ public function duplicate_course($courseid, $fullname, $shortname, $categoryid,
// Strict check for a correct value (allways 1 or 0, true or false).
$value = clean_param($option['value'], PARAM_INT);
- if ($value !== 0 and $value !== 1) {
+ if ($value !== 0 && $value !== 1) {
throw new \moodle_exception('invalidextparam', 'webservice', '', $option['name']);
}
@@ -197,7 +197,7 @@ public function duplicate_course($courseid, $fullname, $shortname, $categoryid,
}
// Check if the shortname is used.
- if ($foundcourses = $DB->get_records('course', array('shortname' => $shortname))) {
+ if ($foundcourses = $DB->get_records('course', ['shortname' => $shortname])) {
foreach ($foundcourses as $foundcourse) {
$foundcoursenames[] = $foundcourse->fullname;
}
@@ -272,7 +272,7 @@ public function duplicate_course($courseid, $fullname, $shortname, $categoryid,
$rc->execute_plan();
$rc->destroy();
- $course = $DB->get_record('course', array('id' => $newcourseid), '*', MUST_EXIST);
+ $course = $DB->get_record('course', ['id' => $newcourseid], '*', MUST_EXIST);
$course->fullname = $params['fullname'];
$course->shortname = $params['shortname'];
$course->visible = $params['visible'];
diff --git a/step/email/classes/privacy/provider.php b/step/email/classes/privacy/provider.php
index afbcb511..a41ad4e4 100644
--- a/step/email/classes/privacy/provider.php
+++ b/step/email/classes/privacy/provider.php
@@ -52,7 +52,7 @@ public static function get_metadata(collection $collection): collection {
[
'touser' => 'privacy:metadata:lifecyclestep_email:touser',
'courseid' => 'privacy:metadata:lifecyclestep_email:courseid',
- 'instanceid' => 'privacy:metadata:lifecyclestep_email:instanceid'
+ 'instanceid' => 'privacy:metadata:lifecyclestep_email:instanceid',
],
'privacy:metadata:lifecyclestep_email:summary'
);
@@ -133,7 +133,7 @@ public static function delete_data_for_users(approved_userlist $userlist): void
$DB->delete_records('lifecyclestep_email', ['touser' => $userid]);
} else if ($userlist->get_context() instanceof context_course) {
$DB->delete_records('lifecyclestep_email', ['touser' => $userid,
- 'courseid' => $userlist->get_context()->instanceid]);
+ 'courseid' => $userlist->get_context()->instanceid, ]);
}
}
}
diff --git a/step/email/db/access.php b/step/email/db/access.php
index 7c33a548..3ec76d81 100644
--- a/step/email/db/access.php
+++ b/step/email/db/access.php
@@ -22,20 +22,20 @@
*/
defined('MOODLE_INTERNAL') || die();
-$capabilities = array(
+$capabilities = [
- 'lifecyclestep/email:preventdeletion' => array(
+ 'lifecyclestep/email:preventdeletion' => [
'contextlevel' => CONTEXT_COURSE,
'captype' => 'write',
- 'archetypes' => array(
+ 'archetypes' => [
'manager' => CAP_PREVENT,
'editingteacher' => CAP_ALLOW,
'teacher' => CAP_PREVENT,
'students' => CAP_PREVENT,
- ),
- 'clonepermissionsfrom' => 'tool/lifecycle:managecourses'
- ),
-);
+ ],
+ 'clonepermissionsfrom' => 'tool/lifecycle:managecourses',
+ ],
+];
diff --git a/step/email/interactionlib.php b/step/email/interactionlib.php
index 1085e128..8d71b69b 100644
--- a/step/email/interactionlib.php
+++ b/step/email/interactionlib.php
@@ -67,11 +67,11 @@ public function get_relevant_capability() {
* @throws \coding_exception
*/
public function get_action_tools($process) {
- return array(
- array('action' => self::ACTION_KEEP,
+ return [
+ ['action' => self::ACTION_KEEP,
'alt' => get_string('keep_course', 'lifecyclestep_email'),
- ),
- );
+ ],
+ ];
}
/**
diff --git a/step/email/lang/de/lifecyclestep_email.php b/step/email/lang/de/lifecyclestep_email.php
index 82e8115c..b0fab933 100644
--- a/step/email/lang/de/lifecyclestep_email.php
+++ b/step/email/lang/de/lifecyclestep_email.php
@@ -22,35 +22,34 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['pluginname'] = 'Email-Schritt';
-
-$string['email_responsetimeout'] = 'Zeit, die der Nutzer hat, um zu reagieren';
-$string['email_subject'] = 'Betreffvorlage';
-$emailplaceholdersnohtml = '
' . 'Sie können die folgenden Platzhalter benutzen:'
- . '
' . 'Vorname des Empfängers: ##firstname##'
- . '
' . 'Nachname des Empfängers: ##lastname##'
- . '
' . 'Link zur Antwortseite: ##link##'
- . '
' . 'Betroffene Kurse: ##courses##'
- . '
' . 'Sie können die folgenden Platzhalter benutzen:' +$string['email_content_help'] = 'Stellen Sie die Vorlage für Emails ein. (in Klartext, alternativ können Sie auch die HTML-Vorlage unten einstellen.)' . '
' . 'Sie können die folgenden Platzhalter benutzen:'
+ . '
' . 'Vorname des Empfängers: ##firstname##'
+ . '
' . 'Nachname des Empfängers: ##lastname##'
+ . '
' . 'Link zur Antwortseite: ##link##'
+ . '
' . 'Betroffene Kurse: ##courses##'
+ . '
' . 'Sie können die folgenden Platzhalter benutzen:'
. '
' . 'Vorname des Empfängers: ##firstname##'
. '
' . 'Nachname des Empfängers: ##lastname##'
. '
' . 'Link zur Antwortseite: ##link-html##'
. '
' . 'Betroffene Kurse: ##courses-html##'
. '
' . 'Sie können die folgenden Platzhalter benutzen:'
+ . '
' . 'Vorname des Empfängers: ##firstname##'
+ . '
' . 'Nachname des Empfängers: ##lastname##'
+ . '
' . 'Link zur Antwortseite: ##link##'
+ . '
' . 'Betroffene Kurse: ##courses##'
+ . '
' . 'You can use the following placeholders:'
- . '
' . 'First name of recipient: ##firstname##'
- . '
' . 'Last name of recipient: ##lastname##'
- . '
' . 'Link to response page: ##link##'
- . '
' . 'Impacted courses: ##courses##'
- . '
' . 'You can use the following placeholders:'
- . '
' . 'First name of recipient: ##firstname##'
- . '
' . 'Last name of recipient: ##lastname##'
- . '
' . 'Link to response page: ##link-html##'
- . '
' . 'Impacted courses: ##courses-html##'
- . '
' . 'You can use the following placeholders:'
+ . '
' . 'First name of recipient: ##firstname##'
+ . '
' . 'Last name of recipient: ##lastname##'
+ . '
' . 'Link to response page: ##link##'
+ . '
' . 'Impacted courses: ##courses##'
+ . '
' . 'You can use the following placeholders:'
+ . '
' . 'First name of recipient: ##firstname##'
+ . '
' . 'Last name of recipient: ##lastname##'
+ . '
' . 'Link to response page: ##link-html##'
+ . '
' . 'Impacted courses: ##courses-html##'
+ . '
' . 'You can use the following placeholders:'
+ . '
' . 'First name of recipient: ##firstname##'
+ . '
' . 'Last name of recipient: ##lastname##'
+ . '
' . 'Link to response page: ##link##'
+ . '
' . 'Impacted courses: ##courses##'
+ . '