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) <indradg@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
$template->param(
supplier_name => $suppliers[0]->{'name'},
booksellerid => $suppliers[0]->{'id'},
- basketcount => $suppliers[0]->{'basketcount'}
+ basketcount => $suppliers[0]->{'basketcount'},
+ active => $suppliers[0]->{active},
);
}
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'};
booksellerid => $booksellerid,
booksellername => $bookseller->{name},
basketcount => $bookseller->{'basketcount'},
+ active => $bookseller->{active},
subscriptioncount => $bookseller->{'subscriptioncount'},
);
<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 ) %]
<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 %]
<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 %]
[% UNLESS ( selectbasketg ) %]
[% UNLESS ( closedate ) %]
<div id="toolbar" class="btn-toolbar">
- <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-small" data-toggle="modal"><i class="icon-plus"></i> Add to basket</a></div>
+ [% IF active %]
+ <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-small" data-toggle="modal"><i class="icon-plus"></i> Add to basket</a></div>
+ [% END %]
<div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]&op=add_form" class="btn btn-small" id="basketheadbutton"><i class="icon-pencil"></i> Edit basket</a></div>
[%# FIXME This action should not be available for everyone %]
<div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-small" data-toggle="modal" id="delbasketbutton"><i class="icon-remove"></i> Delete this basket</a></div>
</div>
</div>
+ [% IF active %]
[% INCLUDE 'acquisitions-add-to-basket.inc' %]
+ [% END %]
+
[% END %]
[% END %]
[% END %] [% ELSE %] <!-- if we want just to select a basketgroup for a closed basket -->
<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 %]">
[% 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>