From 489390cb9b0ac1fb110b2e97bfdaa380daa3d61e Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 18 May 2011 01:05:17 -0400 Subject: [PATCH] Include call number prefix/suffix in display and sorting of holds for Print Full Pull List (Alternate strategy). Also fix things so that we're sorting on the label_sortkey for call number, and not the label. So, for this interface, the hard-wired sort order is Copy Location Order (as defined by Admin -> Local Administration -> Copy Location Order), Call Number Prefix, Call Number Label, Call Number Suffix, and Hold Request time. Signed-off-by: Jason Etheridge --- .../lib/OpenILS/Application/Circ/Holds.pm | 22 +++++++++++++++---- .../web/opac/extras/circ/alt_holds_print.html | 4 ++-- .../web/opac/extras/circ/alt_holds_print.js | 2 ++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index f56a52da4e..03f947fcb5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1348,7 +1348,7 @@ __PACKAGE__->register_method( desc => 'Returns a stream of fleshed holds', params => [ { desc => 'Authtoken', type => 'string'}, - { desc => 'Hash of optional param: Org unit ID (defaults to workstation org unit), limit, offset, sort (array of: acplo.position, call_number, request_time)', + { desc => 'Hash of optional param: Org unit ID (defaults to workstation org unit), limit, offset, sort (array of: acplo.position, prefix, call_number, suffix, request_time)', type => 'object' }, ], @@ -1383,8 +1383,12 @@ sub print_hold_pull_list_stream { "class" => "acplo", "field" => "position", "transform" => "coalesce", "params" => [999] }; + } elsif ($s eq 'prefix') { + push @$sort, {"class" => "acnp", "field" => "label_sortkey"}; } elsif ($s eq 'call_number') { - push @$sort, {"class" => "acn", "field" => "label"}; + push @$sort, {"class" => "acn", "field" => "label_sortkey"}; + } elsif ($s eq 'suffix') { + push @$sort, {"class" => "acns", "field" => "label_sortkey"}; } elsif ($s eq 'request_time') { push @$sort, {"class" => "ahr", "field" => "request_time"}; } @@ -1407,7 +1411,17 @@ sub print_hold_pull_list_stream { "join" => { "acn" => { "field" => "id", - "fkey" => "call_number" + "fkey" => "call_number", + "join" => { + "acnp" => { + "field" => "id", + "fkey" => "prefix" + }, + "acns" => { + "field" => "id", + "fkey" => "suffix" + } + } }, "acplo" => { "field" => "org", @@ -1448,7 +1462,7 @@ sub print_hold_pull_list_stream { "ahr" => ["usr", "current_copy"], "au" => ["card"], "acp" => ["location", "call_number"], - "acn" => ["record"] + "acn" => ["record","prefix","suffix"] } } ]); diff --git a/Open-ILS/web/opac/extras/circ/alt_holds_print.html b/Open-ILS/web/opac/extras/circ/alt_holds_print.html index 405aaedcb5..5801df24f2 100644 --- a/Open-ILS/web/opac/extras/circ/alt_holds_print.html +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.html @@ -31,7 +31,7 @@ @@ -93,7 +93,7 @@ ${current_copy.location.name} - ${current_copy.call_number.label} + ${current_copy.call_number.prefix.label} ${current_copy.call_number.label} ${current_copy.call_number.suffix.label} ${current_copy.barcode} diff --git a/Open-ILS/web/opac/extras/circ/alt_holds_print.js b/Open-ILS/web/opac/extras/circ/alt_holds_print.js index 31a21c175a..a3f0378ef7 100644 --- a/Open-ILS/web/opac/extras/circ/alt_holds_print.js +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.js @@ -35,6 +35,8 @@ function do_pull_list() { hold.current_copy.location = hold_fm.current_copy().location().toHash(true); hold.current_copy.call_number = hold_fm.current_copy().call_number().toHash(true); hold.current_copy.call_number.record = hold_fm.current_copy().call_number().record().toHash(true); + hold.current_copy.call_number.prefix = hold_fm.current_copy().call_number().prefix().toHash(true); + hold.current_copy.call_number.suffix = hold_fm.current_copy().call_number().suffix().toHash(true); // clone the template's html var tr = dojo.clone( -- 2.43.2