From 3c00c9950866e49c2231bb90c6e901fc6c18c785 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 16 Sep 2022 12:33:31 +0100 Subject: [PATCH] Bug 31465: (follow-up) Link to preference tabs directly This patch enhances the mapping system for the help button to allow for each tab of preferences to link directly to the relevent section of the manual. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 6d82b66a277caa879a5a7b0c8f05a84f795beb4d) Signed-off-by: Lucas Gass (cherry picked from commit 78a2c2220689fde6ed1c2c88043889064aa76e4e) Signed-off-by: Arthur Suzuki --- Koha/Manual.pm | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Koha/Manual.pm b/Koha/Manual.pm index f1d012de14..46641f8127 100644 --- a/Koha/Manual.pm +++ b/Koha/Manual.pm @@ -90,6 +90,23 @@ our $mapping = { 'admin/oai_sets' => '/administration.html#oai-sets-configuration', 'admin/patron-attr-types' => '/administration.html#patron-attribute-types', 'admin/preferences' => '/globalpreferences.html', + 'admin/preferences#accounting' => '/accountspreferences.html', + 'admin/preferences#acquisitions' => '/acquisitionspreferences.html', + 'admin/preferences#admin' => '/administrationpreferences.html', + 'admin/preferences#authorities' => '/authoritiespreferences.html', + 'admin/preferences#cataloguing' => '/catalogingpreferences.html', + 'admin/preferences#circulation' => '/circulationpreferences.html', + 'admin/preferences#enhanced_content' => '/enhancedcontentpreferences.html', + 'admin/preferences#i18n_l10n' => '/i18npreferences.html', + 'admin/preferences#logs' => '/logspreferences.html', + 'admin/preferences#opac' => '/opacpreferences.html', + 'admin/preferences#patrons' => '/patronspreferences.html', + 'admin/preferences#searching' => '/searchingpreferences.html', + 'admin/preferences#serials' => '/serialspreferences.html', + 'admin/preferences#staff_interface' => '/staffclientpreferences.html', + 'admin/preferences#staff_interface' => '/staffclientpreferences.html', + 'admin/preferences#tools' => '/toolspreferences.html', + 'admin/preferences#web_services' => '/webservicespreferences.html', 'admin/smart-rules' => '/administration.html#circulation-and-fine-rules', 'admin/sms_providers' => '/administration.html#sms-cellular-providers', 'admin/systempreferences' => '/localusepreferences.html', @@ -242,8 +259,18 @@ sub get_url { } $file =~ s/[^a-zA-Z0-9_\-\/]*//g; + my $view; + if ($url =~ /(?:\?|\&)tab=(?[\w+,.-]*)/) { + $view = $file . '#' . $+{value}; + } + my $base_url = _get_base_url( $preferred_language ); - return $base_url . ( exists $mapping->{$file} ? $mapping->{$file} : $mapping->{mainpage} ); + return $base_url + . ( + exists $mapping->{$view} ? $mapping->{$view} + : exists $mapping->{$file} ? $mapping->{$file} + : $mapping->{mainpage} + ); } 1; -- 2.39.5