Skip to content

Commit

Permalink
fix usage of new namespace names
Browse files Browse the repository at this point in the history
  • Loading branch information
irinahpe committed Mar 6, 2024
1 parent 23bff77 commit 331749a
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 82 deletions.
24 changes: 12 additions & 12 deletions backup/moodle2/backup_ratingallocate_activity_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

require_once(dirname(__FILE__) . '/backup_restore_helper.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

/**
* Define the complete ratingallocate structure for backup, with [file and] id annotations
Expand All @@ -35,38 +35,38 @@ protected function define_structure() {
$userinfo = $this->get_setting_value('userinfo');

// Define each element separated.
$class = 'ratingallocate\db\ratingallocate';
$class = 'mod_ratingallocate\db\ratingallocate';
$ratingallocate = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class),
get_fields_for_tableClass($class));

$class = 'ratingallocate\db\ratingallocate_choices';
$class = 'mod_ratingallocate\db\ratingallocate_choices';
$ratingallocatechoices = new backup_nested_element(get_tablename_for_tableClass($class) . 's');
$ratingallocatechoice = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class),
get_fields_for_tableClass($class));

$class = 'ratingallocate\db\ratingallocate_ratings';
$class = 'mod_ratingallocate\db\ratingallocate_ratings';
$ratingallocateratings = new backup_nested_element(get_tablename_for_tableClass($class) . 's');
$ratingallocaterating = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class),
get_fields_for_tableClass($class));

$class = 'ratingallocate\db\ratingallocate_allocations';
$class = 'mod_ratingallocate\db\ratingallocate_allocations';
$ratingallocateallocations = new backup_nested_element(get_tablename_for_tableClass($class) . 's');
$ratingallocateallocation = new backup_nested_element(get_tablename_for_tableClass($class), get_id_for_tableClass($class),
get_fields_for_tableClass($class));

$groupchoiceclass = 'ratingallocate\db\ratingallocate_group_choices';
$groupchoiceclass = 'mod_ratingallocate\db\ratingallocate_group_choices';
$groupchoices = new backup_nested_element(get_tablename_for_tableClass($groupchoiceclass) . 's');
$groupchoice = new backup_nested_element(get_tablename_for_tableClass($groupchoiceclass),
get_id_for_tableClass($groupchoiceclass),
get_fields_for_tableClass($groupchoiceclass));

$choicegroupclass = 'ratingallocate\db\ratingallocate_ch_gengroups';
$choicegroupclass = 'mod_ratingallocate\db\ratingallocate_ch_gengroups';
$ratingallocatechoicegroups = new backup_nested_element(get_tablename_for_tableClass($choicegroupclass) . 's');
$ratingallocatechoicegroup = new backup_nested_element(get_tablename_for_tableClass($choicegroupclass),
get_id_for_tableClass($choicegroupclass),
get_fields_for_tableClass($choicegroupclass));

$groupingclass = 'ratingallocate\db\ratingallocate_groupings';
$groupingclass = 'mod_ratingallocate\db\ratingallocate_groupings';
$ratingallocategroupings = new backup_nested_element(get_tablename_for_tableClass($groupingclass) . 's');
$ratingallocategrouping = new backup_nested_element(get_tablename_for_tableClass($groupingclass),
get_id_for_tableClass($groupingclass),
Expand All @@ -92,9 +92,9 @@ protected function define_structure() {
$ratingallocatechoicegroups->add_child($ratingallocatechoicegroup);

// Define sources.
$ratingallocate->set_source_table(get_tablename_for_tableClass('ratingallocate\db\ratingallocate'),
$ratingallocate->set_source_table(get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate'),
array(this_db\ratingallocate::ID => backup::VAR_ACTIVITYID), this_db\ratingallocate_choices::ID . ' ASC');
$ratingallocatechoice->set_source_table(get_tablename_for_tableClass('ratingallocate\db\ratingallocate_choices'),
$ratingallocatechoice->set_source_table(get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate_choices'),
array(this_db\ratingallocate_choices::RATINGALLOCATEID => backup::VAR_PARENTID),
this_db\ratingallocate_choices::ID . ' ASC');
$groupchoice->set_source_table(get_tablename_for_tableClass($groupchoiceclass), ['choiceid' => backup::VAR_PARENTID]);
Expand All @@ -105,11 +105,11 @@ protected function define_structure() {

if ($userinfo) {
$ratingallocaterating->set_source_table(get_tablename_for_tableClass(
'ratingallocate\db\ratingallocate_ratings'),
'mod_ratingallocate\db\ratingallocate_ratings'),
array(this_db\ratingallocate_ratings::CHOICEID => backup::VAR_PARENTID),
this_db\ratingallocate_ratings::ID . ' ASC');
$ratingallocateallocation->set_source_table(
get_tablename_for_tableClass('ratingallocate\db\ratingallocate_allocations'),
get_tablename_for_tableClass('mod_ratingallocate\db\ratingallocate_allocations'),
array(
this_db\ratingallocate_allocations::RATINGALLOCATEID => backup::VAR_ACTIVITYID,
this_db\ratingallocate_allocations::CHOICEID => backup::VAR_PARENTID),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

/**
*
Expand Down
2 changes: 1 addition & 1 deletion classes/choice_importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_ratingallocate;
use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

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

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

namespace mod_ratingallocate\task;

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

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

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

require_once(dirname(__FILE__) . '/../../db/db_structure.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

class send_distribution_notification extends \core\task\adhoc_task {
// Gets executed by the task runner. Will lookup the ratingallocation object and
Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

require_once(dirname(__FILE__) . '/db/db_structure.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

// //////////////////////////////////////////////////////////////////////////////
// Moodle core API //
Expand Down
12 changes: 6 additions & 6 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

use core_availability\info_module;
use mod_ratingallocate\task\distribute_unallocated_task;
use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

global $CFG;

Expand Down Expand Up @@ -396,9 +396,9 @@ private function process_action_show_choices() {
// Notifications if no choices exist or too few in comparison to strategy settings.
$availablechoices = $this->get_rateable_choices();
$strategysettings = $this->get_strategy_class()->get_static_settingfields();
if (array_key_exists(ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) {
if (array_key_exists(mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) {
$necessarychoices =
$strategysettings[ratingallocate\strategy_order\strategy::COUNTOPTIONS][2];
$strategysettings[mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS][2];
} else {
$necessarychoices = 0;
}
Expand Down Expand Up @@ -1213,9 +1213,9 @@ public function handle_view() {
$choicestatus->availablechoices = $this->filter_choices_by_groups($choicestatus->availablechoices, $USER->id);

$strategysettings = $this->get_strategy_class()->get_static_settingfields();
if (array_key_exists(ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) {
if (array_key_exists(mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS, $strategysettings)) {
$choicestatus->necessarychoices =
$strategysettings[ratingallocate\strategy_order\strategy::COUNTOPTIONS][2];
$strategysettings[mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS][2];
} else {
$choicestatus->necessarychoices = 0;
}
Expand Down Expand Up @@ -2197,7 +2197,7 @@ public function is_setup_ok() {
$choicecount = count($this->get_rateable_choices());
$strategyclass = $this->get_strategy_class();
$strategysettings = $strategyclass->get_static_settingfields();
$necessarychoices = $strategysettings[ratingallocate\strategy_order\strategy::COUNTOPTIONS][2];
$necessarychoices = $strategysettings[mod_ratingallocate\strategy_order\strategy::COUNTOPTIONS][2];
if ($choicecount < $necessarychoices) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;


defined('MOODLE_INTERNAL') || die();
Expand Down
2 changes: 1 addition & 1 deletion tests/backup_restore_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

/**
* mod_ratingallocate backup restore procedure test
Expand Down
2 changes: 1 addition & 1 deletion tests/cron_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
require_once(__DIR__ . '/generator/lib.php');
require_once(__DIR__ . '/../locallib.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

/**
* mod_ratingallocate cron tests
Expand Down
2 changes: 1 addition & 1 deletion tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

require_once(dirname(__FILE__) . '/../../locallib.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

/**
* mod_ratinallocate generator tests
Expand Down
2 changes: 1 addition & 1 deletion tests/locallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
require_once(dirname(__FILE__) . '/generator/lib.php');
require_once(dirname(__FILE__) . '/../locallib.php');

use ratingallocate\db as this_db;
use mod_ratingallocate\db as this_db;

/**
* mod_ratingallocate generator tests
Expand Down
Loading

0 comments on commit 331749a

Please sign in to comment.