Bug 4969: Toggle showing of all/active vendors

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 <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Aleisha Amohia 2017-03-03 01:32:54 +00:00 committed by Kyle M Hall
parent 305c804ec9
commit 3f7139d086
1 changed files with 19 additions and 3 deletions

View File

@ -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();
});
});
//]]>
</script>
@ -71,13 +82,18 @@ $(document).ready(function() {
</p>
[% END %]
[% IF ( allbaskets ) %]
<p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]">Show active baskets only</a></p>
<a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]">Show active baskets only</a>
[% ELSE %]
<p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]&amp;allbaskets=1">Show all baskets</a></p>
<a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]&amp;allbaskets=1">Show all baskets</a>
[% END %]
| <a id="show_active_vendors">Show active vendors only</a><a id="show_all_vendors">Show all vendors</a>
<div id="acqui_order_supplierlist">
[% FOREACH supplier IN loop_suppliers %]
<div class="supplier">
[% IF ( supplier.active ) %]
<div class="supplier">
[% ELSE %]
<div class="supplier inactive">
[% END %]
<span class="suppliername">
[% IF (supplier.name) %]
<a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">[% supplier.name %]</a>