Bugfixes in invitation system

This commit is contained in:
PMKuipers 2023-12-11 23:41:03 +01:00
parent f3bf55598d
commit b8a3394fe4
10 changed files with 23 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -344,11 +344,12 @@ export default {
loadStudyplans() { loadStudyplans() {
const self = this; const self = this;
this.loading = true; this.loading = true;
call([{ call([{
methodname: `local_treestudyplan_list_${this.verified_type}_studyplans`, methodname: `local_treestudyplan_list_${this.verified_type}_studyplans`,
args: this.call_args(), args: this.call_args(),
}])[0].done(function(response){ }])[0].done(function(response){
console.info("Loaded: plans",response);
const plans = { future: [], present: [], past: [], }; const plans = { future: [], present: [], past: [], };
for (const ix in response) { for (const ix in response) {
@ -384,7 +385,6 @@ export default {
} }
} }
} }
}).fail(notification.exception); }).fail(notification.exception);
}, },
selectStudyplan(plan) { selectStudyplan(plan) {
@ -1498,7 +1498,7 @@ export default {
</th> </th>
</tr> </tr>
<tr v-for='ci in cgroup.items'> <tr v-for='ci in cgroup.items'>
<td><span v-if='guestmode'>{{ci.title}}</span> <td><span v-if='guestmode'><span v-html="ci.title"></span></span>
<span v-else v-html='addTargetBlank(ci.details.criteria)'></span> <span v-else v-html='addTargetBlank(ci.details.criteria)'></span>
<a href="#" v-b-tooltip.click.hover.right.html="{ customClass: 'r-tooltip ' + ci.status}" <a href="#" v-b-tooltip.click.hover.right.html="{ customClass: 'r-tooltip ' + ci.status}"
:title="requirementHTML(ci.details.requirement)" :title="requirementHTML(ci.details.requirement)"

View File

@ -377,7 +377,7 @@ class badgeinfo {
$rec = $DB->get_record('role', array('id' => $rid)); $rec = $DB->get_record('role', array('id' => $rid));
if ($rec) { if ($rec) {
return role_get_name($rec, $PAGE->context, ROLENAME_BOTH); return role_get_name($rec, \context_system::instance(), ROLENAME_BOTH);
} else { } else {
return null; return null;
} }

View File

@ -599,7 +599,7 @@ $functions = [
'type' => 'read', // Database rights of the web service function (read, write). 'type' => 'read', // Database rights of the web service function (read, write).
'ajax' => true, 'ajax' => true,
'capabilities' => '', 'capabilities' => '',
'loginrequired' => true, 'loginrequired' => false,
], ],
'local_treestudyplan_get_invited_studyplan' => [ // Web service function name. 'local_treestudyplan_get_invited_studyplan' => [ // Web service function name.
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
@ -608,7 +608,7 @@ $functions = [
'type' => 'read', // Database rights of the web service function (read, write). 'type' => 'read', // Database rights of the web service function (read, write).
'ajax' => true, 'ajax' => true,
'capabilities' => '', 'capabilities' => '',
'loginrequired' => true, 'loginrequired' => false,
], ],
'local_treestudyplan_get_invited_page' => [ // Web service function name. 'local_treestudyplan_get_invited_page' => [ // Web service function name.
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
@ -617,7 +617,7 @@ $functions = [
'type' => 'read', // Database rights of the web service function (read, write). 'type' => 'read', // Database rights of the web service function (read, write).
'ajax' => true, 'ajax' => true,
'capabilities' => '', 'capabilities' => '',
'loginrequired' => true, 'loginrequired' => false,
], ],
'local_treestudyplan_list_own_studyplans' => [ // Web service function name. 'local_treestudyplan_list_own_studyplans' => [ // Web service function name.
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function. 'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.

View File

@ -106,6 +106,9 @@ $string["settingdesc_display_heading"] = 'Study plan display settings';
$string["setting_display_field"] = 'Course display name'; $string["setting_display_field"] = 'Course display name';
$string["settingdesc_display_field"] = 'Select the field to use for the display name of a course in the study plan'; $string["settingdesc_display_field"] = 'Select the field to use for the display name of a course in the study plan';
$string["setting_enableplansharing"] = 'Enable sharing of studyplan';
$string["settingdesc_enableplansharing"] = 'Allow students to share access to the studyplan with others through a unique link';
$string["setting_courseprogressbar"] = 'Show progress bar in course'; $string["setting_courseprogressbar"] = 'Show progress bar in course';
$string["settingdesc_courseprogressbar"] = 'Show a progress bar in the course popup'; $string["settingdesc_courseprogressbar"] = 'Show a progress bar in the course popup';

View File

@ -106,6 +106,9 @@ $string["settingdesc_display_heading"] = 'Configuratie voor de weergave van de s
$string["setting_display_field"] = 'Weergavenaam cursus'; $string["setting_display_field"] = 'Weergavenaam cursus';
$string["settingdesc_display_field"] = 'Kies welk veld gebruikt moet worden als weergavenaam van een cursus'; $string["settingdesc_display_field"] = 'Kies welk veld gebruikt moet worden als weergavenaam van een cursus';
$string["setting_enableplansharing"] = 'Studieplan delen toestaan';
$string["settingdesc_enableplansharing"] = 'Sta studenten toe om hun studieplannen te delen met anderen via een unieke link';
$string["setting_courseprogressbar"] = 'Toon voortgangsbalk in cursus'; $string["setting_courseprogressbar"] = 'Toon voortgangsbalk in cursus';
$string["settingdesc_courseprogressbar"] = 'Laat een voortgangsbalk zien in de cursuspopup'; $string["settingdesc_courseprogressbar"] = 'Laat een voortgangsbalk zien in de cursuspopup';

View File

@ -71,7 +71,7 @@ print $OUTPUT->header();
print '<div class="m-buttonbar" style="margin-bottom: 1em; text-align: right;">'; print '<div class="m-buttonbar" style="margin-bottom: 1em; text-align: right;">';
if (!$am_teaching) { if (get_config("local_treestudyplan","enableplansharing") && !$am_teaching) {
print '<a class="btn btn-primary" href="invitations.php" id="manage_invites">'; print '<a class="btn btn-primary" href="invitations.php" id="manage_invites">';
print '&nbsp;<i class="fa fa-share"></i>&nbsp;'.t('manage_invites').'</a>'; print '&nbsp;<i class="fa fa-share"></i>&nbsp;'.t('manage_invites').'</a>';
} }

View File

@ -105,6 +105,12 @@ if ($hassiteconfig) {
} }
} }
} }
//get_config("local_treestudyplan","enableplansharing")
$page->add(new admin_setting_configcheckbox('local_treestudyplan/enableplansharing',
get_string('setting_enableplansharing', 'local_treestudyplan'),
get_string('settingdesc_enableplansharing', 'local_treestudyplan'),
true,
));
$page->add(new admin_setting_configselect('local_treestudyplan/display_field', $page->add(new admin_setting_configselect('local_treestudyplan/display_field',
get_string('setting_display_field', 'local_treestudyplan'), get_string('setting_display_field', 'local_treestudyplan'),

View File

@ -22,7 +22,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->component = 'local_treestudyplan'; // Recommended since 2.0.2 (MDL-26035). Required since 3.0 (MDL-48494). $plugin->component = 'local_treestudyplan'; // Recommended since 2.0.2 (MDL-26035). Required since 3.0 (MDL-48494).
$plugin->version = 2023121002; // YYYYMMDDHH (year, month, day, iteration). $plugin->version = 2023121101; // YYYYMMDDHH (year, month, day, iteration).
$plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11). $plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11).
$plugin->release = "1.1.0"; $plugin->release = "1.1.0";