From cf9c1816a0c17329da1df96354f2340509d382fa Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 6 Jan 2014 15:25:37 +1100 Subject: [PATCH 2/2] Bug 6820 - hide receive option if there is nothing to receive The "receive shipment" button appears even if there are no orders to receive. This patch hides the button if there are no orders. To test the patch: 1. Go to "aquisitions" 2. Create a vendor 3. As the newly created vendor has no orders, there will now be no "receive shipment" button 4. Create a basket 5. Go back to the vendor search 6. The button should now appear for that vendor I've also tested it with a mix of vendors with and without baskets in the same search. --- .../prog/en/modules/acqui/booksellers.tt | 2 + .../prog/en/modules/acqui/booksellers.tt~ | 184 ++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt~ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index 3fa12e2..470fd74 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -88,7 +88,9 @@ $(document).ready(function() { (inactive) [% END %] [% END %] + [% IF ( supplier.loop_basket.size ) %] Receive shipment + [% END %]
[% IF ( supplier.loop_basket.size ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt~ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt~ new file mode 100644 index 0000000..944a4d5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt~ @@ -0,0 +1,184 @@ +[% USE KohaDates %] +[% INCLUDE 'doc-head-open.inc' %] +Koha › Search for vendor [% supplier %] +[% INCLUDE 'doc-head-close.inc' %] + + +[% INCLUDE 'datatables.inc' %] + + + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'acquisitions-search.inc' %] + + + +
+ +
+
+
+ +[% INCLUDE 'acquisitions-toolbar.inc' %] +[% UNLESS ( count == 1 ) %] +

You searched on vendor [% supplier %], [% count %] results found

+[% END %] +[% IF ( loop_suppliers.size ) %] + [% UNLESS (count == 1) %] +

Choose a vendor in the list to jump directly to the right place. + +

+ [% END %] + [% IF ( allbaskets ) %] +

Show active baskets only

+ [% ELSE %] +

Show all baskets

+ [% END %] +
+ [% FOREACH supplier IN loop_suppliers %] +
+ + [% IF (supplier.name) %] + [% supplier.name %] + [% ELSE %] + NO NAME + [% END %] + + + [% IF ( CAN_user_acquisition_order_manage ) %] + [% IF ( supplier.active ) %] + New basket + [% ELSE %] + (inactive) + [% END %] + [% END %] + [% IF ( supplier.loop_basket.size ) %] + Receive shipment + [% END %] + +
+ [% IF ( supplier.loop_basket.size ) %] + + + + + + + + + + + + + + + + + [% FOREACH basket IN supplier.loop_basket %] + [% IF ( basket.uncertainprices ) %] + + [% ELSE %] + + [% END %] + + + + + + + + + + + + [% END %][%# FOREACH basket IN supplier.loop_basket %] + +
No.NameItem countBiblio countItems expectedCreated byDateBasket groupClosed 
[% basket.basketno %][% basket.basketname %][% basket.total_items %][% basket.total_biblios %][% basket.expected_items %] + [% basket.authorisedby_firstname %] + [% basket.authorisedby_surname %] + [% basket.creationdate | $KohaDates %] + [% IF basket.basketgroup %] + [% basketgroup = basket.basketgroup %] + [% IF basketgroup.closed %] + [% basketgroup.name %] (closed) + [% ELSE %] + [% basketgroup.name %] + [% END %] + [% END %] + + [% IF ( basket.closedate ) %] + [% basket.closedate | $KohaDates %] + [% ELSE %] + + [% END %] + + View + + [% UNLESS ( basket.closedate ) %] + | Add to basket + + + [% END %] +
+ + [% ELSE %] +

No pending baskets

+ [% END %][%# IF ( supplier.loop_basket.size ) %] +
+
+ [% END %][%# FOREACH supplier IN loop_suppliers %] +
+[% END %][%# IF ( loop_suppliers.size ) %] +
+
+
+[% IF ( booksellerid ) %] +[% INCLUDE 'vendor-menu.inc' %] +[% END %] +[% INCLUDE 'acquisitions-menu.inc' %] +
+
+[% INCLUDE 'intranet-bottom.inc' %] -- 1.7.9.5