From d920357cf1ab9ccdac4bcdac47fc466425479cb7 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 3 Mar 2017 01:32:54 +0000 Subject: [PATCH] Bug 4969: Toggle showing of all/active vendors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch provides the functionality to hide inactive vendors from the vendor search. To test: 1) Make sure at least one vendor is inactive 2) Do a vendor search 3) Confirm the link to show only active vendors works, and is replaced with a link to show all vendors when clicked 4) Confirm the link to show all vendors works, and is replaced with a link to show only active vendors when clicked Sponsored-by: Catalyst IT Followed test plan, works as expected Signed-off-by: Marc VĂ©ron Signed-off-by: Jonathan Druart --- .../prog/en/modules/acqui/booksellers.tt | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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 1384c1a..4b24671 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -33,6 +33,17 @@ $(document).ready(function() { var legend = _("Add order to basket %s").format(basket); $(this).find("legend").html(legend); }); + $("#show_all_vendors").hide(); + $("#show_active_vendors").click(function(){ + $(".inactive").hide(); + $("#show_active_vendors").hide(); + $("#show_all_vendors").show(); + }); + $("#show_all_vendors").click(function(){ + $(".inactive").show(); + $("#show_all_vendors").hide(); + $("#show_active_vendors").show(); + }); }); //]]> @@ -71,13 +82,18 @@ $(document).ready(function() {

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

Show active baskets only

+ Show active baskets only [% ELSE %] -

Show all baskets

+ Show all baskets [% END %] + | Show active vendors onlyShow all vendors
[% FOREACH supplier IN loop_suppliers %] -
+ [% IF ( supplier.active ) %] +
+ [% ELSE %] +
+ [% END %] [% IF (supplier.name) %] [% supplier.name %] -- 2.9.3