Bugzilla – Attachment 52371 Details for
Bug 16640
Move actions on acquisitions receipt summary page into menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16640 - Move actions on acquisitions receipt summary page into menu
Bug-16640---Move-actions-on-acquisitions-receipt-s.patch (text/plain), 19.19 KB, created by
Owen Leonard
on 2016-06-14 13:58:35 UTC
(
hide
)
Description:
Bug 16640 - Move actions on acquisitions receipt summary page into menu
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-06-14 13:58:35 UTC
Size:
19.19 KB
patch
obsolete
>From 0ad07c865f9076151f2005984bbaad9464bae6ac Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 2 Jun 2016 13:00:22 -0400 >Subject: [PATCH] Bug 16640 - Move actions on acquisitions receipt summary page > into menu >Content-Type: text/plain; charset="utf-8" > >This patch moves two groups of links into two menus: MARC and Card >preview into one, Receive, transfer, cancel, etc. into another. > >Also changed: The transfer order pop-up window has been sized down to be >more consistent with other similar pop-ups. Baskets and basket >group links now include the whole name rather than just the number to >make it easier to click. > >To test you must have a basket or baskets with multiple titles on order, >both received and pending. > >- Apply the patch and go to Acquisitions -> Vendor -> Receive shipment > -> Receive a new shipment (or open an existing invoice). >- In the list of pending orders: > - Test the 'View' menu for multiple titles. The 'MARC' and 'Card' menu > items should work correctly. > - Test the 'Actions' menu for the following actions: > - Receive > - Transfer > - Cancel order > - Cancel order and delete catalog record > - Confirm that under some circumstances the 'Cancel order' and 'Cancel > order and delete catalog record' items are disabled. In these cases > hovering over the menu items should trigger a tooltip. An > explanation should be displayed in red at the bottom of the menu. > Clicking the menu item should trigger an alert with the explanation. >--- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 174 ++++++++++++++------- > 1 file changed, 119 insertions(+), 55 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index c66f2f2..59c570b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -117,6 +117,13 @@ > $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > }); > >+ $("li.disabled a,li.message a").on("click",function(e){ >+ e.preventDefault(); >+ var ordernumber = $(this).data("ordernumber"); >+ if( ordernumber ){ >+ showErrors( ordernumber ); >+ } >+ }).tooltip(); > }); > > // Case-insensitive version of jquery's contains function >@@ -129,18 +136,40 @@ > containsExactly: "$(a).text() == m[3]" > }); > >-//]]> >-</script> >-<script type="text/javascript"> >-//<![CDATA[ >- function transfer_order_popup(ordernumber) { >- var url = "/cgi-bin/koha/acqui/transferorder.pl?" >- + "ordernumber=" + ordernumber >- window.open(url, 'TransferOrder'); >- } >+ function transfer_order_popup(ordernumber) { >+ var url = "/cgi-bin/koha/acqui/transferorder.pl?" >+ + "ordernumber=" + ordernumber >+ window.open(url, 'TransferOrder','width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); >+ } >+ >+ function showErrors( ordernumber ){ >+ var errorstring = _("Cannot cancel or delete order: ") + "\n"; >+ $(".del_error" + ordernumber ).each(function(){ >+ errorstring += "\n" + $(this).text(); >+ }); >+ alert( errorstring ); >+ } > > //]]> > </script> >+<style> >+.dropdown-menu .message > a { >+ clear: both; >+ color: #C30; >+ display: block; >+ font-weight: bold; >+ line-height: 20px; >+ padding: 3px 20px; >+ white-space: nowrap; >+} >+.dropdown-menu .message > a:hover { >+ background-color: #EEE; >+ background-image: none; >+ color: #C00; >+ cursor: default; >+ text-decoration: none; >+} >+</style> > </head> > <body id="acq_parcel" class="acq"> > [% INCLUDE 'header.inc' %] >@@ -257,15 +286,15 @@ > <tbody class="filterclass"> > [% FOREACH loop_order IN loop_orders %] > <tr> >- <td class="basketfilterclass">[% loop_order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a>)</td> >+ <td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketname %] ([% loop_order.basketno %])</a></td> > <td> > [% IF loop_order.basketgroupid %] >- [% loop_order.basketgroupname %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% loop_order.booksellerid %]">[% loop_order.basketgroupid %]</a>) >+ <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% loop_order.booksellerid %]">[% loop_order.basketgroupname %] ([% loop_order.basketgroupid %])</a> > [% ELSE %] > No basket group > [% END %] > </td> >- <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&booksellerid=[% loop_order.booksellerid %]">[% loop_order.ordernumber %]</a></td> >+ <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&booksellerid=[% loop_order.booksellerid %]">Order line [% loop_order.ordernumber %]</a></td> > <td class="summaryfilterclass"> > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a> > [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] >@@ -288,41 +317,64 @@ > [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>] > [% END %] > </td> >- <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" class="previewData">Card</a></td> >+ <td> >+ <div class="dropup"> >+ <a class="btn btn-mini dropdown-toggle" id="viewpending[% loop_order.biblionumber %]" role="button" data-toggle="dropdown" href="#"> >+ View <b class="caret"></b> >+ </a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="viewpending[% loop_order.biblionumber %]"> >+ <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a></li> >+ <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" class="previewData">Card</a></li> >+ </ul> >+ </div> >+ </td> > <td>[% loop_order.quantity %]</td> > <td>[% loop_order.ecost | $Price %]</td> > <td>[% loop_order.total | $Price %]</td> > <td>[% loop_order.budget_name %]</td> >- <td> >- <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&invoiceid=[% invoiceid %]">Receive</a> >- <br /> >- <a href="#" onclick="transfer_order_popup([% loop_order.ordernumber %]); return false;">Transfer</a> >- </td> >- <td> >- [% IF ( loop_order.left_holds_on_order ) %] >- <span class="button" title="Can't cancel order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't cancel order</span><br> >- [% ELSE %] >- <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order</a><br /> >- [% END %] >- [% IF ( loop_order.can_del_bib ) %] >- <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&del_biblio=1&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order and catalog record</a><br /> >- [% ELSE %] >- <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> >- [% END %] >- [% IF ( loop_order.left_item ) %] >- <b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br> >- [% END %] >- [% IF ( loop_order.left_biblio ) %] >- <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br> >- [% END %] >- [% IF ( loop_order.left_subscription ) %] >- <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br> >- [% END %] >- [% IF ( loop_order.left_holds ) %] >- <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b> >- [% END %] >- </td> >- </tr> >+ <td class="actions"> >+ <div class="dropup"> >+ <a class="btn btn-mini dropdown-toggle" id="actions[% loop_order.ordernumber %]" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> >+ </a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="actions[% loop_order.ordernumber %]"> >+ <li><a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&invoiceid=[% invoiceid %]"><i class="fa fa-inbox"></i> Receive</a></li> >+ <li><a href="#" onclick="transfer_order_popup([% loop_order.ordernumber %]); return false;"><i class="fa fa-exchange"></i> Transfer</a></li> >+ >+ [% IF ( loop_order.left_holds_on_order ) %] >+ <li class="disabled"> >+ <a href="#" data-ordernumber="[% loop_order.ordernumber %]" data-toggle="tooltip" data-placement="left" title="Can't cancel order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first"><i class="fa fa-remove"></i> Cancel order</a></li> >+ [% ELSE %] >+ <li><a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]"><i class="fa fa-remove"></i> Cancel order</a></li> >+ [% END %] >+ [% IF ( loop_order.can_del_bib ) %] >+ <li><a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&del_biblio=1&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]"><i class="fa fa-trash"></i> Cancel order and delete catalog record</a></li> >+ [% ELSE %] >+ <li class="disabled"> >+ <a data-ordernumber="[% loop_order.ordernumber %]" data-toggle="tooltip" data-placement="left" title="Can't delete catalog record, see constraints below" href="#"><i class="fa fa-trash"></i> Cancel order and delete catalog record</a> >+ </li> >+ [% END %] >+ [% IF ( loop_order.left_item || loop_order.left_biblio || loop_order.left_subscription || loop_order.left_holds ) %] >+ <li class="divider"></li> >+ [% IF ( loop_order.left_item ) %] >+ <li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</a></li> >+ [% END %] >+ [% IF ( loop_order.left_biblio ) %] >+ <li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</a></li> >+ [% END %] >+ [% IF ( loop_order.left_subscription ) %] >+ <li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</a></li> >+ [% END %] >+ [% IF ( loop_order.left_holds ) %] >+ <li class="message"><a class="del_error[% loop_order.ordernumber %]" href="#" title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</a></li> >+ [% END %] >+ [% END %] >+ </ul> >+ </div> >+ >+ </td> >+ <td> </td> >+ </tr> > [% END %] > </tbody> > </table> >@@ -393,16 +445,16 @@ > <tbody class="filterclass"> > [% FOREACH order IN loop_received %] > <tr> >- <td>[% order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td> >+ <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %] ([% order.basketno %])</a></td> > <td> > [% IF order.basketgroupid %] >- [% order.basketgroupname %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% order.booksellerid %]">[% order.basketgroupid %]</a>) >+ <a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% order.booksellerid %]">[% order.basketgroupname %] ([% order.basketgroupid %])</a> > [% ELSE %] > No basket group > [% END %] > </td> > <td> >- <a href="neworderempty.pl?ordernumber=[% order.ordernumber %]&booksellerid=[% booksellerid %]">[% order.ordernumber %]</a> >+ <a href="neworderempty.pl?ordernumber=[% order.ordernumber %]&booksellerid=[% booksellerid %]">Order line [% order.ordernumber %]</a> > [% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %] > (<a href="neworderempty.pl?ordernumber=[% order.parent_ordernumber %]&booksellerid=[% booksellerid %]" title="Original order line">[% order.parent_ordernumber %]</a>) > [% END %] >@@ -424,14 +476,24 @@ > (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid %]&op=show">suggestion #[% order.suggestionid %]</a>) > [% END %] > </td> >- <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber %]" class="previewData">Card</a></td> >+ <td> >+ <div class="dropup"> >+ <a class="btn btn-mini dropdown-toggle" id="viewreceived[% loop_order.biblionumber %]" role="button" data-toggle="dropdown" href="#"> >+ View <b class="caret"></b> >+ </a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="viewreceived[% loop_order.biblionumber %]"> >+ <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" class="previewData">MARC</a></li> >+ <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber %]" class="previewData">Card</a></li> >+ </ul> >+ </div> >+ </td> > <td>[% order.quantityreceived %]</td> > <td>[% order.budget.budget_name %]</td> > <td>[% order.ecost | $Price %]</td> > <td>[% order.unitprice | $Price %]</td> > <td>[% order.total | $Price %]</td> >- <td> >- [% IF loop_receive.cannot_cancel or ( Koha.Preference("AcqCreateItem") == "receiving" and loop_receive.holds > 0 ) %] >+ [% IF loop_receive.cannot_cancel or ( Koha.Preference("AcqCreateItem") == "receiving" and loop_receive.holds > 0 ) %] >+ <td> > [% IF loop_receive.cannot_cancel %] > [% span_title = BLOCK %] > Cannot cancel receipt of this order line because it >@@ -444,16 +506,18 @@ > [%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %] > [%# Some additional checks should be added in the pl file %] > [% span_title = BLOCK %] >- Cannot cancel receipt of this order line because at least one reservation exists on the records. >+ Cannot cancel receipt of this order line because at least one hold exists on the records. > [% END %] > [% END %] > <span title="[% span_title | collapse %]"> > Can't cancel receipt > </span> >- [% ELSE %] >- <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% order.ordernumber %]">Cancel receipt</a> >- [% END %] >- </td> >+ </td> >+ [% ELSE %] >+ <td class="actions"> >+ <a class="btn btn-mini" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% order.ordernumber %]"><i class="fa fa-remove"></i> Cancel receipt</a> >+ </td> >+ [% END %] > </tr> > [% END %] > </tbody> >@@ -463,7 +527,7 @@ > [% ELSE %]There are no received orders.[% END %] > </div> > >-<div id="dataPreview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> >+<div id="dataPreview" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> > <div class="modal-header"> > <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> > <h3 id="dataPreviewLabel">MARC preview</h3> >-- >2.1.4
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 16640
:
51965
|
52371
|
52399
|
52859