hold placement works better
authorsenator <lebbeous@esilibrary.com>
Mon, 14 Feb 2011 15:39:54 +0000 (10:39 -0500)
committersenator <lebbeous@esilibrary.com>
Mon, 14 Feb 2011 15:39:54 +0000 (10:39 -0500)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/web/templates/default/opac-poc/place_hold.tt2
Open-ILS/web/templates/default/opac/parts/place_hold.tt2

index f303af7..203b5a0 100644 (file)
@@ -675,16 +675,17 @@ sub load_place_hold {
             );
 
             if($stat and $stat > 0) {
-
                 # if successful, return the user to the requesting page
                 $self->apache->log->info("Redirecting back to " . $cgi->param('redirect_to'));
                 $self->apache->print($cgi->redirect(-url => $cgi->param('redirect_to')));
                 return Apache2::Const::REDIRECT;
 
             } else {
-
-                $ctx->{hold_failed} = 1; # XXX process the events, etc
+                $ctx->{hold_failed} = 1;
             }
+        } else { # hold *check* failed
+            $ctx->{hold_failed} = 1; # XXX process the events, etc
+            $ctx->{hold_failed_event} = $allowed->{last_event};
         }
 
         # hold permit failed
index 91996ad..bfbee07 100644 (file)
@@ -23,9 +23,9 @@
     <form action='place_hold' method='POST'>
         Choose a pickup Library [% PROCESS build_org_selector name='pickup_lib' value=ctx.default_pickup_lib %]
         <input type='Submit'/>
-        <input type='hidden' name='hold_target' value='[% CGI.param('hold_target') %]'/>
-        <input type='hidden' name='hold_type' value='[% CGI.param('hold_type') %]'/>
-        <input type='hidden' name='redirect_to' value='[% ctx.referer %]'/>
+        <input type='hidden' name='hold_target' value='[% CGI.param('hold_target') | html %]'/>
+        <input type='hidden' name='hold_type' value='[% CGI.param('hold_type') | html %]'/>
+        <input type='hidden' name='redirect_to' value='[% ctx.referer | html %]'/>
     </form>
     [% END %]
 </div>
index b91d3b7..7c99ec0 100644 (file)
         <b>[% l("Checking for possibility of hold fulfillment...") %]</b>
     </div>
     <div id='holds_box' class='canvas' style='margin-top: 6px;'>
+        [% IF ctx.hold_success %]
+        <div><big><strong>[% l("Hold was successfully placed"); %]</strong></big></div>
+        [% ELSIF ctx.hold_failed %]
+        <div><big><strong>[% l("Hold was not successfully placed"); %]</strong></big></div>
+            [% IF ctx.hold_failed_event %]
+        <div>
+            <strong>Problem:</strong>
+            <span title="[% ctx.hold_failed_event.textcode %]">
+                <em>[% ctx.hold_failed_event.desc ||
+                        ctx.hold_failed_event.payload.fail_part ||
+                        ctx.hold_failed_event.textcode %]</em>
+            </span>
+        </div>
+            [% END;
+        ELSE %]
         <form method="POST">
             <br/>
             <input type="hidden" name="hold_target"
@@ -80,6 +95,7 @@
         </p>
         <p>* For best possible service, we recommend keeping a printed copy of
         your most recent holds list.</p>
+        [% END # ctx.hold_success %]
         <table width='90%' border="1" class="hide_me">
             <tbody>
                 <tr>