@@ -, +, @@ search page - Add a vendor-specific toolbar under each vendor search result. This gives instant access to the options for a new basket, new contract, vendor edit, or to receive shipments. A delete button will appear if available. - Add a summary of the number of baskets and subscriptions. This helps the user know if there are closed baskets and whether an outstanding subscription might be blocking the option to delete. Each number is linked to the view of those entries. - Indicate whether a vendor is inactive. The vendor name appears in a different color when it is inactve and is labeled as such. - To test you should have multiple vendors in your system, some active and some inactive. Add some baskets and subscriptions to one or more if necessary. - Go to Acquisitions and submit an empty vendor search to show all vendors. - Verify that the page looks correct and that all controls work as expected. - Open the basket view for a single vendor and compare the two views. --- acqui/booksellers.pl | 3 + acqui/supplier.pl | 4 +- .../intranet-tmpl/prog/css/src/staff-global.scss | 31 ++++------ .../prog/en/includes/acquisitions-toolbar.inc | 21 ++++--- .../prog/en/modules/acqui/booksellers.tt | 72 +++++++++++++++------- .../prog/en/modules/acqui/supplier.tt | 1 + .../prog/en/modules/acqui/uncertainprice.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/acq.js | 9 +++ 8 files changed, 91 insertions(+), 51 deletions(-) --- a/acqui/booksellers.pl +++ a/acqui/booksellers.pl @@ -92,6 +92,7 @@ if ( $supplier_count == 1 ) { supplier_name => $suppliers[0]->name, booksellerid => $suppliers[0]->id, basketcount => $suppliers[0]->baskets->count, + subscriptionscount => $suppliers[0]->subscriptions->count, active => $suppliers[0]->active, ); } @@ -149,6 +150,8 @@ for my $vendor (@suppliers) { booksellerid => $vendor->id, name => $vendor->name, active => $vendor->active, + basketcount => $vendor->baskets->count, + subscriptioncount => $vendor->subscriptions->count, }; } --- a/acqui/supplier.pl +++ a/acqui/supplier.pl @@ -89,8 +89,8 @@ if ( $op eq 'display' ) { ); } elsif ( $op eq 'delete' ) { # no further message needed for the user - # the DELETE button only appears in the template if basketcount == 0 - if ( $supplier->baskets->count == 0 ) { + # the DELETE button only appears in the template if basketcount == 0 AND subscriptioncount == 0 + if ( $supplier->baskets->count == 0 && $supplier->subscriptions->count == 0) { Koha::Acquisition::Booksellers->find($booksellerid)->delete; } print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl'); --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2714,28 +2714,23 @@ td { } #acqui_order_supplierlist { - > div { - &.supplier { - border: 1px solid #EEEEEE; - margin: .5em; - padding: 1em; + .supplier { + &+.supplier { + border-top: 1px solid #EEEEEE; + margin-top: 1em; } + } - > div { - > .baskets { - margin-top: .5em; - } - } + .suppliername { + display: inline-block; + margin: .5em 1em .5em 0; - > span { - &.action { - margin-left: 5em; - } + &.inactive { + color: #888; - &.suppliername { - display: inline; - font-size: 1.7em; - margin-bottom: .5em; + a:link, + a:visited { + color: #888; } } } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc @@ -1,12 +1,5 @@ [% INCLUDE 'blocking_errors.inc' %] -
[% IF ( booksellerid ) %]
@@ -26,12 +19,20 @@
[% IF ( CAN_user_acquisition_vendors_manage ) %] -
Edit vendor
+
+ Edit vendor +
[% UNLESS ( basketcount OR subscriptioncount ) %] -
Delete vendor
+
+
+ + + +
+
[% END %] [% END %] - [% IF CAN_user_acquisition_order_receive && basketcount %] + [% IF CAN_user_acquisition_order_receive && basketcount && active %]
Receive shipments
[% END %] [% ELSE %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -57,11 +57,11 @@ [% END %]

- [% END %] - [% IF ( allbaskets ) %] - Show active baskets only - [% ELSE %] - Show all baskets + [% IF ( allbaskets ) %] + Show active baskets only + [% ELSE %] + Show all baskets + [% END %] [% END %] [% UNLESS booksellerid %] | Show active vendors onlyShow all vendors @@ -73,25 +73,49 @@ [% ELSE %]
[% END %] - - [% IF (supplier.name) %] - [% supplier.name | html %] + [% IF ( supplier.active ) %] +

+ [% ELSE %] +

+ [% END %] + + [% IF (supplier.name) %] + [% supplier.name | html %] + [% ELSE %] + NO NAME + [% END %] + + + [% IF ( !supplier.active ) %](inactive)[% END %] +

+ + [% IF ( count > 1 ) %] + [% supplier.basketcount | html %] [% tn('basket', 'baskets', supplier.basketcount) | $raw %], [% ELSE %] - NO NAME + [% supplier.basketcount | html %] [% tn('basket', 'baskets', supplier.basketcount) | $raw %], [% END %] - - - [% IF ( CAN_user_acquisition_order_manage ) %] - [% IF ( supplier.active ) %] - New basket - [% ELSE %] - (inactive) - [% END %] + [% IF supplier.subscriptioncount > 0 %] + + [% supplier.subscriptioncount | html %] [% tn('subscription', 'subscriptions', supplier.subscriptioncount) | $raw %] + + [% ELSE %] + [% supplier.subscriptioncount | html %] [% tn('subscription', 'subscriptions', supplier.subscriptioncount) | $raw %] [% END %] - [% IF ( supplier.loop_basket.size ) %] - Receive shipment - [% END %] + [% IF ( count == 1 ) %] + [% IF ( supplier.basketcount > 0 ) %] +
+ [% IF ( allbaskets ) %] + Show active baskets only + [% ELSE %] + Show all baskets + [% END %] +
+ [% END %] + [% ELSE %] + [% INCLUDE "acquisitions-toolbar.inc" booksellerid=supplier.booksellerid active=supplier.active basketcount=supplier.loop_basket.size basketcount=supplier.basketcount subscriptioncount=supplier.subscriptioncount %] + [% END %] +
[% IF ( supplier.loop_basket.size ) %] @@ -195,7 +219,13 @@
[% ELSE %] -

No pending baskets

+

+ No pending baskets. + [% IF ( supplier.basketcount > 0 && count > 1 ) %] + View all baskets. + [% END %] +

+ [% END %][%# IF ( supplier.loop_basket.size ) %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -431,6 +431,7 @@ [% MACRO jsinclude BLOCK %] [% Asset.js("js/acquisitions-menu.js") | $raw %] [% Asset.js("lib/hc-sticky.js") | $raw %] + [% Asset.js("js/acq.js") | $raw %] [% INCLUDE 'datatables.inc' %]