Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wwu branch #219

Merged
merged 31 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0318800
Removed ,
NinaHerrmann Mar 20, 2023
1c048dc
CI: Update for Moodle 4.2
justusdieckmann Apr 27, 2023
9f38377
Workflow backup: Do not save attributes when they are null
justusdieckmann Apr 27, 2023
0403483
Bump version
justusdieckmann May 2, 2023
053d163
MBS-7377: Fix workflowoverview for big instances
PhMemmel Jan 31, 2023
ab2138c
Fix wrong calculation of courses counts in template context
PhMemmel May 19, 2023
b9447ab
Merge pull request #171 from PhMemmel/MBS-7377-Fix_workflowoverview_f…
justusdieckmann May 20, 2023
160bc68
Merge pull request #177 from learnweb/update/m42
NinaHerrmann May 23, 2023
8e08f2d
fix upload workflow (#185)
NinaHerrmann Jul 7, 2023
ddb70d8
Add check if process exists. (#191)
melanietreitinger Dec 4, 2023
ff6e322
Update README.md
NinaHerrmann Dec 20, 2023
38d6dc7
Improve help text for integration of icons (manual trigger) (#193)
KerstinSc Jan 16, 2024
421cc45
Update for Moodle 4.3 (#190)
justusdieckmann Feb 20, 2024
a1166ed
Hide menu when there is no manual workflow (#195)
justusdieckmann Feb 20, 2024
2a33a60
Fix step and trigger reordering: only change the relevant workflow (#…
olivabigyo Mar 14, 2024
f1ef4a6
Reorder the remaining active workflows when disabling a workflow (#201)
olivabigyo Mar 14, 2024
33cbd05
Show menu entry when a manual or automatic workflow is active (#199)
justusdieckmann Mar 14, 2024
920d1f9
Check backup consistency before importing workflow (#196)
justusdieckmann Apr 26, 2024
0099ef6
CI: Update for Moodle 4.4
justusdieckmann Mar 22, 2024
f2181c4
Codestyle PHPCBF
justusdieckmann Mar 22, 2024
85a8755
Sort strings in lang files alphabetically
justusdieckmann Apr 4, 2024
28ba40a
Fix sortindex gaps in upgrade step
justusdieckmann Apr 24, 2024
3c74651
Bump version
justusdieckmann Apr 23, 2024
7c986c9
The columns in active_manual_workflows_table shouldn't be sortable
justusdieckmann Apr 26, 2024
ba1dc92
Merge pull request #206 from learnweb/fix/manual-workflow-table-sort
justusdieckmann Apr 26, 2024
42edc87
Merge pull request #204 from learnweb/update/m404
justusdieckmann Apr 26, 2024
e2ba531
Shell escape the release notes in the release workflow (#207)
NinaHerrmann May 2, 2024
ee73f9b
Fix mustache
justusdieckmann May 8, 2024
bd2aca6
Merge pull request #210 from learnweb/fix/mustache
justusdieckmann May 13, 2024
05ff0e2
added mtrace statement for logging failed mails (#214)
NinaHerrmann Jun 11, 2024
95a4b22
Shell escape release workflow for realsies this time (#208)
justusdieckmann Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 28 additions & 49 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:

strategy:
matrix:
php: ['8.0']
moodle-branch: ['MOODLE_401_STABLE']
php: ['8.2']
moodle-branch: ['MOODLE_404_STABLE']
database: ['pgsql']

steps:
- name: Start PostgreSQL
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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
11 changes: 6 additions & 5 deletions .github/workflows/moodle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
============
Expand All @@ -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
=========
Expand Down
1 change: 1 addition & 0 deletions activeprocesses.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion activeworkflows.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
10 changes: 5 additions & 5 deletions classes/event/process_proceeded.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 5 additions & 5 deletions classes/event/process_rollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 5 additions & 5 deletions classes/event/process_triggered.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
20 changes: 15 additions & 5 deletions classes/local/backup/backup_lifecycle_workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand All @@ -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();
Expand All @@ -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();
Expand Down
Loading
Loading