TPac; batch hold update detects suspension of captured hold
authorBill Erickson <berick@esilibrary.com>
Wed, 9 Nov 2011 20:54:21 +0000 (15:54 -0500)
committerBill Erickson <berick@esilibrary.com>
Wed, 9 Nov 2011 20:54:21 +0000 (15:54 -0500)
If the user attempts to suspend a captured hold via batch hold update,
warn that user af the update the some holds may not have been suspended
and why.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/holds.tt2

index f14a200..92ab41e 100644 (file)
@@ -467,7 +467,10 @@ sub handle_hold_update {
             push(@$vlist, $vals);
         }
 
-        $circ->request('open-ils.circ.hold.update.batch.atomic', $e->authtoken, undef, $vlist)->gather(1);
+        my $resp = $circ->request('open-ils.circ.hold.update.batch.atomic', $e->authtoken, undef, $vlist)->gather(1);
+        $self->ctx->{hold_suspend_post_capture} = 1 if 
+            grep {$U->event_equals($_, 'HOLD_SUSPEND_AFTER_CAPTURE')} @$resp;
+
     } elsif ($action eq 'edit') {
 
         my @vals = map {
index 279f53c..56327ee 100644 (file)
                         alt="Holds Help"
                         src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
                 </td>
+                <td style="padding-left:5px;" class='error'>
+                    [%  IF ctx.hold_suspend_post_capture;
+                            l('One or more holds could not be suspended because<br/>the item is at (or en route to) the pickup library.');
+                        END;
+                    %]
+                </td>
                 <td align="right">
                     [% l("Show") %] &nbsp; &nbsp;
                     [% IF CGI.param("available") %]