From 141fb8994fde8af1a1904bfc5219f7291d81c079 Mon Sep 17 00:00:00 2001 From: senator Date: Mon, 14 Feb 2011 10:39:54 -0500 Subject: [PATCH] hold placement works better --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 7 ++++--- Open-ILS/web/templates/default/opac-poc/place_hold.tt2 | 6 +++--- Open-ILS/web/templates/default/opac/parts/place_hold.tt2 | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index f303af7941..203b5a08dd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -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 diff --git a/Open-ILS/web/templates/default/opac-poc/place_hold.tt2 b/Open-ILS/web/templates/default/opac-poc/place_hold.tt2 index 91996ad3c0..bfbee071a3 100644 --- a/Open-ILS/web/templates/default/opac-poc/place_hold.tt2 +++ b/Open-ILS/web/templates/default/opac-poc/place_hold.tt2 @@ -23,9 +23,9 @@
Choose a pickup Library [% PROCESS build_org_selector name='pickup_lib' value=ctx.default_pickup_lib %] - - - + + +
[% END %] diff --git a/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 b/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 index b91d3b7817..7c99ec0277 100644 --- a/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/place_hold.tt2 @@ -38,6 +38,21 @@ [% l("Checking for possibility of hold fulfillment...") %]
+ [% IF ctx.hold_success %] +
[% l("Hold was successfully placed"); %]
+ [% ELSIF ctx.hold_failed %] +
[% l("Hold was not successfully placed"); %]
+ [% IF ctx.hold_failed_event %] +
+ Problem: + + [% ctx.hold_failed_event.desc || + ctx.hold_failed_event.payload.fail_part || + ctx.hold_failed_event.textcode %] + +
+ [% END; + ELSE %]

* For best possible service, we recommend keeping a printed copy of your most recent holds list.

+ [% END # ctx.hold_success %] -- 2.11.0