Bug 10978: Redirect to basket list of a supplier after deleting a basket
authorAleisha Amohia <aleishaamohia@hotmail.com>
Wed, 15 Feb 2017 00:30:57 +0000 (00:30 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 3 Mar 2017 18:26:46 +0000 (18:26 +0000)
This patch redirects to the vendor's list of baskets after deleting a
basket, fixes breadcrumbs after deletion and also hides the toolbar
actions after deletion (seeing as you can't edit/export etc a basket
that no longer exists).

To test:
1) Go to Acquisitions -> find a vendor -> view a basket or create a new
basket
2) Delete the basket. Notice you are taken to a list of all vendors and
baskets
3) Apply patch and do step 1 again
4) Delete the basket. Notice appropriate breadcrumbs, no toolbar, and
confirm link to return to baskets for the vendor works.

Sponsored-by: Catalyst IT
Followed test plan, works as expected (links to vendor's baskets and all baskets)
Signed-off-by: Marc Véron <veron@veron.ch>
Re-tested. Wording of buttons "Show baskets for vendor..." and "Show all
active baskets" makes sense.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
acqui/basket.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

index 31b96bb..284b082 100755 (executable)
@@ -156,7 +156,11 @@ if ( $op eq 'delete_confirm' ) {
     }
  # delete the basket
     DelBasket($basketno,);
-    $template->param( delete_confirmed => 1 );
+    $template->param(
+        delete_confirmed => 1,
+        name => $bookseller->name,
+        booksellerid => $booksellerid,
+    );
 } elsif ( !$bookseller ) {
     $template->param( NO_BOOKSELLER => 1 );
 } elsif ($op eq 'export') {
index 4502d2a..b7e080a 100644 (file)
 [% INCLUDE 'acquisitions-search.inc' %]
 
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a> &rsaquo; [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</div>
+<div id="breadcrumbs">
+    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
+    <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
+    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name|html %]</a> &rsaquo;
+    [% UNLESS ( basketno ) %][% IF ( delete_confirmed ) %]Deleted [% ELSE %]New [% END %][% END %]Basket [% basketname|html %] [% IF ( basketno ) %]([% basketno %])[% END %] for [% name|html %]
+</div>
 
 <div id="doc3" class="yui-t2">
 
         [% IF !confirm_close && !edi_confirm %]
         [% UNLESS ( selectbasketg ) %]
             [% UNLESS ( closedate ) %]
+            [% UNLESS ( delete_confirmed ) %]
                 <div id="toolbar" class="btn-toolbar">
                     [% IF active %]
                         <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-default btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
                             </div>
                         [% END %]
                 </div>
+            [% END %]
 <!-- Modal for confirm deletion box-->
                 <div class="modal" id="deleteBasketModal" tabindex="-1" role="dialog" aria-labelledby="delbasketModalLabel" aria-hidden="true">
                     <div class="modal-dialog">
                 </div>
                 <a href="booksellers.pl">Click here to go back to booksellers page</a>
             [% ELSE %]
-            <META HTTP-EQUIV=Refresh CONTENT="0; url=booksellers.pl">
+                <a href="/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid %]" class="btn btn-default btn-sm">Show baskets for vendor [% name | html %]</a> <a href="/cgi-bin/koha/acqui/booksellers.pl" class="btn btn-default btn-sm">Show all active baskets</a>
             [% END %]
         [% ELSE %]