From 58c652a0fc7b870b1e393f61905dd48fc2e6ad6e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Apr 2015 10:10:56 +0200 Subject: [PATCH] Bug 12054: Inactive vendors should be inactive This patch make inactive vendors really inactive. That means an inactive vendor would not be able to add a basket / add an order. Revised test plan ================= 1/ In the acquisition module create 2 vendors: 1 active and 1 inactive. 2/ On the acqui/booksellers.pl, acqui/uncertainprice.pl, admin/aqcontract.pl and acqui/supplier.pl (pages which include the acq toolbar), you should be able to, for both the 'active' as well as the inactive vendor : (a) add new basket (b) add order items to the basket Remark: This is *wrong*. You should be able to do so only for active vendor. 3/ Apply the patch 4/ Go to the links in step #2 above and select the inactive vendor you should no longer be able to: (a) add new basket (b) add order items to the basket Remark: This is the *correct* behaviour 5/ No change should be noted for vendor marked "active", and should be able to undertake operations 4 (a), 4 (b) and 4 (c). Remark: This is the *correct* behaviour. 6/ run koha qa tests tool Bug 12054: (follow-up) Inactive vendors should be inactive Don't display "add order""block and buttons if the vendor is inactive. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- acqui/booksellers.pl | 3 ++- acqui/uncertainprice.pl | 1 + admin/aqcontract.pl | 1 + .../prog/en/includes/acquisitions-toolbar.inc | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 7 ++++++- .../intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 2 +- .../intranet-tmpl/prog/en/modules/admin/aqcontract.tt | 7 ++++++- 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 43dc024897..b56f73e169 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -93,7 +93,8 @@ if ( $supplier_count == 1 ) { $template->param( supplier_name => $suppliers[0]->{'name'}, booksellerid => $suppliers[0]->{'id'}, - basketcount => $suppliers[0]->{'basketcount'} + basketcount => $suppliers[0]->{'basketcount'}, + active => $suppliers[0]->{active}, ); } diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl index f3848c14c2..a90c75f41e 100755 --- a/acqui/uncertainprice.pl +++ b/acqui/uncertainprice.pl @@ -128,6 +128,7 @@ $template->param( uncertainpriceorders => \@orders, booksellernotes => $bookseller->{'notes'}, basketcount => $bookseller->{'basketcount'}, subscriptioncount => $bookseller->{'subscriptioncount'}, + active => $bookseller->{active}, owner => $owner, scriptname => "/cgi-bin/koha/acqui/uncertainprice.pl"); $template->{'VARS'}->{'contacts'} = $bookseller->{'contacts'}; diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index 095d70c622..daf8fb41c2 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -53,6 +53,7 @@ $template->param( booksellerid => $booksellerid, booksellername => $bookseller->{name}, basketcount => $bookseller->{'basketcount'}, + active => $bookseller->{active}, subscriptioncount => $bookseller->{'subscriptioncount'}, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc index 5308b5a9f5..c0007d1f3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc @@ -14,10 +14,10 @@ function confirm_deletion() {