From 52d4922afa34596796e59b03a255c2681429e68b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 21 Aug 2013 07:30:54 -0400 Subject: [PATCH] Bug 10774: Allow individual holds to be suspended and resumed from the OPAC Right now, holds can only be suspended and resumed from the OPAC as a whole. It would be nice to be able to suspend and resume holds on a hold by hold basis from the OPAC. Test Plan: 1) Apply this patch 2) Log in to the OPAC 3) Place a number of holds 4) Browse to "my summary" and select the holds tab 5) From here, test the following actions a) Suspend a hold indefinitely ( no resume date ) b) Suspend a hold with a date to automatically resume c) Manually resume a suspended hold 6) Disable AutoResumeSuspendedHolds, ensure the suspend until date field is no longer visible. 7) Disable SuspendHoldsOpac, ensure all suspension related fields are no longer visible. Signed-off-by: Chris Rohde Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- .../opac-tmpl/prog/en/modules/opac-user.tt | 53 ++++++++++++++----- opac/opac-modrequest-suspend.pl | 16 ++++-- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 12b9f23bf7..62a852bc52 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -47,7 +47,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended $("#renewall").submit(); }); $("#checkoutst caption").append("");[% END %] - $( "#suspend_until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future + $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future }); //]]> @@ -351,20 +351,28 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
- - + + + + - [% IF OpacHoldNotes %][% END %] - + [% IF OpacHoldNotes %] + + [% END %] + - [% IF ( showpriority ) %] - - [% END %] + [% IF ( showpriority ) %] + + [% END %] - - - + + [% IF SuspendHoldsOpac %] + + [% END %] + + + [% FOREACH RESERVE IN RESERVES %] [% IF ( RESERVE.wait ) %] [% IF ( RESERVE.atdestination ) %] @@ -428,6 +436,27 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% END %] + [% IF SuspendHoldsOpac %] + + [% END %] [% END %] @@ -442,7 +471,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% IF AutoResumeSuspendedHolds %] - + Clear date

[% END %] diff --git a/opac/opac-modrequest-suspend.pl b/opac/opac-modrequest-suspend.pl index ec152659dd..e1535385c2 100755 --- a/opac/opac-modrequest-suspend.pl +++ b/opac/opac-modrequest-suspend.pl @@ -36,11 +36,17 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $suspend = $query->param('suspend'); my $suspend_until = $query->param('suspend_until') || undef; +my $reserve_id = $query->param('reserve_id'); -SuspendAll( - borrowernumber => $borrowernumber, - suspend => $suspend, - suspend_until => $suspend_until, -); +if ($reserve_id) { + ToggleSuspend( $reserve_id, $suspend_until ); +} +else { + SuspendAll( + borrowernumber => $borrowernumber, + suspend => $suspend, + suspend_until => $suspend_until, + ); +} print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds"); -- 2.39.5
Holds ([% reserves_count %] total)
Title Placed onNotesExpires onNotesExpires on Pick up locationPriorityPriorityStatusModify
ModifySuspend individual holds
+ [% IF ( RESERVE.cancelable ) %] +
+ + + [% IF RESERVE.suspend %] + + [% ELSE %] + + + [% IF AutoResumeSuspendedHolds %] + + + Clear date + [% END %] + [% END %] +
+ [% END %] +