From: senator Date: Wed, 6 Oct 2010 21:01:42 +0000 (+0000) Subject: New way to printing shelf-expired holds X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=027a7d0983b6ff376b3d87120710d63b9339e225;p=evergreen%2Ftadl.git New way to printing shelf-expired holds This just takes the newest template for printing hold pull lists and grafts this new functionality onto it. It should perhaps be adjusted to also be able to print things on the holds shelf that /aren't/ shelf-expired. For now you get to this under Admin -> For Developers -> Local Administration This also corrects a bug because of which a "print pull list (alternate strategy)" button appeared where it shouldn't. This also removes the booking links from Admin -> For Developers -> Local Administration, as there are regular staff client menu entries for those now. git-svn-id: svn://svn.open-ils.org/ILS/trunk@18215 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 924d653c14..ebdaf5332a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1749,8 +1749,8 @@ sub fetch_captured_holds { my( $self, $conn, $auth, $org ) = @_; my $e = new_editor(authtoken => $auth); - return $e->event unless $e->checkauth; - return $e->event unless $e->allowed('VIEW_HOLD'); # XXX rely on editor perm + return $e->die_event unless $e->checkauth; + return $e->die_event unless $e->allowed('VIEW_HOLD'); # XXX rely on editor perm $org ||= $e->requestor->ws_ou; @@ -1803,6 +1803,84 @@ sub fetch_captured_holds { } __PACKAGE__->register_method( + method => "print_expired_holds_stream", + api_name => "open-ils.circ.captured_holds.expired.print.stream", + stream => 1 +); + +sub print_expired_holds_stream { + my ($self, $client, $auth, $params) = @_; + + # No need to check specific permissions: we're going to call another method + # that will do that. + my $e = new_editor("authtoken" => $auth); + return $e->die_event unless $e->checkauth; + + delete($$params{org_id}) unless (int($$params{org_id})); + delete($$params{limit}) unless (int($$params{limit})); + delete($$params{offset}) unless (int($$params{offset})); + delete($$params{chunk_size}) unless (int($$params{chunk_size})); + delete($$params{chunk_size}) if ($$params{chunk_size} && $$params{chunk_size} > 50); # keep the size reasonable + $$params{chunk_size} ||= 10; + + $$params{org_id} = (defined $$params{org_id}) ? $$params{org_id}: $e->requestor->ws_ou; + + my @hold_ids = $self->method_lookup( + "open-ils.circ.captured_holds.id_list.expired_on_shelf.retrieve" + )->run($auth, $params->{"org_id"}); + + if (!@hold_ids) { + $e->disconnect; + return; + } elsif (defined $U->event_code($hold_ids[0])) { + $e->disconnect; + return $hold_ids[0]; + } + + $logger->info("about to stream back up to " . scalar(@hold_ids) . " expired holds"); + + while (@hold_ids) { + my @hid_chunk = splice @hold_ids, 0, $params->{"chunk_size"}; + + my $result_chunk = $e->json_query({ + "select" => { + "acp" => ["barcode"], + "au" => [qw/ + first_given_name second_given_name family_name alias + /], + "acn" => ["label"], + "bre" => ["marc"], + "acpl" => ["name"] + }, + "from" => { + "ahr" => { + "acp" => { + "field" => "id", "fkey" => "current_copy", + "join" => { + "acn" => { + "field" => "id", "fkey" => "call_number", + "join" => { + "bre" => { + "field" => "id", "fkey" => "record" + } + } + }, + "acpl" => {"field" => "id", "fkey" => "location"} + } + }, + "au" => {"field" => "id", "fkey" => "usr"} + } + }, + "where" => {"+ahr" => {"id" => \@hid_chunk}} + }) or return $e->die_event; + $client->respond($result_chunk); + } + + $e->disconnect; + undef; +} + +__PACKAGE__->register_method( method => "check_title_hold_batch", api_name => "open-ils.circ.title_hold.is_possible.batch", stream => 1, diff --git a/Open-ILS/web/opac/extras/circ/alt_holds_print.html b/Open-ILS/web/opac/extras/circ/alt_holds_print.html new file mode 100644 index 0000000000..370aa98ee0 --- /dev/null +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.html @@ -0,0 +1,241 @@ + + + Printable Pull List + + + + + + + + + + + + + + + + + + + +
+
No results
+ + + + + + + + + + + + + + + + + + + + + + + +
TitleAuthorShelving LocationCall NumberBarcodePatron
${current_copy.location.name}${current_copy.call_number.label}${current_copy.barcode}${usr.display_name}
+ + + + + + diff --git a/Open-ILS/web/opac/extras/circ/alt_pull_list.html b/Open-ILS/web/opac/extras/circ/alt_pull_list.html deleted file mode 100644 index 966ee4053d..0000000000 --- a/Open-ILS/web/opac/extras/circ/alt_pull_list.html +++ /dev/null @@ -1,142 +0,0 @@ - - - Printable Pull List - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
TitleAuthorShelving LocationCall NumberBarcode
${current_copy.location.name}${current_copy.call_number.label}${current_copy.barcode}
- - - - - - diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 8b2b60645f..d507abbf25 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1904,6 +1904,7 @@ + @@ -1915,14 +1916,6 @@ - - - - - - - - diff --git a/Open-ILS/xul/staff_client/server/admin/index.xhtml b/Open-ILS/xul/staff_client/server/admin/index.xhtml index aa01bc578b..60a3327ef3 100644 --- a/Open-ILS/xul/staff_client/server/admin/index.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/index.xhtml @@ -24,10 +24,7 @@ function getBuildId() { return location.href.match(/\/xul\/(.+?)\/server\//)[1]; } function my_init() { - try { - dojo.require("dojo.cookie"); - window.xulG.auth = {"session": {"key": dojo.cookie("ses")}}; - } catch(E) { /* XXX ignorable except for booking links */ } + ; }