Moodle code style fixes part 8

This commit is contained in:
PMKuipers 2023-08-25 12:16:51 +02:00
parent 0911db7ed4
commit 6e9d0cac4a
23 changed files with 326 additions and 311 deletions

View File

@ -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) {

View File

@ -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,7 +111,7 @@ 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.
@ -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");.
}
}

View File

@ -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),
];

View File

@ -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 {

View File

@ -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.
@ -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.

View File

@ -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.

View File

@ -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'])) {
@ -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.

View File

@ -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;

View File

@ -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';

View File

@ -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);

View File

@ -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, [

View File

@ -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;
}

View File

@ -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.

View File

@ -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;

View File

@ -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,

View File

@ -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,

View File

@ -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();
}

View File

@ -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.