From 617e313d991dcc1cbc60d89685f3d95d1d5fb40a Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 6 Jul 2011 12:05:58 -0400 Subject: [PATCH] Add "parts" to Print Full Pull List and Print Full Pull List (Alternate strategy) Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- .../perlmods/lib/OpenILS/Application/Circ/Holds.pm | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 20 ++++-- .../upgrade/xxx.data.hold_pull_list_template.sql | 79 ++++++++++++++++++++++ Open-ILS/web/opac/extras/circ/alt_holds_print.html | 4 +- Open-ILS/web/opac/extras/circ/alt_holds_print.js | 5 ++ 5 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxx.data.hold_pull_list_template.sql 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 651e9b52ad..0a056ac9c5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1560,7 +1560,7 @@ sub print_hold_pull_list_stream { "flesh_fields" => { "ahr" => ["usr", "current_copy"], "au" => ["card"], - "acp" => ["location", "call_number"], + "acp" => ["location", "call_number", "parts"], "acn" => ["record","prefix","suffix"] } } diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index c7372edcf5..c739b95538 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -8407,11 +8407,11 @@ INSERT INTO action_trigger.event_definition ( $$ [%- USE date -%] -[% +[% # Sort the holds into copy-location buckets # In the main print loop, sort each bucket by callnumber before printing SET holds_list = []; @@ -8438,14 +8438,14 @@ $$ Author Shelving Location Call Number - Barcode + Barcode/Part Patron [% FOR loc_data IN holds_list %] [% FOR hold_data IN loc_data.sort('callnumber') %] - [% + [% SET hold = hold_data.hold; SET copy_data = helpers.get_copy_bib_basics(hold.current_copy.id); %] @@ -8454,7 +8454,11 @@ $$ [% copy_data.author | truncate %] [% hold.current_copy.location.name %] [% hold.current_copy.call_number.label %] - [% hold.current_copy.barcode %] + [% hold.current_copy.barcode %] + [% FOR part IN hold.current_copy.parts %] + [% part.part.label %] + [% END %] + [% hold.usr.card.barcode %] [% END %] @@ -8471,7 +8475,9 @@ INSERT INTO action_trigger.environment ( (35, 'current_copy.location'), (35, 'current_copy.call_number'), (35, 'usr.card'), - (35, 'pickup_lib') + (35, 'pickup_lib'), + (35, 'current_copy.parts'), + (35, 'current_copy.parts.part') ; -- 0386.data.org-setting-patron-clone-copy-addr.sql diff --git a/Open-ILS/src/sql/Pg/upgrade/xxx.data.hold_pull_list_template.sql b/Open-ILS/src/sql/Pg/upgrade/xxx.data.hold_pull_list_template.sql new file mode 100644 index 0000000000..32c9460168 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxx.data.hold_pull_list_template.sql @@ -0,0 +1,79 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('xxxx'); + +UPDATE action_trigger.event_definition SET template = +$$ +[%- USE date -%] + +[% + # Sort the holds into copy-location buckets + # In the main print loop, sort each bucket by callnumber before printing + SET holds_list = []; + SET loc_data = []; + SET current_location = target.0.current_copy.location.id; + FOR hold IN target; + IF current_location != hold.current_copy.location.id; + SET current_location = hold.current_copy.location.id; + holds_list.push(loc_data); + SET loc_data = []; + END; + SET hold_data = { + 'hold' => hold, + 'callnumber' => hold.current_copy.call_number.label + }; + loc_data.push(hold_data); + END; + holds_list.push(loc_data) +%] + + + + + + + + + + + + + [% FOR loc_data IN holds_list %] + [% FOR hold_data IN loc_data.sort('callnumber') %] + [% + SET hold = hold_data.hold; + SET copy_data = helpers.get_copy_bib_basics(hold.current_copy.id); + %] + + + + + + + + + [% END %] + [% END %] + +
TitleAuthorShelving LocationCall NumberBarcode/PartPatron
[% copy_data.title | truncate %][% copy_data.author | truncate %][% hold.current_copy.location.name %][% hold.current_copy.call_number.label %][% hold.current_copy.barcode %] + [% FOR part IN hold.current_copy.parts %] + [% part.part.label %] + [% END %] + [% hold.usr.card.barcode %]
+$$ + WHERE id = 35; + +INSERT INTO action_trigger.environment ( + event_def, + path + ) VALUES + (35, 'current_copy.parts'), + (35, 'current_copy.parts.part') +; + +COMMIT; + 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 5801df24f2..a7a1619aad 100644 --- a/Open-ILS/web/opac/extras/circ/alt_holds_print.html +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.html @@ -81,7 +81,7 @@ Author Shelving Location Call Number - Barcode + Barcode/Part @@ -94,7 +94,7 @@ ${current_copy.location.name} ${current_copy.call_number.prefix.label} ${current_copy.call_number.label} ${current_copy.call_number.suffix.label} - ${current_copy.barcode} + ${current_copy.barcode} ${current_copy.parts_stringified} 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 a3f0378ef7..724e4e7568 100644 --- a/Open-ILS/web/opac/extras/circ/alt_holds_print.js +++ b/Open-ILS/web/opac/extras/circ/alt_holds_print.js @@ -37,6 +37,11 @@ function do_pull_list() { 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); + hold.current_copy.parts_stringified = ''; + dojo.forEach( hold_fm.current_copy().parts(), function(part) { + hold.current_copy.parts_stringified += ' ' + part.label(); + }); + // clone the template's html var tr = dojo.clone( -- 2.11.0