Minor fixes

This commit is contained in:
PMKuipers 2023-08-15 16:09:18 +02:00
parent b1f65bbcfc
commit 6a5de18359
4 changed files with 5 additions and 13 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/.vs
/node_modules
/amd/build
/build

View File

@ -92,14 +92,9 @@ let strings = load_strings({
},
created() {
this.$root.$on('redrawLines',()=>{
// Ugly hack, but currently the only way to properly fix scrollablility in the lines
fixLineWrappers();
});
},
updated() {
// Ugly hack, but currently the only way to properly fix scrollablility in the lines
setTimeout(fixLineWrappers, 50);
},
methods: {

View File

@ -50,6 +50,7 @@ class block_mytreestudyplan extends \block_base {
$coursecontext = \context_course::instance($COURSE->id);
$systemcontext = \context_system::instance();
//TODO: Check if they have the permission in any relevant context, not just system
$teachermode = has_capability("local/treestudyplan:viewuserreports",$systemcontext);
$this->content = new \stdClass;
@ -67,12 +68,7 @@ class block_mytreestudyplan extends \block_base {
$invite_text = get_string('manage_invites','local_treestudyplan');
if($teachermode){
$this->content->footer = "<a class='btn btn-primary' href='/local/treestudyplan/view-plan.php'>".get_string("view_plan","local_treestudyplan")."</a>";
if(has_capability("local/treestudyplan:editstudyplan",$systemcontext)){
$this->content->footer .= "&nbsp; <a class='btn btn-primary' href='/local/treestudyplan/edit-plan.php' id='manage_invites'><i class='fa fa-share'></i>".get_string("cfg_plans","local_treestudyplan")."</a>";
}
} else if (count($mystudyplans) > 0) {
if ( (!$teachermode ) && count($mystudyplans) > 0) {
$this->content->footer = "&nbsp; <a class='btn btn-primary' href='{$invite_url}'>{$invite_text}</a>";
}

View File

@ -1,6 +1,6 @@
<?php
$plugin->component = 'block_mytreestudyplan'; // Recommended since 2.0.2 (MDL-26035). Required since 3.0 (MDL-48494)
$plugin->version = 2022090801; // YYYYMMDDHH (year, month, day, iteration)
$plugin->version = 2023081600; // YYYYMMDDHH (year, month, day, iteration)
$plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11)
$plugin->dependencies = [