LP 1189989: Add suspend option when placing hold
authorBill Ott <bott@grpl.org>
Tue, 20 Aug 2013 15:19:27 +0000 (11:19 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 2 Aug 2017 15:14:04 +0000 (11:14 -0400)
Return of an option from JSPAC, the ability to immediately suspend a
hold when it's placed.

TODO: As noted in the code for editing a hold, a calendar selection
would be preferred to requiring users to enter a valid date manually.

This commit was a patch submitted by Bill Ott to Launchpad in August
2013.  Jason Stephenson applied the patch on April 22, 2017 and
resolved conflicts caused by the addition of a metarecords hold
feature in the TPAC.  The revised patch was committed with the
original author and commit timestamp.

Signed-off-by: Bill Ott <bott@grpl.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/parts/place_hold.tt2

index 9f96bfd..91edcb6 100644 (file)
@@ -1289,6 +1289,11 @@ sub attempt_hold_placement {
 
     my @create_targets = map {$_->{target_id}} (grep { !$_->{hold_failed} } @hold_data);
 
+    my $thaw_date;
+    if ($cgi->param('hold_suspend') && $cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){
+        $thaw_date = "$3-$1-$2";
+    }
+
     if(@create_targets) {
 
         # holdable formats may be different for each MR hold.
@@ -1307,7 +1312,9 @@ sub attempt_hold_placement {
                 patronid => $usr,
                 pickup_lib => $pickup_lib,
                 hold_type => $hold_type,
-                holdable_formats_map => $holdable_formats
+                holdable_formats_map => $holdable_formats,
+                frozen => $cgi->param('hold_suspend'),
+                thaw_date => $thaw_date
             }),
             \@create_targets
         );
index 8bf1713..0a759f0 100644 (file)
                 </blockquote>
                 [% END %]
             </blockquote>
+            <blockquote>
+                <input type="checkbox" name="hold_suspend" value="t"/>[% l('Suspend This Hold?') %]
+            </blockquote>
+            <blockquote>
+                [% l('If suspended, activate on') %]
+               <input type="text" name="thaw_date" value="[% thaw_date | html %]" />
+               <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
+            </blockquote>
         </p>
         <input id="place_hold_submit" type="submit" name="submit" 
             value="[% l('Submit') %]" title="[% l('Submit') %]"