Bugzilla – Attachment 51935 Details for
Bug 16421
Move hold edit actions into dropdown menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16421 - Move hold edit actions into dropdown menu
Bug-16421---Move-hold-edit-actions-into-dropdown-m.patch (text/plain), 19.70 KB, created by
Owen Leonard
on 2016-05-31 18:16:57 UTC
(
hide
)
Description:
Bug 16421 - Move hold edit actions into dropdown menu
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-05-31 18:16:57 UTC
Size:
19.70 KB
patch
obsolete
>From 2ea05bf79fafebda6319983a7abd5fff6ed9f2cb Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 2 May 2016 13:35:25 -0400 >Subject: [PATCH] Bug 16421 - Move hold edit actions into dropdown menu >Content-Type: text/plain; charset="utf-8" > >This patch modifies the view of existing holds in the staff client so >that holds-related actions are moved into an 'actions' menu. This >includes priority-reordering controls, suspend, and cancel. > >This patch also modifies the display of details for each hold so that >its suspension or priority status is clear. > >To test, apply the patch and view holds for a title with multiple holds. > >- Test the priority-reordering controls and confirm that they work > correctly. >- Test the "suspend" link and confirm that the suspension form is > displayed correctly in a modal window. > - Confirm that suspensions are saved correctly with and without a > date, and that suspension information is displayed correctly after > saving. >- Test the "Cancel hold" link. >--- > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 7 + > .../prog/en/modules/reserve/request.tt | 202 ++++++++++++++------- > 2 files changed, 144 insertions(+), 65 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index 35fa6f8..c9c0c81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >@@ -2322,6 +2322,13 @@ a.disabled { > color : #999999; > } > >+fieldset.rows li.divider { >+ clear: none; >+ float: none; >+ padding-bottom: 0; >+ width: auto; >+} >+ > .navbar { > color: #333; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index f6e5276..9ef7143 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -13,7 +13,6 @@ > [% INCLUDE 'calendar.inc' %] > <script type="text/javascript"> > // <![CDATA[ >-var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); > var patron_homebranch = "[% borrower_branchname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"; > var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %] > [% itemloo.itemnumber %]: { >@@ -58,7 +57,20 @@ $(document).ready(function() { > "width":"auto", > "margin-right":"0em" > }); >- >+ $(".cancel_hold").on("click", function(){ >+ return confirmDelete( _("Are you sure you want to cancel this hold?") ); >+ }); >+ $(".toggle_suspend").on("click",function(e){ >+ e.preventDefault(); >+ var row = $(this).closest("tr"); >+ var biblionumber = row.find("input[name='biblionumber']").val(); >+ var borrowernumber = row.find("input[name='borrowernumber']").val(); >+ var reserve_id = row.find("input[name='reserve_id']").val(); >+ var reserve_date = row.find("input[name='reserve_date']").val(); >+ var suspend_until = row.find("input[name='suspend_until']").val(); >+ var redirect = "request.pl?action=toggleSuspend&reserve_id=" + reserve_id + "&borrowernumber=" + borrowernumber + "&biblionumber=" + biblionumber + "&date=" + reserve_date + "&suspend_until=" + suspend_until; >+ window.location.href = redirect; >+ }); > }); > > function check() { >@@ -206,6 +218,16 @@ function checkMultiHold() { > > // ]]> > </script> >+<style> >+ .arrow-top { border-top: 2px solid black; } >+ .arrow-bottom { border-bottom: 2px solid black; } >+ .dropdown-menu li > a:hover .arrow-top, >+ .dropdown-menu li > a:focus .arrow-top, >+ .dropdown-menu li > a:hover .arrow-bottom, >+ .dropdown-menu li > a:focus .arrow-bottom { >+ border-color: #ffffff; >+ } >+</style> > </head> > <body id="circ_request" class="catalog"> > [% INCLUDE 'header.inc' %] >@@ -559,7 +581,7 @@ function checkMultiHold() { > [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] > [% IF ( itemloo.canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">[% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]</a>[% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemloo.ExpectedAtLibrary %] > since >- [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="info" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&CancelBorrowerNumber=[% itemloo.ReservedForBorrowernumber %]&CancelItemnumber=[% itemloo.itemnumber %]" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);">Cancel hold</a> >+ [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="cancel_hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&CancelBorrowerNumber=[% itemloo.ReservedForBorrowernumber %]&CancelItemnumber=[% itemloo.itemnumber %]">Cancel hold</a> > > [% END %] > [% ELSE %] >@@ -681,7 +703,6 @@ function checkMultiHold() { > <tr> > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] > <th>Priority</th> >- <th> </th> > [% ELSE %] > <th>Delete?</th> > [% END %] >@@ -691,11 +712,7 @@ function checkMultiHold() { > <th>Expiration</th> > <th>Pickup library</th> > <th>Details</th> >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th> >- [% END %] >- <th> </th> >- [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] >+ <th> </th> > </tr> > [% FOREACH reserveloo IN biblioloo.reserveloop %] > <tr> >@@ -703,6 +720,7 @@ function checkMultiHold() { > <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" /> > <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" /> > <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" /> >+ <input type="hidden" name="reserve_date" value="[% reserveloo.date %]" /> > <select name="rank-request"> > [% IF ( reserveloo.found ) %] > [% IF ( reserveloo.intransit ) %] >@@ -726,27 +744,6 @@ function checkMultiHold() { > <option value="del">del</option> > </select> > </td> >- >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <td style="white-space:nowrap;"> >- <a title="Move hold up" href="request.pl?action=move&where=up&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" /> >- </a> >- >- <a title="Move hold to top" href="request.pl?action=move&where=top&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" /> >- </a> >- >- <a title="Move hold to bottom" href="request.pl?action=move&where=bottom&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" /> >- </a> >- >- <a title="Move hold down" href="request.pl?action=move&where=down&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" /> >- </a> >- </td> >- [% END %] >- > <td> > <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" > > [% IF ( reserveloo.hidename ) %] >@@ -790,18 +787,22 @@ function checkMultiHold() { > </select> > [% END %] > </td> >- <td> >+ <td class="circmessage"> >+ <ul> > [% IF ( reserveloo.found ) %] >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]"> >+ <li> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]"> > [% IF ( reserveloo.barcodenumber ) %] > [% reserveloo.barcodenumber %] > <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" /> > [% ELSE %] > No barcode > [% END %] >- </a> >+ </a> >+ </li> > [% ELSE %] > [% IF ( reserveloo.item_level_hold ) %] >+ <li> > <i>Only item > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]"> > [% IF ( reserveloo.barcodenumber ) %] >@@ -812,50 +813,121 @@ function checkMultiHold() { > [% END %] > </a> > </i> >+ </li> > [% ELSE %] > [% IF reserveloo.itemtype %] >- <i>Next available [% ItemTypes.GetDescription( reserveloo.itemtype ) %] item</i> >+ <li> >+ <i>Next available [% ItemTypes.GetDescription( reserveloo.itemtype ) %] item</i> >+ </li> > [% ELSE %] >- <i>Next available</i> >+ <li> >+ <i>Next available</i> >+ </li> > [% END %] >- <input type="hidden" name="itemnumber" value="" /> > [% END %] > [% END %] >+ [% IF ( reserveloo.suspend ) %] >+ [% IF ( reserveloo.suspend_until ) %] >+ <li>Suspended until [% reserveloo.suspend_until|$KohaDates %]</li> >+ [% ELSE %] >+ <li>Suspended</li> >+ [% END %] >+ [% END %] >+ [% IF ( reserveloo.lowestPriority ) %] >+ <li>Hold is set to lowest priority.</li> >+ [% END %] >+ </ul> >+ [% UNLESS ( reserveloo.item_level_hold ) %]<input type="hidden" name="itemnumber" value="" />[% END %] > </td> > >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] > <td> >- <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- [% IF ( reserveloo.lowestPriority ) %] >- <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" /> >- [% ELSE %] >- <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" /> >- [% END %] >- </a> >- </td> >- [% END %] >- >- <td> >- <a title="Cancel hold" href="request.pl?action=cancel&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" /> >+ <div class="dropup"> >+ <a class="btn btn-mini dropdown-toggle" id="holdactions[% reserveloo.reserve_id %]" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> > </a> >- </td> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="holdactions[% reserveloo.reserve_id %]"> >+ >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ <li> >+ <a href="request.pl?action=move&where=up&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >+ <i class="fa fa-fw fa-arrow-up"></i> Move hold up >+ </a> >+ </li> >+ <li> >+ <a href="request.pl?action=move&where=top&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >+ <i class="fa fa-fw fa-arrow-up arrow-top"></i> Move hold to top >+ </a> >+ </li> >+ <li> >+ <a href="request.pl?action=move&where=bottom&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >+ <i class="fa fa-fw fa-arrow-down arrow-bottom"></i> Move hold to bottom >+ </a> >+ </li> >+ <li> >+ <a href="request.pl?action=move&where=down&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >+ <i class="fa fa-fw fa-arrow-down"></i> Move hold down >+ </a> >+ </li> >+ <li class="divider"></li> >+ [% END %] > >- [% IF SuspendHoldsIntranet %] >- <td> >- [% UNLESS ( reserveloo.found ) %] >- <input type="button" value="[% IF ( reserveloo.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&reserve_id=[% reserveloo.reserve_id %]&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&date=[% reserveloo.date %]&suspend_until=' + $('#suspend_until_[% reserveloo.reserve_id %]').val()" /> >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ <li> >+ <a href="request.pl?action=setLowestPriority&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >+ [% IF ( reserveloo.lowestPriority ) %] >+ <i class="fa fa-fw fa-times-circle"></i> Unset lowest priority >+ [% ELSE %] >+ <i class="fa fa-fw fa-thumb-tack"></i> Set to lowest priority >+ [% END %] >+ </a> >+ </li> >+ [% END %] >+ >+ [% IF SuspendHoldsIntranet %] >+ [% IF reserveloo.suspend %] >+ <li> >+ <a href="request.pl?action=toggleSuspend&reserve_id=[% reserveloo.reserve_id %]&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&date=[% reserveloo.date %]"><i class="fa fa-fw fa-play"></i> Resume</a> >+ </li> >+ [% ELSE %] >+ [% IF AutoResumeSuspendedHolds %] >+ <li> >+ <a href="#suspendModal[% reserveloo.reserve_id %]" role="button" data-toggle="modal"><i class="fa fa-fw fa-pause"></i> Suspend</a> >+ </li> >+ [% ELSE %] >+ <li> >+ <a href="request.pl?action=toggleSuspend&reserve_id=[% reserveloo.reserve_id %]&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&date=[% reserveloo.date %]"><i class="fa fa-fw fa-pause"></i> Suspend</a> >+ </li> >+ [% END # / IF AutoResumeSuspendedHolds %] >+ [% END %] >+ [% END # IF SuspendHoldsIntranet %] >+ >+ <li><a class="cancel_hold" href="request.pl?action=cancel&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"><i class="fa fa-fw fa-trash"></i> Cancel hold</a></li> >+ </ul> >+ </div> >+ [% # hold suspend modal form %] >+ <div id="suspendModal[% reserveloo.reserve_id %]" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% reserveloo.reserve_id %]Label" aria-hidden="true"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >+ [% IF reserveloo.suspend %] >+ <h3 id="suspendModal[% reserveloo.reserve_id %]Label">Resume this hold on <i>[% biblioloo.title %]</i></h3> >+ [% ELSE %] >+ <h3 id="suspendModal[% reserveloo.reserve_id %]Label">Suspend this hold on <i>[% biblioloo.title %]</i></h3> >+ [% END %] >+ </div> >+ <div class="modal-body"> >+ <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" /> >+ <label for="suspend_until_[% reserveloo.reserve_id %]">Suspend until:</label> >+ <input name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" size="10" readonly="readonly" value="[% reserveloo.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" /> >+ <span class="hint">[% INCLUDE "date-format.inc" %]</span> >+ <p><a href="#" class="clear-date" id="clear-date-suspend_until_[% reserveloo.reserve_id %]"><i class="fa fa-remove"></i> Clear date to suspend indefinitely</a></p> >+ </div> >+ <div class="modal-footer"> >+ <button class="btn btn-primary toggle_suspend" type="button">Suspend</button> >+ <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a> >+ </div> >+ </div> <!-- /#suspendModal[% reserveloo.reserve_id %] --> >+ </td> > >- [% IF AutoResumeSuspendedHolds %] >- <label for="suspend_until_[% reserveloo.reserve_id %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label> >- <input name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" size="10" readonly="readonly" value="[% reserveloo.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" /> >- <a href='#' onclick="document.getElementById('suspend_until_[% reserveloo.reserve_id %]').value='';">Clear date</a> >- [% END %] >- [% ELSE %] >- <input type="hidden" name="suspend_until" value="" /> >- [% END %] >- </td> >- [% END # IF SuspendHoldsIntranet %] > > </tr> > >-- >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 16421
:
51111
| 51935