Bugzilla – Attachment 133517 Details for
Bug 28082
Add acquisitions toolbar to vendors on vendor search page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28082: Add acquisitions toolbar to vendors on vendor search page
Bug-28082-Add-acquisitions-toolbar-to-vendors-on-v.patch (text/plain), 15.81 KB, created by
Aleisha Amohia
on 2022-04-21 04:50:53 UTC
(
hide
)
Description:
Bug 28082: Add acquisitions toolbar to vendors on vendor search page
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2022-04-21 04:50:53 UTC
Size:
15.81 KB
patch
obsolete
>From 807c7fe46692f15e1275761351eb93817841785f Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 21 Mar 2022 16:00:47 +0000 >Subject: [PATCH] Bug 28082: Add acquisitions toolbar to vendors on vendor > search page > >This patch makes a number of changes to the vendor search/view template >in order to make it work better in different contexts: > >- 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, apply the patch and rebuild the staff interface CSS >(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). > >- 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. > >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> >--- > 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(-) > >diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl >index 51de25d82b..f2a7f56b1f 100755 >--- a/acqui/booksellers.pl >+++ b/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, > }; > > } >diff --git a/acqui/supplier.pl b/acqui/supplier.pl >index af8fce7135..0e3570780a 100755 >--- a/acqui/supplier.pl >+++ b/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'); >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index 61e41e4a94..5c4dee0aa4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/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; > } > } > } >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 8191a021ff..294a777629 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >@@ -1,12 +1,5 @@ > [% INCLUDE 'blocking_errors.inc' %] > <!-- acquisitions-toolbar.inc --> >-<script> >- function confirm_deletion() { >- if (confirm(_("Are you sure you want to delete this vendor?"))) { >- window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=delete"; >- } >- } >-</script> > <div id="toolbar" class="btn-toolbar"> > [% IF ( booksellerid ) %] > <div class="btn-group"> >@@ -26,12 +19,20 @@ > </ul> > </div> > [% IF ( CAN_user_acquisition_vendors_manage ) %] >- <div class="btn-group"><a class="btn btn-default" id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=enter"><i class="fa fa-pencil"></i> Edit vendor</a></div> >+ <div class="btn-group"> >+ <a class="btn btn-default" id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]&op=enter"><i class="fa fa-pencil"></i> Edit vendor</a> >+ </div> > [% UNLESS ( basketcount OR subscriptioncount ) %] >- <div class="btn-group"><a class="btn btn-default" id="deletesupplier" href="javascript:confirm_deletion()"><i class="fa fa-trash"></i> Delete vendor</a></div> >+ <div class="btn-group"> >+ <form action="/cgi-bin/koha/acqui/supplier.pl" method="post"> >+ <input type="hidden" name="op" value="delete" /> >+ <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" /> >+ <button class="btn btn-default" id="deletesupplier" type="submit"><i class="fa fa-trash"></i> Delete vendor</button> >+ </form> >+ </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-default" id="receive" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid | html %]"><i class="fa fa-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 5741784be0..c1e5fc8af0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >@@ -57,11 +57,11 @@ > [% END %] > </select> > </p> >- [% END %] >- [% IF ( allbaskets ) %] >- <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&booksellerid=[% booksellerid | uri %]">Show active baskets only</a> >- [% ELSE %] >- <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&booksellerid=[% booksellerid | uri %]&allbaskets=1">Show all baskets</a> >+ [% IF ( allbaskets ) %] >+ <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&booksellerid=[% booksellerid | uri %]">Show active baskets only</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&booksellerid=[% booksellerid | uri %]&allbaskets=1">Show all baskets</a> >+ [% END %] > [% END %] > [% UNLESS booksellerid %] > | <a href="#" id="show_active_vendors">Show active vendors only</a><a href="#" id="show_all_vendors">Show all vendors</a> >@@ -73,25 +73,49 @@ > [% ELSE %] > <div class="supplier inactive"> > [% END %] >- <span class="suppliername"> >- [% IF (supplier.name) %] >- <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">[% supplier.name | html %]</a> >+ [% IF ( supplier.active ) %] >+ <h2 class="suppliername"> >+ [% ELSE %] >+ <h2 class="suppliername inactive"> >+ [% END %] >+ <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]"> >+ [% IF (supplier.name) %] >+ [% supplier.name | html %] >+ [% ELSE %] >+ NO NAME >+ [% END %] >+ </a> >+ <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]"></a> >+ [% IF ( !supplier.active ) %]<span class="vendor_inactive">(inactive)</span>[% END %] >+ </h2> >+ <span class="basketcounts"> >+ [% IF ( count > 1 ) %] >+ <a href="/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% supplier.booksellerid | uri %]">[% supplier.basketcount | html %] [% tn('basket', 'baskets', supplier.basketcount) | $raw %]</a>, > [% ELSE %] >- <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">NO NAME</a> >+ [% supplier.basketcount | html %] [% tn('basket', 'baskets', supplier.basketcount) | $raw %], > [% END %] >- </span> >- <span class="action"> >- [% IF ( CAN_user_acquisition_order_manage ) %] >- [% IF ( supplier.active ) %] >- <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid | uri %]&op=add_form"><i class="fa fa-plus"></i> New basket</a> >- [% ELSE %] >- (inactive) >- [% END %] >+ [% IF supplier.subscriptioncount > 0 %] >+ <a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=[% supplier.name | uri %]&searched=1"> >+ [% supplier.subscriptioncount | html %] [% tn('subscription', 'subscriptions', supplier.subscriptioncount) | $raw %] >+ </a> >+ [% ELSE %] >+ [% supplier.subscriptioncount | html %] [% tn('subscription', 'subscriptions', supplier.subscriptioncount) | $raw %] > [% END %] >- [% IF ( supplier.loop_basket.size ) %] >- <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid | uri %]"><i class="fa fa-inbox"></i> Receive shipment</a> >- [% END %] > </span> >+ [% IF ( count == 1 ) %] >+ [% IF ( supplier.basketcount > 0 ) %] >+ <div> >+ [% IF ( allbaskets ) %] >+ <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier.booksellerid | uri %]&booksellerid=[% booksellerid | uri %]">Show active baskets only</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier.booksellerid | uri %]&booksellerid=[% booksellerid | uri %]&allbaskets=1">Show all baskets</a> >+ [% END %] >+ </div> >+ [% END %] >+ [% ELSE %] >+ [% INCLUDE "acquisitions-toolbar.inc" booksellerid=supplier.booksellerid active=supplier.active basketcount=supplier.loop_basket.size basketcount=supplier.basketcount subscriptioncount=supplier.subscriptioncount %] >+ [% END %] >+ > <div class="baskets"> > [% IF ( supplier.loop_basket.size ) %] > <table class="baskets"> >@@ -195,7 +219,13 @@ > </table> > > [% ELSE %] >- <p>No pending baskets</p> >+ <p> >+ No pending baskets. >+ [% IF ( supplier.basketcount > 0 && count > 1 ) %] >+ <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=1&booksellerid=[% supplier.booksellerid | uri %]&allbaskets=1">View all baskets</a>. >+ [% END %] >+ </p> >+ > [% END %][%# IF ( supplier.loop_basket.size ) %] > </div> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >index d15842a45e..0131c0341b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >+++ b/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' %] > <script> > function confirm_deletion() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >index c6c40ceda5..1243a06d13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >@@ -166,6 +166,7 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/acquisitions-menu.js") | $raw %] >+ [% Asset.js("js/acq.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/acq.js b/koha-tmpl/intranet-tmpl/prog/js/acq.js >index 624470113c..89e1ad1fc4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/acq.js >@@ -1,3 +1,6 @@ >+/* global confirmDelete */ >+/* exported uncheckbox isNotNull isNull isNum log calcTotalRow autoFillRow messenger updateCosts calcNewsuggTotal getAuthValueDropbox totalExceedsBudget budgetExceedsParent checkBudgetParent hideColumn showColumn showAllColumns hideAllColumns */ >+ > //======================================================================= > //input validation: > // acqui/uncertainprice.tmpl uses this >@@ -380,3 +383,9 @@ function hideAllColumns(){ > $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns > $("#hideall").prop("checked", true).parent().addClass("selected"); > } >+ >+$(document).ready(function(){ >+ $("#deletesupplier").on("click", function(){ >+ confirmDelete(__("Are you sure you want to delete this vendor?") ); >+ }); >+}); >-- >2.11.0
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 28082
:
131986
|
133517
|
133736