[open-ils-commits] [GIT] Evergreen ILS branch master updated. e266917f012595f72d621b6bb1fb160ede8605f4

Evergreen Git git at git.evergreen-ils.org
Tue Nov 15 11:41:07 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  e266917f012595f72d621b6bb1fb160ede8605f4 (commit)
       via  240c6b11634e1e7b23b9388057b91c4cc3883e10 (commit)
       via  89628336fa54a6418d12f7732960a243abd3151f (commit)
       via  19eedc943cec55f20f944b2ed7656bd7fe65e30f (commit)
       via  fbc13c68b13b704634f0691906d995e1af5b39b8 (commit)
      from  6901876007a52d8c09da3605e85ef461bd06bfb2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e266917f012595f72d621b6bb1fb160ede8605f4
Merge: 6901876 240c6b1
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Nov 15 11:48:15 2011 -0500

    Merge remote-tracking branch 'eg-working/collab/berick/lp_888239_prevent_post-capture_hold_suspend'


commit 240c6b11634e1e7b23b9388057b91c4cc3883e10
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Nov 9 15:55:50 2011 -0500

    TPac; disallow certain actions for captured holds
    
    In the hold edit page, where users can update the pickup library,
    suspend holds, etc. disallow actions that don't make sense for holds
    that have already been captured.  These include suspending the hold and
    changing the expire time.
    
    This patch also replaces the confusing "Cancel" button in the hold edit
    interface (which does not cancel the hold) with a "Go Back" button which
    returns to the holds list.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 b/Open-ILS/src/templates/opac/myopac/holds/edit.tt2
index 7ba1528..fc2d3d9 100644
--- a/Open-ILS/src/templates/opac/myopac/holds/edit.tt2
+++ b/Open-ILS/src/templates/opac/myopac/holds/edit.tt2
@@ -46,6 +46,9 @@
                                 name='pickup_lib' value=ahr.pickup_lib %]
                         </td>
                     </tr>
+                    [% IF hold.hold.status < 3 %]
+                    [%# The following actions cannot be performed on holds that 
+                        have already been captured... %]
                     <tr>
                         <th>
                             [% l('Cancel unless filled by') %]
@@ -89,14 +92,12 @@
                             <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
                         </td>
                     </tr>
+                    [% END %]
                     <tr>
                         <td colspan="2" class="hold-editor-controls">
-                            <input type="submit"
-                                value="[% l('Submit') %]"
-                                class="opac-button" />
-                            <input type="reset"
-                                value="[% l('Cancel') %]"
-                                class="opac-button" />
+                            <a href="[% ctx.opac_root %]/myopac/holds"><button 
+                                class="opac-button">[% l('Go Back') %]</button></a>
+                            <input type="submit" value="[% l('Submit') %]" class="opac-button" />
                         </td>
                     </tr>
                 </table>

commit 89628336fa54a6418d12f7732960a243abd3151f
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Nov 9 15:54:21 2011 -0500

    TPac; batch hold update detects suspension of captured hold
    
    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 at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index f14a200..92ab41e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -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 {
diff --git a/Open-ILS/src/templates/opac/myopac/holds.tt2 b/Open-ILS/src/templates/opac/myopac/holds.tt2
index 279f53c..56327ee 100644
--- a/Open-ILS/src/templates/opac/myopac/holds.tt2
+++ b/Open-ILS/src/templates/opac/myopac/holds.tt2
@@ -61,6 +61,12 @@
                         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") %]

commit 19eedc943cec55f20f944b2ed7656bd7fe65e30f
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Nov 9 15:51:40 2011 -0500

    Prevent hold suspencion for captured holds in API
    
    This codifies at the API layer the standard Evergreen practice of
    disallowing suspension of holds that have already been captured.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/extras/ils_events.xml b/Open-ILS/src/extras/ils_events.xml
index 0297eff..0a8b7a8 100644
--- a/Open-ILS/src/extras/ils_events.xml
+++ b/Open-ILS/src/extras/ils_events.xml
@@ -743,6 +743,9 @@
 	<event code='1714' textcode='HIGH_LEVEL_HOLD_HAS_NO_COPIES'>
 		<desc xml:lang="en-US">A hold request at a higher level than copy has been attempted, but there are no copies that belonging to the higher-level unit.</desc>
 	</event>
+	<event code='1715' textcode='HOLD_SUSPEND_AFTER_CAPTURE'>
+		<desc xml:lang="en-US">Attempt to suspend a hold after it has been captured.</desc>
+	</event>
 
 
 	<event code='2000' textcode='BAD_PARAMS'>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index 27dd1af..3719afc 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -916,14 +916,14 @@ sub update_hold_impl {
 
 
     # --------------------------------------------------------------
-    # See if the hold is getting frozen while in transit.  If so, 
-    # make sure that's allowed.
+    # Disallow hold suspencion if the hold is already captured.
     # --------------------------------------------------------------
-    if ($U->is_true($hold->frozen) and !$U->is_true($orig_hold->frozen)) {
+    if ($U->is_true($hold->frozen) and not $U->is_true($orig_hold->frozen)) {
         $hold_status = _hold_status($e, $hold);
-        if ($hold_status == 3) { # in transit
-        
-       }
+        if ($hold_status > 2) { # hold is captured
+            $logger->info("bypassing hold freeze on captured hold");
+            return OpenILS::Event->new('HOLD_SUSPEND_AFTER_CAPTURE');
+        }
     }
 
 

commit fbc13c68b13b704634f0691906d995e1af5b39b8
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Nov 9 14:08:10 2011 -0500

    prevent suspend in transit initial poking
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index 9ed7f49..27dd1af 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -867,6 +867,7 @@ sub batch_update_hold {
 
 sub update_hold_impl {
     my($self, $e, $hold, $values) = @_;
+    my $hold_status;
 
     unless($hold) {
         $hold = $e->retrieve_action_hold_request($values->{id})
@@ -913,15 +914,28 @@ sub update_hold_impl {
 		return $e->die_event unless $e->allowed('UPDATE_HOLD_REQUEST_TIME', $hold->pickup_lib);
 	}
 
+
+    # --------------------------------------------------------------
+    # See if the hold is getting frozen while in transit.  If so, 
+    # make sure that's allowed.
+    # --------------------------------------------------------------
+    if ($U->is_true($hold->frozen) and !$U->is_true($orig_hold->frozen)) {
+        $hold_status = _hold_status($e, $hold);
+        if ($hold_status == 3) { # in transit
+        
+       }
+    }
+
+
     # --------------------------------------------------------------
     # if the hold is on the holds shelf or in transit and the pickup 
     # lib changes we need to create a new transit.
     # --------------------------------------------------------------
     if($orig_hold->pickup_lib ne $hold->pickup_lib) {
 
-        my $status = _hold_status($e, $hold);
+        $hold_status = _hold_status($e, $hold) unless $hold_status;
 
-        if($status == 3) { # in transit
+        if($hold_status == 3) { # in transit
 
             return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_TRANSIT', $orig_hold->pickup_lib);
             return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_TRANSIT', $hold->pickup_lib);
@@ -937,7 +951,7 @@ sub update_hold_impl {
             $transit->dest($hold->pickup_lib);
             $e->update_action_hold_transit_copy($transit) or return $e->die_event;
 
-        } elsif($status == 4) { # on holds shelf
+        } elsif($hold_status == 4) { # on holds shelf
 
             return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_HOLDS_SHELF', $orig_hold->pickup_lib);
             return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_HOLDS_SHELF', $hold->pickup_lib);

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/extras/ils_events.xml                 |    3 +++
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |   20 +++++++++++++++++---
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |    5 ++++-
 Open-ILS/src/templates/opac/myopac/holds.tt2       |    6 ++++++
 Open-ILS/src/templates/opac/myopac/holds/edit.tt2  |   13 +++++++------
 5 files changed, 37 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list