From: Thomas Berezansky Date: Thu, 14 Jul 2011 20:49:08 +0000 (-0400) Subject: Capture local holds as transits checkin modifier X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a9b9e97ba29348e9783901c8b2e57e990dbaf968;p=working%2FEvergreen.git 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 --- 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 34edd6f8a4..b46021f422 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -536,6 +536,7 @@ my @AUTOLOAD_FIELDS = qw/ generate_lost_overdue clear_expired retarget_mode + hold_as_transit /; @@ -2242,6 +2243,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); @@ -2495,7 +2499,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(); @@ -2657,7 +2661,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; } @@ -2797,7 +2801,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); @@ -2965,8 +2969,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 c3e6833629..370893a3d0 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 b6872c06af..ccda46aeb1 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -449,6 +449,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; + } ] } } @@ -619,6 +631,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; }