From 6a5de183594a92701fc387f1bcc6645e7b365e88 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Tue, 15 Aug 2023 16:09:18 +0200 Subject: [PATCH] Minor fixes --- .gitignore | 1 + amd/src/block_mytreestudyplan.js | 7 +------ block_mytreestudyplan.php | 8 ++------ version.php | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 7c6e0dc..91924d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.vs /node_modules /amd/build +/build diff --git a/amd/src/block_mytreestudyplan.js b/amd/src/block_mytreestudyplan.js index e4077d5..2b779e4 100644 --- a/amd/src/block_mytreestudyplan.js +++ b/amd/src/block_mytreestudyplan.js @@ -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: { diff --git a/block_mytreestudyplan.php b/block_mytreestudyplan.php index 0a191a7..5e9ebd7 100644 --- a/block_mytreestudyplan.php +++ b/block_mytreestudyplan.php @@ -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 = "".get_string("view_plan","local_treestudyplan").""; - if(has_capability("local/treestudyplan:editstudyplan",$systemcontext)){ - $this->content->footer .= "  ".get_string("cfg_plans","local_treestudyplan").""; - } - } else if (count($mystudyplans) > 0) { + if ( (!$teachermode ) && count($mystudyplans) > 0) { $this->content->footer = "  {$invite_text}"; } diff --git a/version.php b/version.php index 201de6b..59ae9b9 100644 --- a/version.php +++ b/version.php @@ -1,6 +1,6 @@ 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 = [