Skip to content

Commit 48a15c7

Browse files
committed
Revert "Fixed Naming convention in plugin"
This reverts commit 9fcbb2d.
1 parent de842b3 commit 48a15c7

File tree

8 files changed

+44
-44
lines changed

8 files changed

+44
-44
lines changed

classes/task/cleanup_students.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
* Scheduled task for managing student accounts lifecycle.
1919
*
2020
* This task handles the automated process of disabling and/or deleting student accounts
21-
* based on configured criteria within the disable_delete_students plugin.
21+
* based on configured criteria within the tool_disable_delete_students plugin.
2222
*
23-
* @package disable_delete_students
23+
* @package tool_disable_delete_students
2424
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
* @author Waleed ul hassan <[email protected]>
2727
*/
2828

29-
namespace disable_delete_students\task;
29+
namespace tool_disable_delete_students\task;
3030

3131
/**
3232
* Scheduled task class for cleaning up student accounts.
3333
*
34-
* @package disable_delete_students
34+
* @package tool_disable_delete_students
3535
*/
3636
class cleanup_students extends \core\task\scheduled_task {
3737

@@ -42,7 +42,7 @@ class cleanup_students extends \core\task\scheduled_task {
4242
* @throws \coding_exception
4343
*/
4444
public function get_name() {
45-
return get_string('taskname', 'disable_delete_students');
45+
return get_string('taskname', 'tool_disable_delete_students');
4646
}
4747

4848
/**
@@ -54,6 +54,6 @@ public function get_name() {
5454
* @return void
5555
*/
5656
public function execute() {
57-
\disable_delete_students\util::process_student_accounts();
57+
\tool_disable_delete_students\util::process_student_accounts();
5858
}
5959
}

classes/util.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
* - Processing account disabling and deletion based on configured rules
2323
* - Handling role-based exclusions
2424
*
25-
* @package disable_delete_students
25+
* @package tool_disable_delete_students
2626
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2727
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2828
* @author Waleed ul hassan <[email protected]>
2929
*/
3030

31-
namespace disable_delete_students;
31+
namespace tool_disable_delete_students;
3232

3333
defined('MOODLE_INTERNAL') || die();
3434

@@ -82,9 +82,9 @@ public static function has_excluded_roles(int $userid): bool {
8282
public static function process_student_accounts() {
8383
global $DB, $CFG;
8484

85-
$disableaftercourseend = get_config('disable_delete_students', 'disable_after_course_end');
86-
$disableaftercreation = get_config('disable_delete_students', 'disable_after_creation');
87-
$deleteaftermonths = get_config('disable_delete_students', 'delete_after_months');
85+
$disableaftercourseend = get_config('tool_disable_delete_students', 'disable_after_course_end');
86+
$disableaftercreation = get_config('tool_disable_delete_students', 'disable_after_creation');
87+
$deleteaftermonths = get_config('tool_disable_delete_students', 'delete_after_months');
8888

8989
// Get all active student accounts.
9090
$sql = "SELECT DISTINCT u.*

db/tasks.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Scheduled task definitions for the disable_delete_students plugin.
18+
* Scheduled task definitions for the tool_disable_delete_students plugin.
1919
*
2020
* This file contains the configuration for scheduled tasks related to
2121
* the management of student accounts, specifically for disabling accounts
2222
* based on defined criteria.
2323
*
24-
* @package disable_delete_students
24+
* @package tool_disable_delete_students
2525
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2626
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2727
* @author Waleed ul hassan <[email protected]>
2828
*/
2929

3030
defined('MOODLE_INTERNAL') || die();
3131

32-
// Define the scheduled tasks for the disable_delete_students plugin.
32+
// Define the scheduled tasks for the tool_disable_delete_students plugin.
3333
$tasks = [
3434
[
35-
'classname' => 'disable_delete_students\task\cleanup_students',
35+
'classname' => 'tool_disable_delete_students\task\cleanup_students',
3636
'blocking' => 0,
3737
'minute' => '0',
3838
'hour' => '0',

lang/en/disable_delete_students.php lang/en/tool_disable_delete_students.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Language strings for the disable_delete_students plugin.
18+
* Language strings for the tool_disable_delete_students plugin.
1919
*
2020
* This file contains the language strings used in the plugin for managing
2121
* student account lifecycle operations, including disabling and deleting
2222
* accounts based on defined criteria.
2323
*
24-
* @package disable_delete_students
24+
* @package tool_disable_delete_students
2525
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2626
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2727
* @author Waleed ul hassan <[email protected]>

settings.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Settings for the disable_delete_students plugin.
18+
* Settings for the tool_disable_delete_students plugin.
1919
*
20-
* @package disable_delete_students
20+
* @package tool_disable_delete_students
2121
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
* @author Waleed ul hassan <[email protected]>
@@ -26,32 +26,32 @@
2626
defined('MOODLE_INTERNAL') || die;
2727

2828
if ($hassiteconfig) {
29-
$settings = new admin_settingpage('disable_delete_students', get_string('pluginname', 'disable_delete_students'));
29+
$settings = new admin_settingpage('tool_disable_delete_students', get_string('pluginname', 'tool_disable_delete_students'));
3030
$ADMIN->add('tools', $settings);
3131

3232
// Days after course end to disable account.
3333
$settings->add(new admin_setting_configtext(
34-
'disable_delete_students/disable_after_course_end',
35-
get_string('disable_after_course_end', 'disable_delete_students'),
36-
get_string('disable_after_course_end_desc', 'disable_delete_students'),
34+
'tool_disable_delete_students/disable_after_course_end',
35+
get_string('disable_after_course_end', 'tool_disable_delete_students'),
36+
get_string('disable_after_course_end_desc', 'tool_disable_delete_students'),
3737
21,
3838
PARAM_INT
3939
));
4040

4141
// Days after creation to disable account.
4242
$settings->add(new admin_setting_configtext(
43-
'disable_delete_students/disable_after_creation',
44-
get_string('disable_after_creation', 'disable_delete_students'),
45-
get_string('disable_after_creation_desc', 'disable_delete_students'),
43+
'tool_disable_delete_students/disable_after_creation',
44+
get_string('disable_after_creation', 'tool_disable_delete_students'),
45+
get_string('disable_after_creation_desc', 'tool_disable_delete_students'),
4646
45,
4747
PARAM_INT
4848
));
4949

5050
// Months after course end to delete account.
5151
$settings->add(new admin_setting_configtext(
52-
'disable_delete_students/delete_after_months',
53-
get_string('delete_after_months', 'disable_delete_students'),
54-
get_string('delete_after_months_desc', 'disable_delete_students'),
52+
'tool_disable_delete_students/delete_after_months',
53+
get_string('delete_after_months', 'tool_disable_delete_students'),
54+
get_string('delete_after_months_desc', 'tool_disable_delete_students'),
5555
6,
5656
PARAM_INT
5757
));

tests/cleanup_test.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Unit tests for the disable_delete_students plugin.
18+
* Unit tests for the tool_disable_delete_students plugin.
1919
*
20-
* @package disable_delete_students
20+
* @package tool_disable_delete_students
2121
* @category test
2222
* @copyright 2024 Catalyst IT {@link http://www.catalyst-eu.net/}
2323
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2424
*/
25-
namespace disable_delete_students;
25+
namespace tool_disable_delete_students;
2626

2727
/**
28-
* Unit tests for the disable_delete_students plugin.
28+
* Unit tests for the tool_disable_delete_students plugin.
2929
*
3030
* The tests include:
3131
* - Verification of excluded roles
@@ -35,7 +35,7 @@
3535
* - Ensuring users with excluded roles are not affected
3636
* - Handling of students enrolled in multiple courses
3737
*
38-
* @package disable_delete_students
38+
* @package tool_disable_delete_students
3939
* @category test
4040
* @copyright 2024 Catalyst IT {@link http://www.catalyst-eu.net/}
4141
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -59,9 +59,9 @@ protected function setUp(): void {
5959
parent::setUp();
6060
$this->resetAfterTest(true);
6161
// Set plugin configurations.
62-
set_config('disable_after_course_end', 21, 'disable_delete_students');
63-
set_config('disable_after_creation', 45, 'disable_delete_students');
64-
set_config('delete_after_months', 6, 'disable_delete_students');
62+
set_config('disable_after_course_end', 21, 'tool_disable_delete_students');
63+
set_config('disable_after_creation', 45, 'tool_disable_delete_students');
64+
set_config('delete_after_months', 6, 'tool_disable_delete_students');
6565

6666
// Retrieve system roles.
6767
$this->studentrole = $DB->get_record('role', ['shortname' => 'student']);

tests/generator/lib.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Generator for the disable_delete_students plugin.
18+
* Generator for the tool_disable_delete_students plugin.
1919
*
2020
* This class provides methods for creating test courses and users
2121
* with specific roles for testing purposes.
2222
*
23-
* @package disable_delete_students
23+
* @package tool_disable_delete_students
2424
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
* @author Waleed ul hassan <[email protected]>
@@ -29,10 +29,10 @@
2929
/**
3030
* Tool disable_delete_students generator
3131
*
32-
* @package disable_delete_students
32+
* @package tool_disable_delete_students
3333
* @category test
3434
*/
35-
class disable_delete_students_generator extends testing_module_generator {
35+
class tool_disable_delete_students_generator extends testing_module_generator {
3636
/**
3737
* Create a test course with specific settings.
3838
*

version.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Version information for the disable_delete_students plugin.
18+
* Version information for the tool_disable_delete_students plugin.
1919
2020
*
21-
* @package disable_delete_students
21+
* @package tool_disable_delete_students
2222
* @copyright 2024 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
2323
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2424
* @author Waleed ul hassan <[email protected]>
@@ -28,6 +28,6 @@
2828

2929
$plugin->version = 2024021500;
3030
$plugin->requires = 2022112800; // Moodle 4.1
31-
$plugin->component = 'disable_delete_students';
31+
$plugin->component = 'tool_disable_delete_students';
3232
$plugin->maturity = MATURITY_STABLE;
3333
$plugin->release = '1.0';

0 commit comments

Comments
 (0)