From: senator Date: Wed, 6 Oct 2010 21:04:29 +0000 (+0000) Subject: Backport r18215 from trunk: alternate printing for expired holds shelf lists X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=78a379791c13effc332286c2e8377155f47ff5c4;p=evergreen%2Fequinox.git Backport r18215 from trunk: alternate printing for expired holds shelf lists This is slim so that it supports bigger datasets than the usual interface for this. Needs improvment: make the template more customizable git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@18216 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 f2f3c29d1c..41e1d1f4e0 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1900,6 +1900,7 @@ + @@ -1911,14 +1912,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 */ } + ; }