From 551bcbcdf98b772cee8501309cb3737ff97005df Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Fri, 18 Aug 2023 09:07:59 +0000
Subject: [PATCH] Bug 34381: Correct inconsistencies in Authorized values page
 title

This patch rewords the authorized values template title logic so that it
matches the breadcrumb navigation for consistency.

To test, apply the patch and go to Administration -> Authorized values.

Test all versions of the page to confirm that the breadcrumbs and page
title are consistent with each other:

 - Main view
 - New category
 - View category (click a category, e.g. CCODE, in the main view)
 - Add authorized value
 - Edit authorized value

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 .../en/modules/admin/authorised_values.tt     | 22 +++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt
index 0bcd8c984e..436572b1b9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt
@@ -5,19 +5,23 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% FILTER collapse %]
     [% IF op == 'add_form' %]
-        [% IF ( action_modify ) %]
-            [% t("Modify authorized value") | html %] &rsaquo;
-        [% END %]
-        [% IF ( action_add_value ) %]
-            [% t("New authorized value") | html %] &rsaquo;
+        [% IF ( action_modify || action_add_value ) %]
+            [% IF ( action_modify ) %]
+                [% t("Modify authorized value") | html %] &rsaquo;
+            [% END %]
+            [% IF ( action_add_value ) %]
+                [% t("New authorized value") | html %] &rsaquo;
+            [% END %]
+            [% tx("Authorized values for category {category_name}", { category_name = category_name }) | html %] &rsaquo;
         [% END %]
         [% IF ( action_add_category ) %]
             [% t("New category") | html %] &rsaquo;
         [% END %]
-        [% IF ( action_modify || action_add_value ) %]
-            [% tx("Authorized values for category  {category_name}", { category_name = category_name }) | html %] &rsaquo;
-        [% END %]
-    [% END %]
+
+    [% ELSIF ( loop || searchfield ) %]
+        [% tx("Authorized values for category {category_name}", { category_name = category.category_name }) | html %] &rsaquo;
+    [% END # /IF op == 'add_form' %]
+
     [% t("Authorized values") | html %] &rsaquo;
     [% t("Administration") | html %] &rsaquo;
     [% t("Koha") | html %]
-- 
2.30.2