From 9d4c4b1cd717d314ddb6727d6354c431c8e91d15 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Mar 2023 10:11:01 +0200 Subject: [PATCH] Bug 33346: Add Help link to Koha manual in ERM module The 'Help' is missing in the ERM module, this patch is adding it. Test plan: Confirm that the Help link is displayed on the different pages of the ERM module and that it leads to the correct page of the manual. Signed-off-by: Pedro Amorim Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- Koha/Manual.pm | 34 ++++++++++++++++++- .../prog/js/vue/components/ERM/Main.vue | 7 +++- .../prog/js/vue/components/Help.vue | 9 +++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/components/Help.vue diff --git a/Koha/Manual.pm b/Koha/Manual.pm index bb052f1a2f..4ef8c09dcf 100644 --- a/Koha/Manual.pm +++ b/Koha/Manual.pm @@ -150,6 +150,34 @@ our $mapping = { 'course_reserves/course-details' => '/course_reserves.html', 'course_reserves/course-reserves' => '/course_reserves.html', 'course_reserves/course' => '/course_reserves.html#adding-courses', + 'erm/erm' => '/erm.html', + 'erm/agreements' => '/erm.html#agreements', + 'erm/agreements/' => '/erm.html#search-and-view-an-agreement-record', + 'erm/agreements/add' => '/erm.html#create-an-agreement-record', + 'erm/agreements/edit/' => '/erm.html#create-an-agreement-record', + 'erm/licenses' => '/erm.html#licenses', + 'erm/licenses/' => '/erm.html#search-and-view-a-license-record', + 'erm/licenses/add' => '/erm.html#create-a-license-record', + 'erm/licenses/edit' => '/erm.html#create-a-license-record', + 'erm/eholdings/local/packages' => '/erm.html#local', + 'erm/eholdings/local/packages/' => '/erm.html#local', + 'erm/eholdings/local/packages/add' => '/erm.html#local', + 'erm/eholdings/local/packages/edit/' => '/erm.html#local', + 'erm/eholdings/local/titles' => '/erm.html#titles-1', + 'erm/eholdings/local/titles/' => '/erm.html#titles-1', + 'erm/eholdings/local/titles/add' => '/erm.html#titles-1', + 'erm/eholdings/local/titles/edit/' => '/erm.html#titles-1', + 'erm/eholdings/local/titles/import' => '/erm.html#import-a-new-local-title-record-from-a-list', + 'erm/eholdings/local/resources/' => '/erm.html#eholdings', + 'erm/eholdings/ebsco/packages' => '/erm.html#packages', + 'erm/eholdings/ebsco/packages/' => '/erm.html#packages', + 'erm/eholdings/ebsco/packages/add' => '/erm.html#packages', + 'erm/eholdings/ebsco/packages/edit/' => '/erm.html#packages', + 'erm/eholdings/ebsco/titles' => '/erm.html#titles', + 'erm/eholdings/ebsco/titles/' => '/erm.html#titles', + 'erm/eholdings/ebsco/titles/add' => '/erm.html#titles', + 'erm/eholdings/ebsco/titles/edit/' => '/erm.html#titles', + 'erm/eholdings/ebsco/resources/' => '/erm.html#ebsco', 'ill/ill-requests' => '/ILL_requests.html', 'labels/label-edit-batch' => '/tools.html#label-batches-label', 'labels/label-edit-layout' => '/tools.html#label-layouts-label', @@ -254,13 +282,17 @@ our $mapping = { sub get_url { my ( $url, $preferred_language ) = @_; my $file; - if ($url =~ /koha\/(.*)\.pl/) { + if ($url =~ /koha\/(.*)\.pl/ || $url =~ '/koha/(erm.*)') { $file = $1; } else { $file = 'mainpage'; } $file =~ s/[^a-zA-Z0-9_\-\/]*//g; + if ( $file =~ m|^erm| ) { + $file =~ s|\d*$||; + } + my $view; if ($url =~ /(?:\?|\&)tab=(?[\w+,.-]*)/) { $view = $file . '#' . $+{value}; diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue index 0da4384934..ae4b5b56a5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue @@ -1,6 +1,9 @@