From 49c983579b0209d9fe65dc8ce35c63b7beb58276 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sat, 11 Mar 2023 21:43:23 +0100 Subject: [PATCH 1/7] Make codechecker happy again --- CHANGES.md | 1 + locallib.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a0d6a44..30eee4f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2023-03-11 - Make codechecker happy again * 2022-11-28 - Updated Moodle Plugin CI to latest upstream recommendations ### v4.0-r2 diff --git a/locallib.php b/locallib.php index 69672de..52c804c 100644 --- a/locallib.php +++ b/locallib.php @@ -352,7 +352,7 @@ function local_bulkenrol_users($localbulkenrolkey) { $id = $plugin->add_instance($course, $fields); $enrolinstance = $DB->get_record('enrol', array('id' => $id)); - $enrolinstance->expirynotify = $plugin->get_config('expirynotify'); + $enrolinstance->expirynotify = $plugin->get_config('expirynotify'); $enrolinstance->expirythreshold = $plugin->get_config('expirythreshold'); $enrolinstance->roleid = $plugin->get_config('roleid'); $enrolinstance->timemodified = time(); From 5a841e433147ae4a9a69e47622dfc2074571d2ae Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sun, 12 Mar 2023 10:34:37 +0100 Subject: [PATCH 2/7] Tests: Fix a Behat test which broke after Moodle core upstream changes --- CHANGES.md | 1 + tests/behat/local_bulkenrol_groups.feature | 56 +++++++------- tests/behat/local_bulkenrol_users.feature | 86 +++++++++++----------- 3 files changed, 72 insertions(+), 71 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 30eee4f..fa38554 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2023-03-12 - Tests: Fix a Behat test which broke after Moodle core upstream changes * 2023-03-11 - Make codechecker happy again * 2022-11-28 - Updated Moodle Plugin CI to latest upstream recommendations diff --git a/tests/behat/local_bulkenrol_groups.feature b/tests/behat/local_bulkenrol_groups.feature index 16feac4..0fea443 100644 --- a/tests/behat/local_bulkenrol_groups.feature +++ b/tests/behat/local_bulkenrol_groups.feature @@ -9,11 +9,11 @@ Feature: Using the local_bulkenrol plugin for group management | fullname | shortname | format | | Course 1 | C1 | topics | And the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | 1 | teacher1@example.com | - | student1 | Student | 1 | student1@example.com | - | student2 | Student | 2 | student2@example.com | - | student3 | Student | 3 | student3@example.com | + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + | student2 | Student | 2 | student2@example.com | + | student3 | Student | 3 | student3@example.com | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | @@ -56,16 +56,16 @@ Feature: Using the local_bulkenrol plugin for group management | Group 2 | Group already exists | | Group 3 | Group already exists | And the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | Group membership | Group membership | - | student1@example.com | Student | 1 | User will be enrolled | Group 1 | User will be added to group | - | student2@example.com | Student | 2 | User will be enrolled | Group 2 | User will be added to group | - | student3@example.com | Student | 3 | User will be enrolled | Group 3 | User will be added to group | + | Email address | First name | Last name | User enrolment | Group membership | Group membership | + | student1@example.com | Student | 1 | User will be enrolled | Group 1 | User will be added to group | + | student2@example.com | Student | 2 | User will be enrolled | Group 2 | User will be added to group | + | student3@example.com | Student | 3 | User will be enrolled | Group 3 | User will be added to group | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | Groups | - | student1@example.com | Student | 1 | Student | Group 1 | - | student2@example.com | Student | 2 | Student | Group 2 | - | student3@example.com | Student | 3 | Student | Group 3 | + | Email address | First name | Last name | Roles | Groups | + | student1@example.com | Student | 1 | Student | Group 1 | + | student2@example.com | Student | 2 | Student | Group 2 | + | student3@example.com | Student | 3 | Student | Group 3 | Scenario: Bulk enrol students into the course with students already enrolled and who only have to be added to (existing) groups Given the following "course enrolments" exist: @@ -93,14 +93,14 @@ Feature: Using the local_bulkenrol plugin for group management | Group 1 | Group already exists | | Group 2 | Group already exists | And the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | Group membership | Group membership | - | student1@example.com | Student | 1 | User is already enrolled | Group 1 | User will be added to group | - | student2@example.com | Student | 2 | User is already enrolled | Group 2 | User will be added to group | + | Email address | First name | Last name | User enrolment | Group membership | Group membership | + | student1@example.com | Student | 1 | User is already enrolled | Group 1 | User will be added to group | + | student2@example.com | Student | 2 | User is already enrolled | Group 2 | User will be added to group | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | Groups | - | student1@example.com | Student | 1 | Student | Group 1 | - | student2@example.com | Student | 2 | Student | Group 2 | + | Email address | First name | Last name | Roles | Groups | + | student1@example.com | Student | 1 | Student | Group 1 | + | student2@example.com | Student | 2 | Student | Group 2 | Scenario: Bulk enrol students into the course with students already enrolled and who are also a member of the given (existing) groups And the following "course enrolments" exist: @@ -132,14 +132,14 @@ Feature: Using the local_bulkenrol plugin for group management | Group 1 | Group already exists | | Group 2 | Group already exists | And the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | Group membership | Group membership | - | student1@example.com | Student | 1 | User is already enrolled | Group 1 | User is already group member | - | student2@example.com | Student | 2 | User is already enrolled | Group 2 | User is already group member | + | Email address | First name | Last name | User enrolment | Group membership | Group membership | + | student1@example.com | Student | 1 | User is already enrolled | Group 1 | User is already group member | + | student2@example.com | Student | 2 | User is already enrolled | Group 2 | User is already group member | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | Groups | - | student1@example.com | Student | 1 | Student | Group 1 | - | student2@example.com | Student | 2 | Student | Group 2 | + | Email address | First name | Last name | Roles | Groups | + | student1@example.com | Student | 1 | Student | Group 1 | + | student2@example.com | Student | 2 | Student | Group 2 | Scenario: Bulk enrol students into the course and create groups if needed Given the following "groups" exist: @@ -163,6 +163,6 @@ Feature: Using the local_bulkenrol plugin for group management | Group 2 | Group will be created | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | Groups | - | student1@example.com | Student | 1 | Student | Group 1 | - | student2@example.com | Student | 2 | Student | Group 2 | + | Email address | First name | Last name | Roles | Groups | + | student1@example.com | Student | 1 | Student | Group 1 | + | student2@example.com | Student | 2 | Student | Group 2 | diff --git a/tests/behat/local_bulkenrol_users.feature b/tests/behat/local_bulkenrol_users.feature index e6c1d83..69fb7a6 100644 --- a/tests/behat/local_bulkenrol_users.feature +++ b/tests/behat/local_bulkenrol_users.feature @@ -9,11 +9,11 @@ Feature: Using the local_bulkenrol plugin for user enrolments | fullname | shortname | format | | Course 1 | C1 | topics | And the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | 1 | teacher1@example.com | - | student1 | Student | 1 | student1@example.com | - | student2 | Student | 2 | student2@example.com | - | student3 | Student | 3 | student3@example.com | + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + | student2 | Student | 2 | student2@example.com | + | student3 | Student | 3 | student3@example.com | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | @@ -46,19 +46,19 @@ Feature: Using the local_bulkenrol plugin for user enrolments """ And I click on "Enrol users" "button" Then the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | - | student1@example.com | Student | 1 | User will be enrolled | - | student2@example.com | Student | 2 | User will be enrolled | - | student3@example.com | Student | 3 | User will be enrolled | + | Email address | First name | Last name | User enrolment | + | student1@example.com | Student | 1 | User will be enrolled | + | student2@example.com | Student | 2 | User will be enrolled | + | student3@example.com | Student | 3 | User will be enrolled | And the following should exist in the "localbulkenrol_enrolinfo" table: - | Enrolment method | Assigned role | - | Self enrolment | Student | + | Enrolment method | Assigned role | + | Self enrolment | Student | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | - | student1@example.com | Student | 1 | Student | - | student2@example.com | Student | 2 | Student | - | student3@example.com | Student | 3 | Student | + | Email address | First name | Last name | Roles | + | student1@example.com | Student | 1 | Student | + | student2@example.com | Student | 2 | Student | + | student3@example.com | Student | 3 | Student | And "div[data-fullname='Student 1'][data-enrolinstancename='Self enrolment (Student)'][data-status='Active']" "css_element" should exist Scenario: Bulk enrol students into the course who are not enrolled yet with authentication method manual @@ -74,19 +74,19 @@ Feature: Using the local_bulkenrol plugin for user enrolments """ And I click on "Enrol users" "button" Then the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | - | student1@example.com | Student | 1 | User will be enrolled | - | student2@example.com | Student | 2 | User will be enrolled | - | student3@example.com | Student | 3 | User will be enrolled | + | Email address | First name | Last name | User enrolment | + | student1@example.com | Student | 1 | User will be enrolled | + | student2@example.com | Student | 2 | User will be enrolled | + | student3@example.com | Student | 3 | User will be enrolled | And the following should exist in the "localbulkenrol_enrolinfo" table: | Enrolment method | Assigned role | | Manual enrolments | Student | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | - | student1@example.com | Student | 1 | Student | - | student2@example.com | Student | 2 | Student | - | student3@example.com | Student | 3 | Student | + | Email address | First name | Last name | Roles | + | student1@example.com | Student | 1 | Student | + | student2@example.com | Student | 2 | Student | + | student3@example.com | Student | 3 | Student | And "div[data-fullname='Student 1'][data-enrolinstancename='Manual enrolments'][data-status='Active']" "css_element" should exist Scenario: Bulk enrol users into the course who are not enrolled yet with role teacher @@ -108,19 +108,19 @@ Feature: Using the local_bulkenrol plugin for user enrolments """ And I click on "Enrol users" "button" Then the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | - | student1@example.com | Student | 1 | User will be enrolled | - | student2@example.com | Student | 2 | User will be enrolled | - | student3@example.com | Student | 3 | User will be enrolled | + | Email address | First name | Last name | User enrolment | + | student1@example.com | Student | 1 | User will be enrolled | + | student2@example.com | Student | 2 | User will be enrolled | + | student3@example.com | Student | 3 | User will be enrolled | And the following should exist in the "localbulkenrol_enrolinfo" table: | Enrolment method | Assigned role | | Manual enrolments | Teacher | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | - | student1@example.com | Student | 1 | Teacher | - | student2@example.com | Student | 2 | Teacher | - | student3@example.com | Student | 3 | Teacher | + | Email address | First name | Last name | Roles | + | student1@example.com | Student | 1 | Teacher | + | student2@example.com | Student | 2 | Teacher | + | student3@example.com | Student | 3 | Teacher | And "div[data-fullname='Student 1'][data-enrolinstancename='Manual enrolments'][data-status='Active']" "css_element" should exist Scenario: Bulk enrol students into the course with students already enrolled @@ -139,16 +139,16 @@ Feature: Using the local_bulkenrol plugin for user enrolments """ And I click on "Enrol users" "button" Then the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | - | student1@example.com | Student | 1 | User is already enrolled | - | student2@example.com | Student | 2 | User will be enrolled | - | student3@example.com | Student | 3 | User will be enrolled | + | Email address | First name | Last name | User enrolment | + | student1@example.com | Student | 1 | User is already enrolled | + | student2@example.com | Student | 2 | User will be enrolled | + | student3@example.com | Student | 3 | User will be enrolled | And I click on "Enrol users" "button" Then the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | - | student1@example.com | Student | 1 | Student | - | student2@example.com | Student | 2 | Student | - | student3@example.com | Student | 3 | Student | + | Email address | First name | Last name | Roles | + | student1@example.com | Student | 1 | Student | + | student2@example.com | Student | 2 | Student | + | student3@example.com | Student | 3 | Student | Scenario: Respect existing self enrolments during bulk enrol Given I log in as "admin" @@ -172,12 +172,12 @@ Feature: Using the local_bulkenrol plugin for user enrolments """ And I click on "Enrol users" "button" And the following should exist in the "localbulkenrol_enrolusers" table: - | Email address | First name | Surname | User enrolment | - | student1@example.com | Student | 1 | User is already enrolled | + | Email address | First name | Last name | User enrolment | + | student1@example.com | Student | 1 | User is already enrolled | And I click on "Enrol users" "button" And the following should exist in the "participants" table: - | Email address | First name | Surname | Roles | - | student1@example.com | Student | 1 | Student | + | Email address | First name | Last name | Roles | + | student1@example.com | Student | 1 | Student | Then "div[data-fullname='Student 1'][data-enrolinstancename='Manual enrolments'] a[data-action=showdetails]" "css_element" should not exist And "div[data-fullname='Student 1'][data-enrolinstancename='Self enrolment'] a[data-action=showdetails]" "css_element" should exist From e2faca35801620bc433a73423c9d08aecae8fe85 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Wed, 26 Apr 2023 21:03:23 +0200 Subject: [PATCH 3/7] Add a missing setting to README.md --- CHANGES.md | 1 + README.md | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index fa38554..9a3c40a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2023-04-26 - Add a missing setting to README.md * 2023-03-12 - Tests: Fix a Behat test which broke after Moodle core upstream changes * 2023-03-11 - Make codechecker happy again * 2022-11-28 - Updated Moodle Plugin CI to latest upstream recommendations diff --git a/README.md b/README.md index 45a9657..f135269 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,14 @@ After installing the plugin, it does not do anything to Moodle yet. To configure the plugin and its behaviour, please visit: Site administration -> Plugins -> Enrolments -> User bulk enrolment -There, you find only one setting: +There, you find two settings: ### 1. Enrolment plugin The enrolment method to be used to bulk enrol the users. If the configured enrolment method is not active / added in the course when the users are bulk-enrolled, it is automatically added / activated. +### 2. Role +The role to be used to bulk enrol the users. + Capabilities ------------ From 64ec49eacb72a8c0589cfb15373554d874910c81 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Wed, 26 Apr 2023 21:10:20 +0200 Subject: [PATCH 4/7] Allow teachers to configure the navigation node placement --- CHANGES.md | 1 + README.md | 3 + lang/en/local_bulkenrol.php | 5 ++ lib.php | 24 +++++++- settings.php | 17 ++++++ tests/behat/local_bulkenrol_groups.feature | 5 +- .../behat/local_bulkenrol_navigation.feature | 57 +++++++++++++++++++ tests/behat/local_bulkenrol_users.feature | 5 +- version.php | 2 +- 9 files changed, 111 insertions(+), 8 deletions(-) create mode 100644 tests/behat/local_bulkenrol_navigation.feature diff --git a/CHANGES.md b/CHANGES.md index 9a3c40a..dbe5f26 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2023-04-26 - Allow teachers to configure the navigation node placement. * 2023-04-26 - Add a missing setting to README.md * 2023-03-12 - Tests: Fix a Behat test which broke after Moodle core upstream changes * 2023-03-11 - Make codechecker happy again diff --git a/README.md b/README.md index f135269..574deb2 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,9 @@ The enrolment method to be used to bulk enrol the users. If the configured enrol ### 2. Role The role to be used to bulk enrol the users. +### 3. Navigation node placement +The location where the navigation node for this functionality will be added within a course. + Capabilities ------------ diff --git a/lang/en/local_bulkenrol.php b/lang/en/local_bulkenrol.php index ed36989..c1ba815 100644 --- a/lang/en/local_bulkenrol.php +++ b/lang/en/local_bulkenrol.php @@ -68,3 +68,8 @@ $string['user_groups_already'] = 'User is already group member'; $string['parameter_empty'] = 'Parameter empty'; $string['type_enrol'] = 'Enrolment method'; +$string['navigation'] = 'Navigation node placement'; +$string['navigation_desc'] = 'The location where the navigation node for user bulk enrolment will be added within a course.'; +$string['nav_course'] = 'Navigation node in course navigation'; +$string['nav_participants'] = 'Navigation node in participants page jump menu'; +$string['nav_both'] = 'Navigation node both in participants page jump menu and in course navigation'; diff --git a/lib.php b/lib.php index de2bc8e..63c1c02 100644 --- a/lib.php +++ b/lib.php @@ -22,6 +22,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +define('LOCALBULKENROL_NAV_COURSE', 'navcourse'); +define('LOCALBULKENROL_NAV_PARTICIPANTS', 'navpart'); +define('LOCALBULKENROL_NAV_BOTH', 'navboth'); + /** * This function extends the course navigation with the bulkenrol item * @@ -31,13 +35,27 @@ */ function local_bulkenrol_extend_navigation_course($navigation, $course, $context) { if (has_capability('local/bulkenrol:enrolusers', $context)) { + // Create the navigation node. $url = new moodle_url('/local/bulkenrol/index.php', array('id' => $course->id)); $bulkenrolnode = navigation_node::create(get_string('pluginname', 'local_bulkenrol'), $url, navigation_node::TYPE_SETTING, null, 'local_bulkenrol', new pix_icon('i/users', '')); - $usersnode = $navigation->get('users'); - if (isset($bulkenrolnode) && !empty($usersnode)) { - $usersnode->add_node($bulkenrolnode); + // Get the navigation node placement setting. + $navigationplacement = get_config('local_bulkenrol', 'navigation'); + + // If the admin wanted to add the navigation node to the participants page jump menu. + if ($navigationplacement == LOCALBULKENROL_NAV_PARTICIPANTS || $navigationplacement == LOCALBULKENROL_NAV_BOTH) { + $usersnode = $navigation->get('users'); + if (isset($bulkenrolnode) && !empty($usersnode)) { + $usersnode->add_node($bulkenrolnode); + } + } + + // If the admin wanted to add the navigation node to the course navigation. + if ($navigationplacement == LOCALBULKENROL_NAV_COURSE || $navigationplacement == LOCALBULKENROL_NAV_BOTH) { + if (isset($bulkenrolnode)) { + $navigation->add_node($bulkenrolnode); + } } } } diff --git a/settings.php b/settings.php index 166df67..c79c7fe 100644 --- a/settings.php +++ b/settings.php @@ -24,6 +24,9 @@ defined('MOODLE_INTERNAL') || die; +// Require library. +require_once($CFG->dirroot.'/local/bulkenrol/lib.php'); + if ($hassiteconfig) { $settings = new admin_settingpage('local_bulkenrol', get_string('pluginname', 'local_bulkenrol', null, true)); @@ -74,6 +77,20 @@ $roleoptions) ); unset($roleoptions); + + // Create navigation node placement widget. + $navigationoptions = array(LOCALBULKENROL_NAV_COURSE => get_string('nav_course', 'local_bulkenrol'), + LOCALBULKENROL_NAV_PARTICIPANTS => get_string('nav_participants', 'local_bulkenrol'), + LOCALBULKENROL_NAV_BOTH => get_string('nav_both', 'local_bulkenrol')); + $settings->add( + new admin_setting_configselect( + 'local_bulkenrol/navigation', + get_string('navigation', 'local_bulkenrol'), + get_string('navigation_desc', 'local_bulkenrol'), + LOCALBULKENROL_NAV_PARTICIPANTS, + $navigationoptions) + ); + unset($navigationoptions); } $ADMIN->add('enrolments', $settings); diff --git a/tests/behat/local_bulkenrol_groups.feature b/tests/behat/local_bulkenrol_groups.feature index 0fea443..ae0ad74 100644 --- a/tests/behat/local_bulkenrol_groups.feature +++ b/tests/behat/local_bulkenrol_groups.feature @@ -18,8 +18,9 @@ Feature: Using the local_bulkenrol plugin for group management | user | course | role | | teacher1 | C1 | editingteacher | And the following config values are set as admin: - | config | value | plugin | - | enrolplugin | manual | local_bulkenrol | + | config | value | plugin | + | enrolplugin | manual | local_bulkenrol | + | navigation | navpart | local_bulkenrol | Given I log in as "admin" And I navigate to "Plugins > Enrolments > User bulk enrolment" in site administration And I set the following fields to these values: diff --git a/tests/behat/local_bulkenrol_navigation.feature b/tests/behat/local_bulkenrol_navigation.feature new file mode 100644 index 0000000..bb0a38c --- /dev/null +++ b/tests/behat/local_bulkenrol_navigation.feature @@ -0,0 +1,57 @@ +@local @local_bulkenrol @local_bulkenrol_navigation @javascript +Feature: Using the local_bulkenrol plugin + In order to bulk enrol users into the course + As user with the appropriate rights + I need to have a proper navigation + + Background: + Given the following "courses" exist: + | fullname | shortname | format | + | Course 1 | C1 | topics | + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + And the following config values are set as admin: + | config | value | plugin | + | enrolplugin | manual | local_bulkenrol | + Given I log in as "admin" + And I navigate to "Plugins > Enrolments > User bulk enrolment" in site administration + And I set the following fields to these values: + | Role | Student | + And I press "Save changes" + And I set the following system permissions of "Teacher" role: + | capability | permission | + | local/bulkenrol:enrolusers | Allow | + And I log out + + Scenario Outline: Access the bulk enrolment page via the participants page jump menu + Given the following config values are set as admin: + | config | value | plugin | + | navigation | | local_bulkenrol | + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I select "Participants" from secondary navigation + And I select "User bulk enrolment" from the "jump" singleselect + Then I should see "User bulk enrolment" in the "#region-main h2" "css_element" + + Examples: + | navigation | + | navpart | + | navboth | + + Scenario Outline: Access the bulk enrolment page via the participants page jump menu + Given the following config values are set as admin: + | config | value | plugin | + | navigation | | local_bulkenrol | + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I navigate to "User bulk enrolment" in current page administration + Then I should see "User bulk enrolment" in the "#region-main h2" "css_element" + + Examples: + | navigation | + | navcourse | + | navboth | diff --git a/tests/behat/local_bulkenrol_users.feature b/tests/behat/local_bulkenrol_users.feature index 69fb7a6..5f46330 100644 --- a/tests/behat/local_bulkenrol_users.feature +++ b/tests/behat/local_bulkenrol_users.feature @@ -18,8 +18,9 @@ Feature: Using the local_bulkenrol plugin for user enrolments | user | course | role | | teacher1 | C1 | editingteacher | And the following config values are set as admin: - | config | value | plugin | - | enrolplugin | manual | local_bulkenrol | + | config | value | plugin | + | enrolplugin | manual | local_bulkenrol | + | navigation | navpart | local_bulkenrol | Given I log in as "admin" And I navigate to "Plugins > Enrolments > User bulk enrolment" in site administration And I set the following fields to these values: diff --git a/version.php b/version.php index 555d5d7..b3eae07 100644 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'local_bulkenrol'; -$plugin->version = 2022071201; +$plugin->version = 2022071202; $plugin->release = 'v4.0-r2'; $plugin->requires = 2022041900; $plugin->supported = [400, 400]; From 4c11017fed87c8af3918d362c8dda103613f8310 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sun, 30 Apr 2023 09:36:32 +0200 Subject: [PATCH 5/7] Release v4.0-r3 --- CHANGES.md | 2 +- version.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dbe5f26..df163f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ moodle-local_bulkenrol Changes ------- -### Unreleased +### v4.0-r3 * 2023-04-26 - Allow teachers to configure the navigation node placement. * 2023-04-26 - Add a missing setting to README.md diff --git a/version.php b/version.php index b3eae07..b46cb7d 100644 --- a/version.php +++ b/version.php @@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'local_bulkenrol'; -$plugin->version = 2022071202; -$plugin->release = 'v4.0-r2'; +$plugin->version = 2022071203; +$plugin->release = 'v4.0-r3'; $plugin->requires = 2022041900; $plugin->supported = [400, 400]; $plugin->maturity = MATURITY_STABLE; From 2be07ad6e0f267eea973ff0238afe1d16b7193a0 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sat, 11 Mar 2023 10:10:45 +0100 Subject: [PATCH 6/7] Prepare compatibility for Moodle 4.1. --- .github/workflows/moodle-plugin-ci.yml | 4 ++-- CHANGES.md | 4 ++++ README.md | 2 +- version.php | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/moodle-plugin-ci.yml b/.github/workflows/moodle-plugin-ci.yml index d5f65c3..02ea439 100644 --- a/.github/workflows/moodle-plugin-ci.yml +++ b/.github/workflows/moodle-plugin-ci.yml @@ -30,8 +30,8 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.3', '7.4', '8.0'] - moodle-branch: ['MOODLE_400_STABLE'] + php: ['7.4', '8.0'] + moodle-branch: ['MOODLE_401_STABLE'] database: [pgsql, mariadb] steps: diff --git a/CHANGES.md b/CHANGES.md index df163f6..6950e21 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ moodle-local_bulkenrol Changes ------- +### Unreleased + +* 2023-01-21 - Prepare compatibility for Moodle 4.1. + ### v4.0-r3 * 2023-04-26 - Allow teachers to configure the navigation node placement. diff --git a/README.md b/README.md index 574deb2..b771d51 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Moodle plugin which provides the possibility to bulk enrol a list of users who a Requirements ------------ -This plugin requires Moodle 4.0+ +This plugin requires Moodle 4.1+ Motivation for this plugin diff --git a/version.php b/version.php index b46cb7d..6e17939 100644 --- a/version.php +++ b/version.php @@ -28,6 +28,6 @@ $plugin->component = 'local_bulkenrol'; $plugin->version = 2022071203; $plugin->release = 'v4.0-r3'; -$plugin->requires = 2022041900; -$plugin->supported = [400, 400]; +$plugin->requires = 2022112800; +$plugin->supported = [401, 401]; $plugin->maturity = MATURITY_STABLE; From 9cdd556b732a86c544d6c5eca1dc9579d154315d Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sun, 30 Apr 2023 09:51:05 +0200 Subject: [PATCH 7/7] Release v4.1-r1 --- CHANGES.md | 2 +- version.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6950e21..752e82e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ moodle-local_bulkenrol Changes ------- -### Unreleased +### v4.1-r1 * 2023-01-21 - Prepare compatibility for Moodle 4.1. diff --git a/version.php b/version.php index 6e17939..efc815e 100644 --- a/version.php +++ b/version.php @@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'local_bulkenrol'; -$plugin->version = 2022071203; -$plugin->release = 'v4.0-r3'; +$plugin->version = 2023010500; +$plugin->release = 'v4.1-r1'; $plugin->requires = 2022112800; $plugin->supported = [401, 401]; $plugin->maturity = MATURITY_STABLE;