From 6e9d0cac4a288d27a5a23ecd6c30ae2bb2ceb69d Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Fri, 25 Aug 2023 12:16:51 +0200 Subject: [PATCH] Moodle code style fixes part 8 --- classes/badgeinfo.php | 2 +- classes/cascadecohortsync.php | 37 +- classes/corecompletioninfo.php | 6 +- classes/courseservice.php | 4 +- classes/gradeinfo.php | 2 +- classes/gradingscanner.php | 4 +- .../local/aggregators/bistate_aggregator.php | 30 +- classes/local/aggregators/core_aggregator.php | 26 +- .../local/aggregators/tristate_aggregator.php | 26 +- classes/local/gradegenerator.php | 4 +- classes/local/helpers/webservicehelper.php | 2 +- classes/period.php | 2 +- classes/reportinvite_form.php | 16 +- classes/studyitem.php | 4 +- classes/studyitemconnection.php | 2 +- classes/studyline.php | 2 +- classes/studyplan.php | 4 +- classes/studyplanpage.php | 2 +- classes/studyplanservice.php | 1 - classes/teachingfinder.php | 2 +- db/services.php | 448 +++++++++--------- edit-invite.php | 7 +- settings.php | 4 +- 23 files changed, 326 insertions(+), 311 deletions(-) diff --git a/classes/badgeinfo.php b/classes/badgeinfo.php index 182fc39..3b6ac62 100644 --- a/classes/badgeinfo.php +++ b/classes/badgeinfo.php @@ -174,7 +174,7 @@ class badgeinfo { return $badge; } - function count_issued(array $studentids) { + public function count_issued(array $studentids) { $issuecount = 0; foreach ($studentids as $userid) { diff --git a/classes/cascadecohortsync.php b/classes/cascadecohortsync.php index 7c8440f..1a02121 100644 --- a/classes/cascadecohortsync.php +++ b/classes/cascadecohortsync.php @@ -87,11 +87,11 @@ class cascadecohortsync { foreach ($courseids as $courseid) { $course = \get_course($courseid); - //\mtrace("Processing Course {$courseid} {$course->shortname}");. + // First create any nonexistent links. foreach ($cohortids as $cohortid) { $cohort = $DB->get_record('cohort', ['id' => $cohortid]); - //\mtrace("Processing cohort {$cohortid} {$cohort->shortname}");. + $instanceparams = [ 'courseid' => $courseid, @@ -111,11 +111,11 @@ class cascadecohortsync { // 1: check if a link exists. // If not, make it (maybe use some of the custom text to list the studyplans involved). if ($instance = $DB->get_record('enrol', $instanceparams)) { - //\mtrace("Instance exists");. + // It already exists. // Check if this studyplan is already referenced in customtext4 in json format. - //TODO: Check this code - Maybe add option to not remember manually added stuff . + // TODO: Check this code - Maybe add option to not remember manually added stuff . $plans = json_decode($instance->customtext4); if ($plans == false || !is_array(($plans))) { // If the data was not an array (null or garbled), count it as manually added. @@ -128,19 +128,19 @@ class cascadecohortsync { } if (!in_array($this->studyplanid , $plans)) { // If not, add it to the reference. - //\mtrace("Adding this plan to the list");. + $plans[] = (int)($this->studyplanid); $enrol->update_instance($instance, (object)["customtext4" => json_encode($plans)]); } } else { - //\mtrace("New instance should be made");. + // If method members should be added to a group, create it or get its ID. if (get_config("local_treestudyplan", "csync_creategroup")) { // Make or get new new cohort group - but only on creating of instances. $groupname = $cohort->name." ".strtolower(\get_string('defaultgroupname', 'core_group')); - //\mtrace("Adding group {$groupname} for this method");. + // And make sure the . $instancenewparams['customint2'] = self::uploadenrolmentmethods_get_group($courseid, $groupname); } @@ -148,18 +148,15 @@ class cascadecohortsync { if ($instanceid = $enrol->add_instance($course, $instancenewparams)) { // Also record the (as of yet only) studyplans id requiring this association. // In the customtext4 field in json format. - //\mtrace("Instance ({$instanceid} created. Updateing instance with studyplan id");. + $instance = $DB->get_record('enrol', array('id' => $instanceid)); $enrol->update_instance($instance, (object)["customtext4" => json_encode([(int)($this->studyplanid)])]); - //\mtrace("Synchronize the enrolment");. + // Successfully added a valid new instance, so now instantiate it. // First synchronise the enrolment. $cohorttrace = new \null_progress_trace(); $result = enrol_cohort_sync($cohorttrace, $cohortid); - if ($result > 0) { - //\mtrace("Error during 'enrol_cohort_sync': code {$result}");. - } $cohorttrace->finished(); } else { @@ -181,7 +178,7 @@ class cascadecohortsync { if (get_config("local_treestudyplan", "csync_autoremove")) { // Only try the autoremove if the option is enabled. - //\mtrace("Autoremove scan for course {$courseid} {$course->shortname}");. + // Find all cohort syncs for this course. $searchparams = [ 'courseid' => $courseid, @@ -195,24 +192,24 @@ class cascadecohortsync { // Only check the records that have studyplan information in the customtext4 field. // First check if the cohort is not one of the cohort id's we have associated. if (!in_array($instance->customint1, $cohortids)) { - //\mtrace("Found cohort sync instance that is not currently liked to the studyplan: {$instance->id}");. + // So it may or may not need to be removed. $plans = json_decode($instance->customtext4); if ($plans !== null && is_array($plans)) { - //if a valid array is not returned, better leave it be, we don't want to mess with it. + // If a valid array is not returned, better leave it be, we don't want to mess with it. // Otherwise, check if we should remove it. if (in_array($this->studyplanid, $plans)) { - //\mtrace("Found this studyplan in the id list - removing from list");. - //if this plan was referenced before. + + // If this plan was referenced before. // First remove the link. $fplans = self::array_remove_value($plans, $this->studyplanid); if (count($fplans) == 0) { // Delete the sync if there are no studyplan references left. - //\mtrace("No references are left, removing instance");. + $enrol->delete_instance($instance); } else { // Otherwise just update the references so this studyplan is no longer linked. - //\mtrace("Still references left in the list, updating list...");. + $enrol->update_instance($instance, (object)["customtext4" => json_encode($fplans)]); } } @@ -222,6 +219,6 @@ class cascadecohortsync { } } } - //\mtrace("Cascading complete");. + } } diff --git a/classes/corecompletioninfo.php b/classes/corecompletioninfo.php index d359c2d..a96c484 100644 --- a/classes/corecompletioninfo.php +++ b/classes/corecompletioninfo.php @@ -427,8 +427,8 @@ class corecompletioninfo { } else { // Typeaggregation == COMPLETION_AGGREGATION_ANY. // Count and progress are either 1 or 0, since any of the items. // Complete's the type. - $cinfo["count"] = (count($cinfo["items"]) > 0)?1:0; - $cinfo["progress"] = ($progress>0)?1:0; + $cinfo["count"] = (count($cinfo["items"]) > 0) ? 1 : 0; + $cinfo["progress"] = ($progress>0) ? 1 : 0; } $info['conditions'][] = $cinfo; @@ -645,7 +645,7 @@ class corecompletioninfo { $cmpl = $c->completed; } else { $ct = 1; - $cmpl = ($c->completed > 0)?1:0; + $cmpl = ($c->completed > 0) ? 1 : 0; } // If ANY completion for the types, count only the criteria type with the highest completion percentage -. // Overwrite data if current type is more complete. diff --git a/classes/courseservice.php b/classes/courseservice.php index eb52922..d6915e2 100644 --- a/classes/courseservice.php +++ b/classes/courseservice.php @@ -56,8 +56,8 @@ class courseservice extends \external_api { "id" => new \external_value(PARAM_INT, 'course category id'), "context_id" => new \external_value(PARAM_INT, 'course category context id'), "category" => contextinfo::structure(VALUE_OPTIONAL), - "haschildren" => new \external_value(PARAM_BOOL, 'True if the category has child categories'), - "hascourses" => new \external_value(PARAM_BOOL, 'True if the category contains courses'), + "haschildren" => new \external_value(PARAM_BOOL, 'true if the category has child categories'), + "hascourses" => new \external_value(PARAM_BOOL, 'true if the category contains courses'), "studyplancount" => new \external_value(PARAM_INT, 'number of linked studyplans', VALUE_OPTIONAL), ]; diff --git a/classes/gradeinfo.php b/classes/gradeinfo.php index bfbe9f9..4405307 100644 --- a/classes/gradeinfo.php +++ b/classes/gradeinfo.php @@ -384,7 +384,7 @@ class gradeinfo { $r = $DB->get_record($table, ['studyitem_id' => $itemid, 'grade_item_id' => $gradeid]); if ($r) { $r->include = 1; - $r->required = boolval($required)?1:0; + $r->required = boolval($required) ? 1 : 0; $id = $DB->update_record($table, $r); } else { $DB->insert_record($table, [ diff --git a/classes/gradingscanner.php b/classes/gradingscanner.php index 8036474..34c8139 100644 --- a/classes/gradingscanner.php +++ b/classes/gradingscanner.php @@ -103,9 +103,9 @@ class gradingscanner { } else { $grade = $this->gi->get_final($userid); if (!is_numeric($grade->finalgrade) && empty($grade->finalgrade)) { - //skip. + // Skip. } else { - //compare grade to minimum grade. + // Compare grade to minimum grade. if ($this->grade_passed($grade)) { $completedpass++; } else { diff --git a/classes/local/aggregators/bistate_aggregator.php b/classes/local/aggregators/bistate_aggregator.php index cc172cf..925f793 100644 --- a/classes/local/aggregators/bistate_aggregator.php +++ b/classes/local/aggregators/bistate_aggregator.php @@ -36,9 +36,9 @@ class bistate_aggregator extends \local_treestudyplan\aggregator { private $threshexcellent = 1.0; // Minimum fraction that must be completed to aggregate as excellent (usually 1.0). private $threshgood = 0.8; // Minimum fraction that must be completed to aggregate as good. private $threshcompleted = 0.66; // Minimum fraction that must be completed to aggregate as completed. - private $usefailed = True; // Support failed completion yes/no. + private $usefailed = true; // Support failed completion yes/no. private $threshprogress = 0.33; // Minimum fraction that must be failed to aggregate as failed instead of progress. - private $acceptpending_as_submitted = False; // Also count ungraded but submitted . + private $acceptpending_as_submitted = false; // Also count ungraded but submitted . public function __construct($configstr) { // Allow public constructor for testing purposes. @@ -76,8 +76,6 @@ class bistate_aggregator extends \local_treestudyplan\aggregator { $this->$key = boolval($config[$key]); } } - } else { - } } @@ -93,10 +91,18 @@ class bistate_aggregator extends \local_treestudyplan\aggregator { ]); } - public function needSelectGradables() { return True;} - public function isDeprecated() { return self::DEPRECATED;} - public function useRequiredGrades() { return True;} - public function useItemConditions() { return False;} + public function needSelectGradables() { + return true; + } + public function isDeprecated() { + return self::DEPRECATED; + } + public function useRequiredGrades() { + return true; + } + public function useItemConditions() { + return false; + } public function aggregate_binary_goals(array $completions, array $required = []) { // Function is public to allow access for the testing code. @@ -123,9 +129,9 @@ class bistate_aggregator extends \local_treestudyplan\aggregator { foreach ($completions as $index => $c) { - $completed += ($c >= completion::COMPLETED)?1:0; - $progress += ($c >= $MINPROGRESS)?1:0; - $failed += ($c <= completion::FAILED)?1:0; + $completed += ($c >= completion::COMPLETED) ? 1 : 0; + $progress += ($c >= $MINPROGRESS) ? 1 : 0; + $failed += ($c <= completion::FAILED) ? 1 : 0; } $started = $progress + $failed; $allrequiredmet = ($requiredmet >= $totalrequired); @@ -219,7 +225,7 @@ class bistate_aggregator extends \local_treestudyplan\aggregator { if (empty($grade)) { return completion::INCOMPLETE; - } else if ($grade->finalgrade === NULL) { + } else if ($grade->finalgrade === null) { // On assignments, grade NULL means a submission has not yet been graded,. // But on quizes this can also mean a quiz might have been started. // Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items. diff --git a/classes/local/aggregators/core_aggregator.php b/classes/local/aggregators/core_aggregator.php index 8460d8f..ca13b84 100644 --- a/classes/local/aggregators/core_aggregator.php +++ b/classes/local/aggregators/core_aggregator.php @@ -32,7 +32,7 @@ use \local_treestudyplan\debug; class core_aggregator extends \local_treestudyplan\aggregator { public const DEPRECATED = false; - private $acceptpending_as_submitted = False; // Also count ungraded but submitted . + private $acceptpending_as_submitted = false; // Also count ungraded but submitted . public function __construct($configstr) { // Allow public constructor for testing purposes. @@ -55,8 +55,6 @@ class core_aggregator extends \local_treestudyplan\aggregator { $this->$key = boolval($config[$key]); } } - } else { - } } @@ -67,11 +65,21 @@ class core_aggregator extends \local_treestudyplan\aggregator { ]); } - public function needSelectGradables() { return False;} - public function isDeprecated() { return self::DEPRECATED;} - public function useRequiredGrades() { return True;} - public function useItemConditions() { return False;} - public function usecorecompletioninfo() { return True; } + public function needSelectGradables() { + return false; + } + public function isDeprecated() { + return self::DEPRECATED; + } + public function useRequiredGrades() { + return true; + } + public function useItemConditions() { + return false; + } + public function usecorecompletioninfo() { + return true; + } /** * Return course completion information based on the core completion infromation @@ -172,7 +180,7 @@ class core_aggregator extends \local_treestudyplan\aggregator { if (empty($grade)) { return completion::INCOMPLETE; - } else if ($grade->finalgrade === NULL) { + } else if ($grade->finalgrade === null) { // On assignments, grade NULL means a submission has not yet been graded,. // But on quizes this can also mean a quiz might have been started. // Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items. diff --git a/classes/local/aggregators/tristate_aggregator.php b/classes/local/aggregators/tristate_aggregator.php index fa0523a..5ed3bd9 100644 --- a/classes/local/aggregators/tristate_aggregator.php +++ b/classes/local/aggregators/tristate_aggregator.php @@ -32,10 +32,18 @@ class tristate_aggregator extends \local_treestudyplan\aggregator { public const DEPRECATED = true; private const DEFAULT_CONDITION = "50"; - public function needSelectGradables() { return True;} - public function isDeprecated() { return self::DEPRECATED;} - public function useRequiredGrades() { return False;} - public function useItemConditions() { return True;} + public function needSelectGradables() { + return true; + } + public function isDeprecated() { + return self::DEPRECATED; + } + public function useRequiredGrades() { + return false; + } + public function useItemConditions() { + return true; + } protected function aggregate_completion(array $a, $condition = "50") { if (in_array($condition, ['ALL', '67', '50', 'ANY'])) { @@ -49,10 +57,10 @@ class tristate_aggregator extends \local_treestudyplan\aggregator { if ($count > 0) { foreach ($a as $c) { - $cprogress += ($c>=completion::PROGRESS)?1:0; - $ccompleted += ($c>=completion::COMPLETED)?1:0; - $cexcellent += ($c>=completion::EXCELLENT)?1:0; - $cpending += ($c>=completion::PENDING)?1:0; + $cprogress += ($c>=completion::PROGRESS) ? 1 : 0; + $ccompleted += ($c>=completion::COMPLETED) ? 1 : 0; + $cexcellent += ($c>=completion::EXCELLENT) ? 1 : 0; + $cpending += ($c>=completion::PENDING) ? 1 : 0; } $required = [ @@ -114,7 +122,7 @@ class tristate_aggregator extends \local_treestudyplan\aggregator { if (empty($grade)) { return completion::INCOMPLETE; - } else if ($grade->finalgrade === NULL) { + } else if ($grade->finalgrade === null) { // On assignments, grade NULL means a submission has not yet been graded,. // But on quizes this can also mean a quiz might have been started. // Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items. diff --git a/classes/local/gradegenerator.php b/classes/local/gradegenerator.php index fb33f44..d8d5edd 100644 --- a/classes/local/gradegenerator.php +++ b/classes/local/gradegenerator.php @@ -220,7 +220,7 @@ class gradegenerator { $grade = rand(0, $gi->gradepass/2); $r = (object)["gi" => $g, "grade" => $grade, "fb" =>($grade > 0) ? $gr->fb : "" ]; } else if (!$gr->result) { - //PROGRESS. + // PROGRESS. $r = (object)["gi" => $g, "grade" => rand( round($gi->gradepass/2), $gi->gradepass -1 ), "fb" => $gr->fb ]; } else { // COMPLETED. @@ -243,7 +243,7 @@ class gradegenerator { "fb" =>($grade > 0) ? $gr->fb : "" ]; } else if (!$gr->result) { - //PROGRESS. + // PROGRESS. $r = (object)[ "gi" => $g, "grade" => $gi->grademin+rand(round($range * 0.35), round($range * 0.55) - 1 ), diff --git a/classes/local/helpers/webservicehelper.php b/classes/local/helpers/webservicehelper.php index cc23130..e7f9e47 100644 --- a/classes/local/helpers/webservicehelper.php +++ b/classes/local/helpers/webservicehelper.php @@ -44,7 +44,7 @@ class webservicehelper { } if (is_array($capability)) { - //TODO: replace this by accesslib function \has_any_capability(). + // TODO: replace this by accesslib function \has_any_capability(). foreach ($capability as $cap) { if (has_capability($cap, $context)) { return true; diff --git a/classes/period.php b/classes/period.php index c4eb105..c1061c6 100644 --- a/classes/period.php +++ b/classes/period.php @@ -222,7 +222,7 @@ class period { } } $DB->update_record(self::TABLE, $info); - //reload record after edit. + // Reload record after edit. $this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST); unset(self::$PAGECACHE[$this->r->page_id]); // Invalidate the cache for this page. return $this; diff --git a/classes/reportinvite_form.php b/classes/reportinvite_form.php index 91b52c1..22c8156 100644 --- a/classes/reportinvite_form.php +++ b/classes/reportinvite_form.php @@ -26,7 +26,7 @@ require_once("$CFG->libdir/formslib.php"); require_once("$CFG->dirroot/local/treestudyplan/lib.php"); class reportinvite_form extends moodleform { - //Add elements to form. + // Add elements to form. const GOALS_EDITOR_OPTIONS = array('trusttext' => true, 'subdirs' => true, 'maxfiles' => 0, 'maxbytes' => 5*1024*1025); public function definition() { @@ -42,13 +42,13 @@ class reportinvite_form extends moodleform { $mform->setType('update', PARAM_INT); $mform->addElement('text', 'name', get_string('invite_name', 'local_treestudyplan'), array('size' => 50)); - $mform->setType('name', PARAM_NOTAGS); //Set type of element. - $mform->setDefault('name', ''); //Default value. + $mform->setType('name', PARAM_NOTAGS); // Set type of element. + $mform->setDefault('name', ''); // Default value. $mform->addRule('name', get_string('required'), 'required', null, 'client'); $mform->addElement('text', 'email', get_string('invite_email', 'local_treestudyplan'), array('size' => 20)); - $mform->setType('email', PARAM_NOTAGS); //Set type of element. - $mform->setDefault('email', ''); //Default value. + $mform->setType('email', PARAM_NOTAGS); // Set type of element. + $mform->setDefault('email', ''); // Default value. $mform->addRule('email', get_string('required'), 'required', null, 'client'); $mform->addRule('email', get_string('email'), 'email', null, 'client'); @@ -56,7 +56,7 @@ class reportinvite_form extends moodleform { $this->add_action_buttons(); } - //Custom validation should be added here. + // Custom validation should be added here. public function validation($data, $files) { return array(); } @@ -70,7 +70,7 @@ class reportinvite_form extends moodleform { global $DB, $USER; $data = parent::get_data(); - if ($data != NULL) { + if ($data != null) { if (empty($data->user_id)) { $data->user_id = $USER->id; } @@ -83,7 +83,7 @@ class reportinvite_form extends moodleform { } if (empty($data->update)) { - //create a new random key for the invite. + // Create a new random key for the invite. do { $length = 20; $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; diff --git a/classes/studyitem.php b/classes/studyitem.php index 58f5986..1f07ce0 100644 --- a/classes/studyitem.php +++ b/classes/studyitem.php @@ -237,7 +237,7 @@ class studyitem { } $DB->update_record(self::TABLE, $info); - //reload record after edit. + // Reload record after edit. $this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST); return $this; } @@ -484,7 +484,7 @@ class studyitem { // Set new line id. unset($fields->id); $fields->line_id = $newline->id(); - //create new record with the new data. + // Create new record with the new data. $id = $DB->insert_record(self::TABLE, (array)$fields); $new = self::findById($id, $newline); diff --git a/classes/studyitemconnection.php b/classes/studyitemconnection.php index ae68483..2fd400d 100644 --- a/classes/studyitemconnection.php +++ b/classes/studyitemconnection.php @@ -88,7 +88,7 @@ class studyitemconnection { public static function connect($fromid, $toid) { global $DB; - //check if link already exists. + // Check if link already exists. if (!$DB->record_exists(self::TABLE, ['from_id' => $fromid, 'to_id' => $toid])) { $id = $DB->insert_record(self::TABLE, [ diff --git a/classes/studyline.php b/classes/studyline.php index 5cf35fb..9f1cb49 100644 --- a/classes/studyline.php +++ b/classes/studyline.php @@ -207,7 +207,7 @@ class studyline { } } $DB->update_record(self::TABLE, $info); - //reload record after edit. + // Reload record after edit. $this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST); return $this; } diff --git a/classes/studyplan.php b/classes/studyplan.php index af58476..12cdb5f 100644 --- a/classes/studyplan.php +++ b/classes/studyplan.php @@ -243,10 +243,10 @@ class studyplan { } } $DB->update_record(self::TABLE, $info); - //reload record after edit. + // Reload record after edit. $this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST); - //reload the context... + // Reload the context... $this->context = null; $this->context(); // Reload aggregator. diff --git a/classes/studyplanpage.php b/classes/studyplanpage.php index d124e9b..ed364e4 100644 --- a/classes/studyplanpage.php +++ b/classes/studyplanpage.php @@ -187,7 +187,7 @@ class studyplanpage { } $DB->update_record(self::TABLE, $info); - //reload record after edit. + // Reload record after edit. $this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST); return $this; diff --git a/classes/studyplanservice.php b/classes/studyplanservice.php index f239332..0861167 100644 --- a/classes/studyplanservice.php +++ b/classes/studyplanservice.php @@ -419,7 +419,6 @@ class studyplanservice extends \external_api { $o = studyitem::add([ 'line_id' => $lineid, 'type' => $type, - //'conditions' => $conditions,. 'slot' => $slot, 'layer' => $layer, 'competency_id' => isset($details['competency_id']) ? $details['competency_id'] : null, diff --git a/classes/teachingfinder.php b/classes/teachingfinder.php index 22f1946..5ca0f5f 100644 --- a/classes/teachingfinder.php +++ b/classes/teachingfinder.php @@ -88,7 +88,7 @@ class teachingfinder { $now = time(); foreach ($list as $pageid) { // Retrieve the studyplan id from the page. - //TODO: Change this when page management is implemented to return the page instead of the plan. + // TODO: Change this when page management is implemented to return the page instead of the plan. $planid = $DB->get_field("local_treestudyplan_page", "studyplan_id", ["id" => $pageid]); $DB->insert_record(self::TABLE, ["teacher_id" => $userid, "studyplan_id" => $planid, "update_time" => $now]); } diff --git a/db/services.php b/db/services.php index 59aa7ce..8d37ec8 100644 --- a/db/services.php +++ b/db/services.php @@ -56,168 +56,168 @@ $functions = [ /*************************** * Studyplan functions ***************************/ - 'local_treestudyplan_list_studyplans' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'list_studyplans', //external function name. + 'local_treestudyplan_list_studyplans' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'list_studyplans', // External function name. 'description' => 'List available studyplans', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_get_studyplan_map' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'get_studyplan_map', //external function name. + 'local_treestudyplan_get_studyplan_map' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'get_studyplan_map', // External function name. 'description' => 'Retrieve studyplan map', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_get_studyline_map' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'get_studyline_map', //external function name. + 'local_treestudyplan_get_studyline_map' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'get_studyline_map', // External function name. 'description' => 'Retrieve studyline map', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_add_studyplan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'add_studyplan', //external function name. + 'local_treestudyplan_add_studyplan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'add_studyplan', // External function name. 'description' => 'Add studyplan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_add_studyline' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'add_studyline', //external function name. + 'local_treestudyplan_add_studyline' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'add_studyline', // External function name. 'description' => 'Add studyline', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_edit_studyplan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'edit_studyplan', //external function name. + 'local_treestudyplan_edit_studyplan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'edit_studyplan', // External function name. 'description' => 'Edit studyplan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_edit_studyline' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'edit_studyline', //external function name. + 'local_treestudyplan_edit_studyline' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'edit_studyline', // External function name. 'description' => 'Edit studyline', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_delete_studyplan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'delete_studyplan', //external function name. + 'local_treestudyplan_delete_studyplan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'delete_studyplan', // External function name. 'description' => 'Delete studyplan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_delete_studyline' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'delete_studyline', //external function name. + 'local_treestudyplan_delete_studyline' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'delete_studyline', // External function name. 'description' => 'Delete studyline', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_reorder_studylines' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'reorder_studylines', //external function name. + 'local_treestudyplan_reorder_studylines' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'reorder_studylines', // External function name. 'description' => 'Reorder studylines', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_get_studyitem' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'get_studyitem', //external function name. + 'local_treestudyplan_get_studyitem' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'get_studyitem', // External function name. 'description' => 'Retrieve study item', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_add_studyitem' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'add_studyitem', //external function name. + 'local_treestudyplan_add_studyitem' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'add_studyitem', // External function name. 'description' => 'Add study item', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_edit_studyitem' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'edit_studyitem', //external function name. + 'local_treestudyplan_edit_studyitem' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'edit_studyitem', // External function name. 'description' => 'Edit study item', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_reorder_studyitems' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'reorder_studyitems', //external function name. + 'local_treestudyplan_reorder_studyitems' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'reorder_studyitems', // External function name. 'description' => 'Reorder study items', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_delete_studyitem' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'delete_studyitem', //external function name. + 'local_treestudyplan_delete_studyitem' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'delete_studyitem', // External function name. 'description' => 'Delete study item', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_connect_studyitems' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'connect_studyitems', //external function name. + 'local_treestudyplan_connect_studyitems' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'connect_studyitems', // External function name. 'description' => 'Connect study items', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_disconnect_studyitems' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'disconnect_studyitems', //external function name. + 'local_treestudyplan_disconnect_studyitems' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'disconnect_studyitems', // External function name. 'description' => 'Disconnect study items', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, @@ -226,11 +226,11 @@ $functions = [ * Badge functions ***************************/ - 'local_treestudyplan_list_badges' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'list_badges', //external function name. + 'local_treestudyplan_list_badges' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'list_badges', // External function name. 'description' => 'List availabel site badges', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, @@ -238,344 +238,344 @@ $functions = [ /*************************** * Association functions ***************************/ - 'local_treestudyplan_list_cohort' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'list_cohort', //external function name. + 'local_treestudyplan_list_cohort' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'list_cohort', // External function name. 'description' => 'List available cohorts', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_find_user' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'find_user', //external function name. + 'local_treestudyplan_find_user' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'find_user', // External function name. 'description' => 'Find user', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_connect_cohort' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'connect_cohort', //external function name. + 'local_treestudyplan_connect_cohort' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'connect_cohort', // External function name. 'description' => 'Connect cohort to studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_disconnect_cohort' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'disconnect_cohort', //external function name. + 'local_treestudyplan_disconnect_cohort' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'disconnect_cohort', // External function name. 'description' => 'Disconnect cohort from study plan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_connect_user' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'connect_user', //external function name. + 'local_treestudyplan_connect_user' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'connect_user', // External function name. 'description' => 'Connect user to study plan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_disconnect_user' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'disconnect_user', //external function name. + 'local_treestudyplan_disconnect_user' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'disconnect_user', // External function name. 'description' => 'Disconnect user from studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_associated_users' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'associated_users', //external function name. + 'local_treestudyplan_associated_users' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'associated_users', // External function name. 'description' => 'List users associated with a studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_associated_cohorts' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'associated_cohorts', //external function name. + 'local_treestudyplan_associated_cohorts' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'associated_cohorts', // External function name. 'description' => 'List cohorts associated with a studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_list_user_studyplans' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'list_user_studyplans', //external function name. + 'local_treestudyplan_list_user_studyplans' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'list_user_studyplans', // External function name. 'description' => 'List user studyplans', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_get_user_studyplans' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'get_user_studyplans', //external function name. + 'local_treestudyplan_get_user_studyplans' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'get_user_studyplans', // External function name. 'description' => 'Retrieve user studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_get_user_studyplan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'get_user_studyplan', //external function name. + 'local_treestudyplan_get_user_studyplan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'get_user_studyplan', // External function name. 'description' => 'Retrieve user studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_get_invited_studyplan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'get_invited_studyplan', //external function name. + 'local_treestudyplan_get_invited_studyplan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'get_invited_studyplan', // External function name. 'description' => 'Retrieve user studyplan based on invite', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => '', 'loginrequired' => false, ], - 'local_treestudyplan_list_own_studyplans' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'list_own_studyplans', //external function name. + 'local_treestudyplan_list_own_studyplans' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'list_own_studyplans', // External function name. 'description' => 'List own studyplans', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => '', 'loginrequired' => true, ], - 'local_treestudyplan_get_own_studyplan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'get_own_studyplan', //external function name. + 'local_treestudyplan_get_own_studyplan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'get_own_studyplan', // External function name. 'description' => 'Retrieve own studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => '', 'loginrequired' => true, ], - 'local_treestudyplan_map_categories' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'map_categories', //external function name. + 'local_treestudyplan_map_categories' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'map_categories', // External function name. 'description' => 'List available root categories', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_get_category' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'get_category', //external function name. + 'local_treestudyplan_get_category' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'get_category', // External function name. 'description' => 'Get details for specified category', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_include_grade' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'include_grade', //external function name. + 'local_treestudyplan_include_grade' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'include_grade', // External function name. 'description' => 'Include gradable in result', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:selectowngradables', 'loginrequired' => true, ], - 'local_treestudyplan_all_associated' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'all_associated', //external function name. + 'local_treestudyplan_all_associated' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'all_associated', // External function name. 'description' => 'List associated users', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_list_aggregators' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'list_aggregators', //external function name. + 'local_treestudyplan_list_aggregators' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'list_aggregators', // External function name. 'description' => 'List available aggregators', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_disable_autoenddate' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'disable_autoenddate', //external function name. + 'local_treestudyplan_disable_autoenddate' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'disable_autoenddate', // External function name. 'description' => 'Disable automatic end dates on courses in the study plan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:forcescales', 'loginrequired' => true, ], - 'local_treestudyplan_force_studyplan_scale' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'force_studyplan_scale', //external function name. + 'local_treestudyplan_force_studyplan_scale' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'force_studyplan_scale', // External function name. 'description' => 'Change all associated gradables to the chosen scale if possible', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:forcescales', 'loginrequired' => true, ], - 'local_treestudyplan_list_scales' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'list_scales', //external function name. + 'local_treestudyplan_list_scales' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'list_scales', // External function name. 'description' => 'List system scales', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:forcescales', 'loginrequired' => true, ], - 'local_treestudyplan_duplicate_plan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'duplicate_plan', //external function name. + 'local_treestudyplan_duplicate_plan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'duplicate_plan', // External function name. 'description' => 'Copy studyplan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_export_plan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'export_plan', //external function name. + 'local_treestudyplan_export_plan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'export_plan', // External function name. 'description' => 'Export study plan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_export_studylines' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'export_studylines', //external function name. + 'local_treestudyplan_export_studylines' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'export_studylines', // External function name. 'description' => 'Export study plan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_import_plan' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'import_plan', //external function name. + 'local_treestudyplan_import_plan' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'import_plan', // External function name. 'description' => 'Import study plan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_import_studylines' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'import_studylines', //external function name. + 'local_treestudyplan_import_studylines' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'import_studylines', // External function name. 'description' => 'Import study plan', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_edit_period' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'edit_period', //external function name. + 'local_treestudyplan_edit_period' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'edit_period', // External function name. 'description' => 'Edit period name and timing', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_submit_cm_editform' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'submit_cm_editform', //external function name. + 'local_treestudyplan_submit_cm_editform' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'submit_cm_editform', // External function name. 'description' => 'Submit course module edit form', - 'type' => 'write', //database rights of the web service function (read, write). + 'type' => 'write', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:editstudyplan', 'loginrequired' => true, ], - 'local_treestudyplan_get_teaching_studyplans' => [ //web service function name. - 'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function. - 'methodname' => 'get_teaching_studyplans', //external function name. + 'local_treestudyplan_get_teaching_studyplans' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. + 'methodname' => 'get_teaching_studyplans', // External function name. 'description' => 'Get the studyplans I currently teach in', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'capabilities' => 'local/treestudyplan:viewuserreports', 'loginrequired' => true, ], - 'local_treestudyplan_list_accessible_categories' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'list_accessible_categories', //external function name. + 'local_treestudyplan_list_accessible_categories' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'list_accessible_categories', // External function name. 'description' => 'Get categories accessible to the current user', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_list_used_categories' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'list_used_categories', //external function name. + 'local_treestudyplan_list_used_categories' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'list_used_categories', // External function name. 'description' => 'Get categories hosting a studyplan', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:editstudyplan', 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_scan_badge_progress' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'scan_badge_progress', //external function name. + 'local_treestudyplan_scan_badge_progress' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'scan_badge_progress', // External function name. 'description' => 'Scan progress of students in attaining badge', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:viewuserreports', 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_scan_completion_progress' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'scan_completion_progress', //external function name. + 'local_treestudyplan_scan_completion_progress' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'scan_completion_progress', // External function name. 'description' => 'Scan progress of students in attaining completions', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:viewuserreports', 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_scan_grade_progress' => [ //web service function name. - 'classname' => '\local_treestudyplan\courseservice', //class containing the external function. - 'methodname' => 'scan_grade_progress', //external function name. + 'local_treestudyplan_scan_grade_progress' => [ // Web service function name. + 'classname' => '\local_treestudyplan\courseservice', // Class containing the external function. + 'methodname' => 'scan_grade_progress', // External function name. 'description' => 'Scan progress of students in attaining grades', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:viewuserreports', 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_cascade_cohortsync' => [ //web service function name. - 'classname' => '\local_treestudyplan\associationservice', //class containing the external function. - 'methodname' => 'cascade_cohortsync', //external function name. + 'local_treestudyplan_cascade_cohortsync' => [ // Web service function name. + 'classname' => '\local_treestudyplan\associationservice', // Class containing the external function. + 'methodname' => 'cascade_cohortsync', // External function name. 'description' => 'Sync cohortsync to studyplan association', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:editstudyplan', 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_course_period_timing' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'course_period_timing', //external function name. + 'local_treestudyplan_course_period_timing' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'course_period_timing', // External function name. 'description' => 'Chenge course start and end times to match period', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:editstudyplan', 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_set_studyitem_span' => [ //web service function name. - 'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function. - 'methodname' => 'set_studyitem_span', //external function name. + 'local_treestudyplan_set_studyitem_span' => [ // Web service function name. + 'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function. + 'methodname' => 'set_studyitem_span', // External function name. 'description' => 'Change the span of a course item', - 'type' => 'read', //database rights of the web service function (read, write). + 'type' => 'read', // Database rights of the web service function (read, write). 'capabilities' => 'local/treestudyplan:editstudyplan', 'ajax' => true, 'loginrequired' => true, diff --git a/edit-invite.php b/edit-invite.php index afb38e2..63d8cfa 100644 --- a/edit-invite.php +++ b/edit-invite.php @@ -117,9 +117,9 @@ if ($mform->is_cancelled()) { redirect("$CFG->wwwroot/local/treestudyplan/invitations.php?sent={$id}"); } else if (!empty($data->resend)) { - + exit; } else if (!empty($data->delete)) { - + exit; } else { print_error("invaliddata"); @@ -129,9 +129,6 @@ if ($mform->is_cancelled()) { } else { $data = null; - if ($unitid > 0) { - - } $mform->display(); } diff --git a/settings.php b/settings.php index a00df1c..d0c9856 100644 --- a/settings.php +++ b/settings.php @@ -115,13 +115,13 @@ if ($hassiteconfig) { $page->add(new admin_setting_configcheckbox('local_treestudyplan/bistate_support_failed', get_string('setting_bistate_support_failed', 'local_treestudyplan'), get_string('settingdesc_bistate_support_failed', 'local_treestudyplan'), - True, + true, )); $page->add(new admin_setting_configcheckbox('local_treestudyplan/bistate_accept_pending_submitted', get_string('setting_bistate_accept_pending_submitted', 'local_treestudyplan'), get_string('settingdesc_bistate_accept_pending_submitted', 'local_treestudyplan'), - False, + false, )); // Add settings page to the admin settings category.