Bug 33000: Use template wrapper for breadcrumbs: Acquisitions part 1
authorOwen Leonard <oleonard@myacpl.org>
Thu, 5 Jan 2023 18:40:06 +0000 (18:40 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Mar 2023 17:45:19 +0000 (14:45 -0300)
This patch updates several acquisitions-related templates so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Acquisitions home
  - Vendor search results
  - Basket details
    - Cancel order
    - Create EDIFACT order
    - Basket edit
    - Basket deletion confirmation
    - Add to basket
      - From a staged MARC file
      - From existing orders (copy)
  - Basket groups (create, edit)
  - EDIFACT messages

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/cancelorder.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edi_ean.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edimsg.tt

index 3c7fbe9..a3b0806 100644 (file)
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">Acquisitions</a>
-        </li>
-    </ol>
-</nav>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            Acquisitions
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
 [% END %]
 
 <div class="main container-fluid">
index 1337f40..c1a4ce0 100644 (file)
 [% END %]
 
     [% WRAPPER 'sub-header.inc' %]
-    <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-        <ol>
-            <li>
-                <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-            </li>
-            <li>
+        [% WRAPPER breadcrumbs %]
+            [% WRAPPER breadcrumb_item %]
                 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-            </li>
-            <li>
+            [% END %]
+            [% WRAPPER breadcrumb_item %]
                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
-            </li>
-            <li>
+            [% END %]
+            [% WRAPPER breadcrumb_item %]
                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | uri %]">Basket [% basketno | html %]</a>
-            </li>
-            <li>
-                <a href="#" aria-current="page">Add orders from MARC file</a>
-            </li>
-        </ol>
-    </nav>
-    [% END %]
+            [% END %]
+            [% WRAPPER breadcrumb_item bc_active= 1 %]
+                Add orders from MARC file
+            [% END %]
+        [% END #/ WRAPPER breadcrumbs %]
+    [% END #/ WRAPPER sub-header.inc %]
 
     <div class="container-fluid">
         <div class="row">
index c9952b0..f5a6206 100644 (file)
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-    <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-        <ol>
-            <li>
-                <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-            </li>
-            <li>
-                <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-            </li>
-            <li>
-                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
-            </li>
-            <li>
-                <a href="#" aria-current="page">
-                    [% UNLESS ( basketno ) %]
-                        [% IF ( delete_confirmed ) %]
-                            <span>Deleted</span>
-                        [% ELSE %]
-                            <span>New</span>
-                        [% END %]
-                    [% END %]
-                    <span>Basket [% basketname | html %]
-                    [% IF ( basketno ) %]
-                        ([% basketno | html %])
-                    [% END %]
-                    for [% booksellername | html %]</span>
-                </a>
-            </li>
-        </ol>
-    </nav>
-[% END %]
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
+            <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
+        [% END %]
+        [% WRAPPER breadcrumb_item %]
+            <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
+        [% END %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            [% UNLESS ( basketno ) %]
+                [% IF ( delete_confirmed ) %]
+                    <span>Deleted</span>
+                [% ELSE %]
+                    <span>New</span>
+                [% END %]
+            [% END %]
+            <span>Basket [% basketname | html %]
+            [% IF ( basketno ) %]
+                ([% basketno | html %])
+            [% END %]
+            for [% booksellername | html %]</span>
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index afca319..7c97390 100644 (file)
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-
-    [% IF ( grouping ) %]
-        <li>
-            <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
-        </li>
-        <li>
-            <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">
+        [% END %]
+        [% IF ( grouping ) %]
+            [% WRAPPER breadcrumb_item %]
+                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
+            [% END %]
+            [% WRAPPER breadcrumb_item %]
+                <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% booksellerid | uri %]">Basket grouping</a>
+            [% END %]
+            [% WRAPPER breadcrumb_item bc_active= 1 %]
                 Add basket group for [% booksellername | html %]
-            </a>
-        </li>
-
-    [% ELSE %]
-        <li>
-            <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">
+            [% END %]
+        [% ELSE %]
+            [% WRAPPER breadcrumb_item %]
+                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
+            [% END %]
+            [% WRAPPER breadcrumb_item bc_active= 1 %]
                 Basket grouping
-            </a>
-        </li>
-    [% END %]
-    </ol>
-</nav>
-[% END %]
-
+            [% END %]
+        [% END  # /IF grouping %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index 01d7742..928c313 100644 (file)
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-        <li>
+        [% END %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
-        </li>
+        [% END %]
         [% IF ( add_form ) %]
             [% IF ( basketno ) %]
-                <li>
-                    <a href="#" aria-current="page">
-                        Edit basket '[% basketname | html %]'
-                    </a>
-                </li>
+                [% WRAPPER breadcrumb_item bc_active= 1%]
+                    Edit basket '[% basketname | html %]'
+                [% END %]
             [% ELSE %]
-                <li>
-                    <a href="#" aria-current="page">
-                        Add a basket to [% booksellername | html %]
-                    </a>
-                </li>
+                [% WRAPPER breadcrumb_item bc_active= 1%]
+                    Add a basket to [% booksellername | html %]
+                [% END %]
             [% END %]
         [% END %]
-    </ol>
-</nav>
-[% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index 1d808d8..d353962 100644 (file)
@@ -1,3 +1,4 @@
+
 [% PROCESS 'i18n.inc' %]
 [% USE raw %]
 [% USE Asset %]
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">
-                Search for vendor <em>[% supplier | html %]</em>
-            </a>
-        </li>
-    </ol>
-</nav>
-[% END %]
+        [% END %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            Search for vendor <em>[% supplier | html %]</em>
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index b97f64e..e0138d0 100644 (file)
@@ -1,3 +1,4 @@
+[% USE raw %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Cancel order &rsaquo; Acquisition &rsaquo; Koha</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -7,25 +8,21 @@
 [% INCLUDE 'header.inc' %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-        <li>
+        [% END %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% basket.bookseller.id | uri %]">[% basket.bookseller.name | html %]</a>
-        </li>
-        <li>
+        [% END %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">Basket [% basket.basketname | html %] ([% basket.basketno | html %]) for [% basket.bookseller.name | html %]</a>
-        <li>
-            <a href="#" aria-current="page">Cancel order</a>
-        </li>
-    </ol>
-</nav>
-[% END %]
+        [% END %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            Cancel order
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index 95861ee..e065d4c 100644 (file)
@@ -23,30 +23,23 @@ Acquisitions &rsaquo; Koha
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-    [% UNLESS blocking_error %]
-        </li>
-        <li>
-            <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]">[% vendor.name | html %]</a>
-        </li>
-        <li>
-            <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">Basket [% basket.basketno | html %]</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">
+        [% END %]
+        [% UNLESS blocking_error %]
+            [% WRAPPER breadcrumb_item %]
+                <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]">[% vendor.name | html %]</a>
+            [% END %]
+            [% WRAPPER breadcrumb_item %]
+                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">Basket [% basket.basketno | html %]</a>
+            [% END %]
+            [% WRAPPER breadcrumb_item bc_active= 1 %]
                 Duplicate existing orders
-            </a>
-        </li>
-    [% END %]
-    </ol>
-</nav>
-[% END %]
+            [% END %]
+        [% END # /UNLESS blocking_error %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index f12c8fb..58cef5c 100644 (file)
@@ -1,3 +1,4 @@
+[% USE raw %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Basket ([% basketno | html %]) &rsaquo; Acquisitions &rsaquo; Koha</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% END %]
 
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">Basket ([% basketno | html %])</a>
-        </li>
-    </ol>
-</nav>
-[% END %]
+        [% END %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            Basket ([% basketno | html %])
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index c53ed21..5276981 100644 (file)
 [% WRAPPER 'header.inc' %]
     [% INCLUDE 'acquisitions-search.inc' %]
 [% END %]
+
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">EDIFACT messages</a>
-        </li>
-    </ol>
-</nav>
-[% END %]
+        [% END %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            EDIFACT messages
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">
index 7bef5d8..b139930 100644 (file)
@@ -1,4 +1,4 @@
-
+[% USE raw %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>EDIFACT message display &rsaquo; Acquisitions &rsaquo; Koha</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -8,22 +8,16 @@
     [% INCLUDE 'acquisitions-search.inc' %]
 [% END %]
 
-
 [% WRAPPER 'sub-header.inc' %]
-<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
-    <ol>
-        <li>
-            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-        </li>
-        <li>
+    [% WRAPPER breadcrumbs %]
+        [% WRAPPER breadcrumb_item %]
             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
-        </li>
-        <li>
-            <a href="#" aria-current="page">EDIFACT messages</a>
-        </li>
-    </ol>
-</nav>
-[% END %]
+        [% END %]
+        [% WRAPPER breadcrumb_item bc_active= 1 %]
+            EDIFACT messages
+        [% END %]
+    [% END #/ WRAPPER breadcrumbs %]
+[% END #/ WRAPPER sub-header.inc %]
 
 <div class="main container-fluid">
     <div class="row">