From 17413ebf7028ce8687c3979526446d19ba899569 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. --- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 51 ++++++++++++++++----- opac/opac-modrequest-suspend.pl | 16 +++++-- 2 files changed, 50 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 31d6c32..de4c892 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("
"+_("Renew selected")+" "+_("Renew all")+"
");[% 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,25 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% END %] + [% IF SuspendHoldsOpac %] + + [% END %] [% END %] @@ -442,7 +469,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 ec15265..e153538 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"); -- 1.7.2.5
Holds ([% reserves_count %] total)
Title Placed onNotesExpires onNotesExpires on Pick up locationPriorityPriorityStatusModify
ModifySuspend individual holds
+
+ + + [% IF RESERVE.suspend %] + + [% ELSE %] + + + [% IF AutoResumeSuspendedHolds %] + + + Clear date

+ [% END %] + [% END %] +
+