Capture local holds as transits checkin modifier
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 14 Jul 2011 20:49:08 +0000 (16:49 -0400)
committerJason Etheridge <jason@esilibrary.com>
Wed, 27 Jul 2011 20:36:48 +0000 (16:36 -0400)
Capture holds (not already on hold shelf) as transits instead.

Use cases may include:

New material being cataloged before it is "released". If captured normally
before release the shelf expire time would start ticking and notices would go
out.

Checking items in on a closed day. Can capture holds to avoid them being on a
pull list and set them aside to avoid "ready for pickup" notices and ticking
shelf expire clock.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
Open-ILS/xul/staff_client/server/skin/circ.css

index dd114b1..b569ffd 100644 (file)
@@ -537,6 +537,7 @@ my @AUTOLOAD_FIELDS = qw/
     generate_lost_overdue
     clear_expired
     retarget_mode
+    hold_as_transit
 /;
 
 
@@ -2286,6 +2287,9 @@ sub check_transit_checkin_interval {
         )->[0]
     ); 
 
+    # transit from X to X for whatever reason has no min interval
+    return if $self->transit->source == $self->transit->dest;
+
     my $seconds = OpenSRF::Utils->interval_to_seconds($interval);
     my $t_start = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($self->transit->source_send_time));
     my $horizon = $t_start->add(seconds => $seconds);
@@ -2539,7 +2543,7 @@ sub do_checkin {
     
             $logger->debug("circulator: circlib=$circ_lib, workstation=".$self->circ_lib);
     
-            if( $circ_lib == $self->circ_lib) {
+            if( $circ_lib == $self->circ_lib and not ($self->hold_as_transit and $self->remote_hold) ) {
                 # copy is where it needs to be, either for hold or reshelving
     
                 $self->checkin_handle_precat();
@@ -2701,7 +2705,7 @@ sub checkin_check_holds_shelf {
     $logger->info("circulator: we found a captured, un-fulfilled hold [".
         $hold->id. "] for copy ".$self->copy->barcode);
 
-    if( $hold->pickup_lib == $self->circ_lib ) {
+    if( $hold->pickup_lib == $self->circ_lib and not $self->hold_as_transit ) {
         $logger->info("circulator: hold is for here .. we're done: ".$self->copy->barcode);
         return 1;
     }
@@ -2841,7 +2845,7 @@ sub attempt_checkin_hold_capture {
 
     return 0 if $self->bail_out;
 
-    if( $hold->pickup_lib == $self->circ_lib ) {
+    if( $hold->pickup_lib == $self->circ_lib && not $self->hold_as_transit ) {
 
         # This hold was captured in the correct location
         $copy->status(OILS_COPY_STATUS_ON_HOLDS_SHELF);
@@ -3009,8 +3013,9 @@ sub process_received_transit {
 
     my $transit = $self->transit;
 
-    if( $transit->dest != $self->circ_lib ) {
+    if( $transit->dest != $self->circ_lib or ($self->hold_as_transit && $transit->copy_status == OILS_COPY_STATUS_ON_HOLDS_SHELF) ) {
         # - this item is in-transit to a different location
+        # - Or we are capturing holds as transits, so why create a new transit?
 
         my $tid = $transit->id; 
         my $loc = $self->circ_lib;
index 822311f..f9549b8 100644 (file)
 <!ENTITY staff.circ.checkin_overlay.checkin_auto_retarget_all.label "Retarget All Statuses">
 <!ENTITY staff.circ.checkin_overlay.checkin_auto_retarget_all.accesskey "e">
 <!ENTITY staff.circ.checkin_overlay.checkin_auto_retarget_all_ind.label "Always Retarget Local Holds">
+<!ENTITY staff.circ.checkin_overlay.checkin_local_hold_as_transit.label "Capture Local Holds as Transits">
+<!ENTITY staff.circ.checkin_overlay.checkin_local_hold_as_transit.accesskey "L">
 <!ENTITY staff.circ.renew_overlay.background_text "Renew Item">
 <!ENTITY staff.circ.renew_overlay.sel_clip.label "Copy to Clipboard">
 <!ENTITY staff.circ.renew_overlay.sel_clip.accesskey "C">
index 6984150..d967d5a 100644 (file)
@@ -448,6 +448,18 @@ circ.checkin.prototype = {
                         }
                         document.getElementById('checkin_barcode_entry_textbox').focus();
                         return true;
+                    } ],
+                    'cmd_checkin_local_hold_as_transit' : [ ['command'], function(ev) {
+                        dump('in cmd_checkin_local_hold_as_transit\n');
+                        var bg = document.getElementById('background');
+                        var cb = document.getElementById('checkin_local_hold_as_transit');
+                        var ind = document.getElementById('checkin_local_hold_as_transit_indicator');
+                        var cn = 'checkin_screen_checkin_local_hold_as_transit';
+                        if (cb.getAttribute('checked') == 'true') { addCSSClass(bg,cn); } else { removeCSSClass(bg,cn); }
+                        ind.hidden = cb.getAttribute('checked') != 'true'; 
+                        document.getElementById('checkin_barcode_entry_textbox').focus();
+                        return true;
+
                     } ]
                 }
             }
@@ -618,6 +630,9 @@ circ.checkin.prototype = {
                 if (retarget_all) params.retarget_mode = 'retarget.all';
                 else params.retarget_mode = 'retarget';
             }
+            var hold_as_transit = document.getElementById('checkin_local_hold_as_transit');
+            if (hold_as_transit) hold_as_transit = hold_as_transit.getAttribute('checked') == 'true';
+            if (hold_as_transit) params.hold_as_transit = 1;
             circ.util.checkin_via_barcode(
                 ses(), 
                 params,
index 18dff0e..f72fcff 100644 (file)
@@ -37,6 +37,7 @@
     <command id="cmd_checkin_auto_print_slips" />
     <command id="cmd_checkin_clear_shelf_expired" />
     <command id="cmd_checkin_auto_retarget" />
+    <command id="cmd_checkin_local_hold_as_transit" />
 </commandset>
 
 
@@ -79,6 +80,7 @@
                 <description id="checkin_clear_shelf_expired_indicator" hidden="true">&staff.circ.checkin_overlay.checkin_clear_shelf_expired.label;</description>
                 <description id="checkin_auto_retarget_indicator" hidden="true">&staff.circ.checkin_overlay.checkin_auto_retarget.label;</description>
                 <description id="checkin_auto_retarget_all_indicator" hidden="true">&staff.circ.checkin_overlay.checkin_auto_retarget_all_ind.label;</description>
+                <description id="checkin_local_hold_as_transit_indicator" hidden="true">&staff.circ.checkin_overlay.checkin_local_hold_as_transit.label;</description>
             </vbox>
         </vbox>
         <spacer flex="1"/>
                 label="&staff.circ.checkin_overlay.checkin_auto_retarget.label;" accesskey="&staff.circ.checkin_overlay.checkin_auto_retarget.accesskey;"/>
             <menuitem type="checkbox" id="checkin_auto_retarget_all" oils_persist="checked" command="cmd_checkin_auto_retarget"
                 label="&staff.circ.checkin_overlay.checkin_auto_retarget_all.label;" accesskey="&staff.circ.checkin_overlay.checkin_auto_retarget_all.accesskey;"/>
+            <menuitem type="checkbox" id="checkin_local_hold_as_transit" oils_persist="checked" command="cmd_checkin_local_hold_as_transit"
+                label="&staff.circ.checkin_overlay.checkin_local_hold_as_transit.label;" accesskey="&staff.circ.checkin_overlay.checkin_local_hold_as_transit;"/>
         </menupopup>
     </button>
 </hbox>
index d73071f..3472515 100644 (file)
@@ -48,6 +48,7 @@ treechildren::-moz-tree-row(backdate_failed,selected) {
 .checkin_screen_checkin_clear_shelf_expired { }
 .checkin_screen_checkin_auto_retarget { }
 .checkin_screen_checkin_auto_retarget_all { }
+.checkin_screen_checkin_local_hold_as_transit { }
 
 #background-text { font-size: x-large; font-weight: bold; }
 #do_not_alert_on_precat_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
@@ -57,6 +58,7 @@ treechildren::-moz-tree-row(backdate_failed,selected) {
 #checkin_clear_shelf_expired_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
 #checkin_auto_retarget_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
 #checkin_auto_retarget_all_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
+#checkin_local_hold_as_transit_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
 
 .big_emphasis1 { font-weight: bold; font-size: x-large; }
 .big_emphasis2 { font-weight: bold; font-size: large; }