From: Bill Erickson Date: Thu, 7 Jul 2011 18:24:45 +0000 (-0400) Subject: Stamped DB version for hold_pull_list_template w/ parts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3bade44241f9c77cf2cc6bffc4bdf78cca1ebbea;p=evergreen%2Fmasslnc.git Stamped DB version for hold_pull_list_template w/ parts Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 67b34933f5..294eb0e055 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0573', :eg_version); -- miker +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0574', :eg_version); -- berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0574.data.hold_pull_list_template.sql b/Open-ILS/src/sql/Pg/upgrade/0574.data.hold_pull_list_template.sql new file mode 100644 index 0000000000..a0bea8cf47 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0574.data.hold_pull_list_template.sql @@ -0,0 +1,79 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('0574', :eg_version); + +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/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 deleted file mode 100644 index 32c9460168..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/xxx.data.hold_pull_list_template.sql +++ /dev/null @@ -1,79 +0,0 @@ -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; -