Bug 28036: Improve breadcrumbs of serial claims page
authorOwen Leonard <oleonard@myacpl.org>
Thu, 25 Mar 2021 18:05:13 +0000 (18:05 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 6 Apr 2021 13:56:31 +0000 (15:56 +0200)
This patch modifies the serial claims script and templates so that
better context can be shown in the page title and page breadcrumbs when
a vendor has been selected.

To test, apply the patch and go to Serials -> Claims.

- The initial state of the page title and breadcrumbs should show
  "Serials > Claims."
- Select a vendor. The page title and breadcrumbs show show "Serials >
  Claims > Claims for <vendor name>."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
serials/claims.pl

index 1eb315c..494841a 100644 (file)
@@ -4,7 +4,7 @@
 [% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-    <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
+    <title>Koha &rsaquo; Serials &rsaquo; Claims [% IF ( supplierid ) -%] &rsaquo; Claims for [% suppliername | html %] [% END %]</title>
     [% INCLUDE 'doc-head-close.inc' %]
 </head>
 
         <li>
             <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
         </li>
-        <li>
-            <a href="#" aria-current="page">
-                Claims
-            </a>
-        </li>
+        [% IF ( supplierid ) -%]
+            <li>
+                <a href="/cgi-bin/koha/serials/claims.pl">
+                    Claims
+                </a>
+            </li>
+            <li>
+                <a href="#" aria-current="page">Claims for [% suppliername | html %]</a>
+            </li>
+        [% ELSE -%]
+            <li>
+                <a href="#" aria-current="page">
+                    Claims
+                </a>
+            </li>
+        [% END %]
     </ol>
 </nav>
 
@@ -33,7 +44,7 @@
         <div class="col-sm-10 col-sm-push-2">
             <main>
 
-    <h1>Claims</h1>
+    <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
 
     [% IF error_claim %]
         [% IF error_claim == 'no_vendor_email' %]
index 4c6a272..498f1cc 100755 (executable)
@@ -84,11 +84,13 @@ my $letters = GetLetters({ module => 'claimissues' });
 
 my @missingissues;
 if ($supplierid) {
+    my $supplier = Koha::Acquisition::Booksellers->find( $supplierid );
     @missingissues = GetLateOrMissingIssues($supplierid);
     foreach my $issue (@missingissues) {
         $issue->{cannot_claim} = 1
           unless C4::Serials::can_claim_subscription($issue);
     }
+    $template->param( suppliername => $supplier->name );
 }
 
 $template->param(