From 35178764ca1fc824bcb670be65d15bd7a930abf0 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Thu, 14 Jul 2011 16:49:08 -0400 Subject: [PATCH] Capture local holds as transits checkin modifier 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 Signed-off-by: Jason Etheridge --- .../perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 13 +++++++++---- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ Open-ILS/xul/staff_client/server/circ/checkin.js | 15 +++++++++++++++ Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul | 4 ++++ Open-ILS/xul/staff_client/server/skin/circ.css | 2 ++ 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index dd114b1b90..b569ffd23e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -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; diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 822311f28f..f9549b87fc 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2222,6 +2222,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 6984150f44..d967d5a137 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -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, diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index 18dff0ed3f..f72fcff023 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -37,6 +37,7 @@ + @@ -79,6 +80,7 @@ + @@ -184,6 +186,8 @@ label="&staff.circ.checkin_overlay.checkin_auto_retarget.label;" accesskey="&staff.circ.checkin_overlay.checkin_auto_retarget.accesskey;"/> + diff --git a/Open-ILS/xul/staff_client/server/skin/circ.css b/Open-ILS/xul/staff_client/server/skin/circ.css index d73071f34f..347251504d 100644 --- a/Open-ILS/xul/staff_client/server/skin/circ.css +++ b/Open-ILS/xul/staff_client/server/skin/circ.css @@ -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; } -- 2.11.0