From 3f7139d0864b06e5c13ca7529df657d3a2eb3329 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=utf8
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
Signed-off-by: Kyle M Hall
---
.../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 1384c1a705..4b2467137e 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 ) %]
+