Bugzilla – Attachment 39237 Details for
Bug 12054
Don't allow to create orders for inactive vendors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12054: Inactive vendors should be inactive
Bug-12054-Inactive-vendors-should-be-inactive.patch (text/plain), 8.86 KB, created by
Indranil Das Gupta
on 2015-05-16 12:03:50 UTC
(
hide
)
Description:
Bug 12054: Inactive vendors should be inactive
Filename:
MIME Type:
Creator:
Indranil Das Gupta
Created:
2015-05-16 12:03:50 UTC
Size:
8.86 KB
patch
obsolete
>From 393c1029fed997273a70a482f15a83d050915d57 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 28 Apr 2015 10:10:56 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12054: Inactive vendors should be > inactive > >This patch make inactive vendors really inactive. >That means an inactive vendor would not be able to receive / 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 > (c) receive shipment and enter invoice details and files > > 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 > (c) receive shipment and enter invoice details and files > > 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 > >Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> > >Remarks: Testing result match expected test plan output. The QA tests > pass with "OK" for the commit. > >Signed-off-by: Indranil Das Gupta <indradg@gmail.com> >--- > acqui/booksellers.pl | 3 ++- > acqui/uncertainprice.pl | 1 + > admin/aqcontract.pl | 1 + > koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 8 ++++---- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt | 7 ++++++- > 6 files changed, 17 insertions(+), 9 deletions(-) > >diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl >index 43dc024..b56f73e 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 6213357..cf0b600 100755 >--- a/acqui/uncertainprice.pl >+++ b/acqui/uncertainprice.pl >@@ -129,6 +129,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 095d70c..daf8fb4 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 5308b5a..41d80d1 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() { > <span class="caret"></span> > </a> > <ul class="dropdown-menu"> >- [% IF ( CAN_user_acquisition_order_manage ) %] >+ [% IF CAN_user_acquisition_order_manage && active %] > <li><a href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% booksellerid %]&op=add_form">Basket</a></li> > [% END %] >- [% IF ( CAN_user_acquisition_contracts_manage ) %] >+ [% IF CAN_user_acquisition_contracts_manage && active %] > <li><a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]">Contract</a></li> > [% END %] > [% IF ( CAN_user_acquisition_vendors_manage ) %] >@@ -31,7 +31,7 @@ function confirm_deletion() { > <div class="btn-group"><a class="btn btn-small" id="deletesupplier" href="javascript:confirm_deletion()"><i class="icon-remove"></i> Delete vendor</a></div> > [% END %] > [% END %] >- [% IF ( CAN_user_acquisition_order_receive && basketcount ) %] >+ [% IF CAN_user_acquisition_order_receive && basketcount && active %] > <div class="btn-group"><a class="btn btn-small" id="receive" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]"><i class="icon-inbox"></i> Receive shipments</a></div> > [% END %] > [% ELSE %] >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 31918fd..ebbabec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >@@ -83,13 +83,13 @@ $(document).ready(function() { > [% IF ( CAN_user_acquisition_order_manage ) %] > [% IF ( supplier.active ) %] > <a class="btn btn-small" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&op=add_form"><i class="icon-plus"></i> New basket</a> >+ [% IF ( supplier.loop_basket.size ) %] >+ <a class="btn btn-small" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]"><i class="icon-inbox"></i> Receive shipment</a> >+ [% END %] > [% ELSE %] > (inactive) > [% END %] > [% END %] >- [% IF ( supplier.loop_basket.size ) %] >- <a class="btn btn-small" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]"><i class="icon-inbox"></i> Receive shipment</a> >- [% END %] > </span> > <div class="baskets"> > [% IF ( supplier.loop_basket.size ) %] >@@ -157,7 +157,7 @@ $(document).ready(function() { > <td> > <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a> > >- [% UNLESS ( basket.closedate ) %] >+ [% IF not basket.closedate and supplier.active %] > | <a id="addtoBasketLabel[% basket.basketno %]" href="#addtoBasket[% basket.basketno %]" role="button" data-toggle="modal">Add to basket</a> > <!-- Modal --> > <div id="addtoBasket[% basket.basketno %]" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno %]" aria-hidden="true" data-basketno="[% basket.basketname %]"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >index ed8336a..6c48aa2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >@@ -194,7 +194,12 @@ function Check(ff) { > [% END %] > </table> > [% ELSE %] >- <div class="dialog message">There are no contracts with this vendor. <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]">Add a contract</a>.</div> >+ <div class="dialog message"> >+ There are no contracts with this vendor. >+ [% IF active %] >+ <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% booksellerid %]">Add a contract</a>. >+ [% END %] >+ </div> > [% END %] > [% END %] > </div> >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12054
:
26915
|
38594
|
39236
|
39237
|
39238
|
39796
|
40178
|
40204
|
40205
|
40925