Only if modifier is set and at the pickup library.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
skip_rental_fee
use_booking
generate_lost_overdue
+ clear_expired
/;
$U->copy_status($self->copy->status)->id ==
OILS_COPY_STATUS_ON_HOLDS_SHELF;
+ # Attempt to clear shelf expired holds for this copy
+ $holdcode->method_lookup('open-ils.circ.hold.clear_shelf.process')->run($self->editor->authtoken, $self->circ_lib, $self->copy->id)
+ if($self->clear_expired);
+
# find the hold that put us on the holds shelf
my $holds = $self->editor->search_action_hold_request(
{
);
sub clear_shelf_process {
- my($self, $client, $auth, $org_id) = @_;
+ my($self, $client, $auth, $org_id, $match_copy) = @_;
+
+ my $current_copy = { '!=' => undef };
+ $current_copy = { '=' => $match_copy } if $match_copy;
my $e = new_editor(authtoken=>$auth, xact => 1);
$e->checkauth or return $e->die_event;
fulfillment_time => undef,
shelf_time => {'!=' => undef},
capture_time => {'!=' => undef},
- current_copy => {'!=' => undef},
+ current_copy => $current_copy,
},
{ idlist => 1 }
);
my $copy = $hold->current_copy;
my ($alt_hold) = __PACKAGE__->find_nearest_permitted_hold($e, $copy, $e->requestor, 1);
- if($alt_hold) {
+ if($alt_hold and !$match_copy) {
push(@{$cache_data{hold}}, $hold->id); # copy is needed for a hold
<!ENTITY staff.circ.checkin_overlay.checkin_auto_print_slips.accesskey "P">
<!ENTITY staff.circ.checkin_overlay.checkin_modifiers_btn.label "Checkin Modifiers">
<!ENTITY staff.circ.checkin_overlay.checkin_modifiers_btn.accesskey "M">
+<!ENTITY staff.circ.checkin_overlay.checkin_clear_shelf_expired.label "Clear Shelf-Expired Holds">
+<!ENTITY staff.circ.checkin_overlay.checkin_clear_shelf_expired.accesskey "C">
<!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">
ind.hidden = cb.getAttribute('checked') != 'true';
document.getElementById('checkin_barcode_entry_textbox').focus();
return true;
+ } ],
+ 'cmd_checkin_clear_shelf_expired' : [ ['command'], function(ev) {
+ dump('in cmd_checkin_clear_shelf_expired\n');
+ var bg = document.getElementById('background');
+ var cb = document.getElementById('checkin_clear_shelf_expired');
+ var ind = document.getElementById('checkin_clear_shelf_expired_indicator');
+ var cn = 'checkin_screen_checkin_clear_shelf_expired';
+ 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;
} ]
}
}
var amnesty_mode = document.getElementById('amnesty_mode');
if (amnesty_mode) amnesty_mode = amnesty_mode.getAttribute('checked') == 'true';
if (amnesty_mode) params.void_overdues = 1;
+ var clear_shelf_expired_holds = document.getElementById('checkin_clear_shelf_expired');
+ if (clear_shelf_expired_holds) clear_shelf_expired_holds = clear_shelf_expired_holds.getAttribute('checked') == 'true';
+ if (clear_shelf_expired_holds) params.clear_expired = 1;
circ.util.checkin_via_barcode(
ses(),
params,
<command id="cmd_suppress_holds_and_transits" />
<command id="cmd_amnesty_mode" />
<command id="cmd_checkin_auto_print_slips" />
+ <command id="cmd_checkin_clear_shelf_expired" />
</commandset>
<description id="suppress_holds_and_transits_indicator" hidden="true">&staff.circ.checkin_overlay.suppress_holds_and_transits.label;</description>
<description id="amnesty_mode_indicator" hidden="true">&staff.circ.checkin_overlay.amnesty_mode.label;</description>
<description id="checkin_auto_print_slips_indicator" hidden="true">&staff.circ.checkin_overlay.checkin_auto_print_slips.label;</description>
+ <description id="checkin_clear_shelf_expired_indicator" hidden="true">&staff.circ.checkin_overlay.checkin_clear_shelf_expired.label;</description>
</vbox>
</vbox>
<spacer flex="1"/>
label="&staff.circ.checkin_overlay.amnesty_mode.label;" accesskey="&staff.circ.checkin_overlay.amnesty_mode.accesskey;"/>
<menuitem type="checkbox" id="checkin_auto_print_slips" oils_persist="checked" command="cmd_checkin_auto_print_slips"
label="&staff.circ.checkin_overlay.checkin_auto_print_slips.label;" accesskey="&staff.circ.checkin_overlay.checkin_auto_print_slips.accesskey;"/>
+ <menuitem type="checkbox" id="checkin_clear_shelf_expired" oils_persist="checked" command="cmd_checkin_clear_shelf_expired"
+ label="&staff.circ.checkin_overlay.checkin_clear_shelf_expired.label;" accesskey="&staff.circ.checkin_overlay.checkin_clear_shelf_expired.accesskey;"/>
</menupopup>
</button>
</hbox>
.checkin_screen_suppress_holds_and_transits { }
.checkin_screen_amnesty_mode { }
.checkin_screen_checkin_auto_print_slips { }
+.checkin_screen_checkin_clear_shelf_expired { }
#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; }
#suppress_holds_and_transits_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
#amnesty_mode_indicator { border: thick solid white; background-color: red; color: white; font-size: large; font-weight: bold; padding: 10px; padding-bottom: 25px; margin: 10px; }
#checkin_auto_print_slips_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; }
+#checkin_clear_shelf_expired_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; }