Skip to content

Commit

Permalink
Namespace collision replace files in classes/local folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sumaiyamannan committed Jan 31, 2025
1 parent 5ab53a5 commit b70e7de
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 24 deletions.
7 changes: 3 additions & 4 deletions add.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

use tool_smsimport\form\add_school_form;
use tool_smsimport\helper;
use tool_smsimport\local\form\add_school_form;
use tool_smsimport\local\helper;

require_once('../../../config.php');

Expand Down Expand Up @@ -53,11 +53,10 @@
if ($id) {
$urlparams['id'] = $id;
$urlparams['sesskey'] = sesskey();
$localorg = helper::check_local_organisations();
// Load school if exists.
if (!$school = helper::get_sms_school(['id' => $id])) {
throw new \moodle_exception('wrongschoolid', 'tool_smsimport');
} else if ($localorg) {
} else {
if ($school->cohortid) {
$school->groups = helper::get_sms_school_groups($school->id, 'schoolid');
}
Expand Down
2 changes: 1 addition & 1 deletion classes/local/entities/sms_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use core_reportbuilder\local\entities\base;
use core_reportbuilder\local\report\column;
use core_reportbuilder\local\report\filter;
use tool_smsimport\helper;
use tool_smsimport\local\helper;

/**
* tool_smsimport SMS log entity class implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace tool_smsimport\form;
namespace tool_smsimport\local\form;

use tool_smsimport\helper;
use tool_smsimport\local\helper;
use moodleform;

defined('MOODLE_INTERNAL') || die();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace tool_smsimport\form;
namespace tool_smsimport\local\form;

use tool_smsimport\helper;
use tool_smsimport\local\helper;
use moodleform;

defined('MOODLE_INTERNAL') || die();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace tool_smsimport\form;
namespace tool_smsimport\local\form;

use moodleform;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace tool_smsimport\form;
namespace tool_smsimport\local\form;
use moodleform;

defined('MOODLE_INTERNAL') || die();
Expand Down
2 changes: 1 addition & 1 deletion classes/helper.php → classes/local/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace tool_smsimport;
namespace tool_smsimport\local;

use stdClass;

Expand Down
2 changes: 1 addition & 1 deletion classes/task/cleanup_sms_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

namespace tool_smsimport\task;
use tool_smsimport\helper;
use tool_smsimport\local\helper;

/**
* Simple task class responsible for importing users from SMS schools.
Expand Down
2 changes: 1 addition & 1 deletion classes/task/import_sms_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

namespace tool_smsimport\task;
use tool_smsimport\helper;
use tool_smsimport\local\helper;

/**
* Simple task class responsible for importing users from SMS schools.
Expand Down
6 changes: 3 additions & 3 deletions edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

use tool_smsimport\form\edit_school_form;
use tool_smsimport\form\save_school_form;
use tool_smsimport\helper;
use tool_smsimport\local\form\edit_school_form;
use tool_smsimport\local\form\save_school_form;
use tool_smsimport\local\helper;

require_once('../../../config.php');

Expand Down
10 changes: 3 additions & 7 deletions upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

use tool_smsimport\form\upload_users_form;
use tool_smsimport\helper;
use local_organisations\persistent\school;
use tool_smsimport\local\form\upload_users_form;
use tool_smsimport\local\helper;

require_once('../../../config.php');
require_once($CFG->libdir . '/adminlib.php');

Expand Down Expand Up @@ -71,10 +71,6 @@
if (empty($school)) {
$school = new stdClass();
$school->cohortid = $formdata->cohortid;
if (helper::check_local_organisations()) {
$orgschool = school::from_cohort_id($school->cohortid);
$school->transferin = $orgschool->get('transferin');
}
$school->schoolno = 0;
$school->name = $DB->get_field('cohort', 'name',
['id' => $school->cohortid]);
Expand Down

0 comments on commit b70e7de

Please sign in to comment.