From c8bf6bfff6f40923b5b738e99078cc9398310b4e Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 8 Dec 2009 21:10:52 +0000 Subject: [PATCH] seed data for selfcheck holds list receipt. also removed the lib addr and hours of op from the circ receipt since there is no 1 context org unit for a set of circs git-svn-id: svn://svn.open-ils.org/ILS/trunk@15106 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 105 ++++++++++++--------- ...08.data.selfcheck-itemsout-receipt-template.sql | 47 --------- .../0111.data.selfcheck-holds-receipt-template.sql | 63 +++++++++++++ 4 files changed, 122 insertions(+), 95 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 9ed28a438f..2800847479 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0110'); -- miker +INSERT INTO config.upgrade_log (version) VALUES ('0111'); -- berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, 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 5d949431ae..dec3a7df55 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -2756,16 +2756,9 @@ INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, vali $$ [%- USE date -%] [%- SET user = target.0.usr -%] -[%- SET lib = target.0.circ_lib -%] -[%- SET lib_addr = target.0.circ_lib.billing_address -%] -[%- SET hours = lib.hours_of_operation -%]
[% date.format %]
-
[% lib.name %]
-
[% lib_addr.street1 %] [% lib_addr.street2 %]
-
[% lib_addr.city %], [% lib_addr.state %] [% lb_addr.post_code %]
-
[% lib.phone %]

[% user.family_name %], [% user.first_given_name %] @@ -2778,46 +2771,6 @@ $$ [% END %] - -
- Library Hours - [%- BLOCK format_time; date.format(time _ ' 1/1/1000', format='%I:%M %p'); END -%] -
- Monday - [% PROCESS format_time time = hours.dow_0_open %] - [% PROCESS format_time time = hours.dow_0_close %] -
-
- Tuesday - [% PROCESS format_time time = hours.dow_1_open %] - [% PROCESS format_time time = hours.dow_1_close %] -
-
- Wednesday - [% PROCESS format_time time = hours.dow_2_open %] - [% PROCESS format_time time = hours.dow_2_close %] -
-
- Thursday - [% PROCESS format_time time = hours.dow_3_open %] - [% PROCESS format_time time = hours.dow_3_close %] -
-
- Friday - [% PROCESS format_time time = hours.dow_4_open %] - [% PROCESS format_time time = hours.dow_4_close %] -
-
- Saturday - [% PROCESS format_time time = hours.dow_5_open %] - [% PROCESS format_time time = hours.dow_5_close %] -
-
- Sunday - [% PROCESS format_time time = hours.dow_6_open %] - [% PROCESS format_time time = hours.dow_6_close %] -
-
$$ ); @@ -2829,3 +2782,61 @@ INSERT INTO action_trigger.environment ( event_def, path) VALUES ( 11, 'circ_lib.hours_of_operation'), ( 11, 'usr'); +INSERT INTO action_trigger.hook (key, core_type, description, passive) + VALUES ( + 'format.selfcheck.holds', + 'ahr', + 'Formats holds for self-checkout receipt', + TRUE + ); + +INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, group_field, granularity, template ) + VALUES ( + 12, + TRUE, + 1, + 'Self-Checkout Holds Receipt', + 'format.selfcheck.holds', + 'NOOP_True', + 'ProcessTemplate', + 'usr', + 'print-on-demand', +$$ +[%- USE date -%] +[%- SET user = target.0.usr -%] +
+ +
[% date.format %]
+
+ + [% user.family_name %], [% user.first_given_name %] +
    + [% FOR hold IN target %] + [%- + SET idx = loop.count - 1; + SET udata = user_data.$idx + -%] +
  1. +
    Title: [% hold.bib_rec.bib_record.simple_record.title %]
    +
    Author: [% hold.bib_rec.bib_record.simple_record.author %]
    +
    Pickup Location: [% hold.pickup_lib.name %]
    +
    Status: + [%- IF udata.ready -%] + Ready for pickup + [% ELSE %] + #[% udata.queue_position %] of [% udata.potential_copies %] copies. + [% END %] +
    +
  2. + [% END %] +
+
+$$ +); + + +INSERT INTO action_trigger.environment ( event_def, path) VALUES + ( 12, 'bib_rec.bib_record.simple_record'), + ( 12, 'pickup_lib'), + ( 12, 'usr'); + diff --git a/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql b/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql index 5707a9911c..be7475c290 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql @@ -24,16 +24,9 @@ INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, vali $$ [%- USE date -%] [%- SET user = target.0.usr -%] -[%- SET lib = target.0.circ_lib -%] -[%- SET lib_addr = target.0.circ_lib.billing_address -%] -[%- SET hours = lib.hours_of_operation -%]
[% date.format %]
-
[% lib.name %]
-
[% lib_addr.street1 %] [% lib_addr.street2 %]
-
[% lib_addr.city %], [% lib_addr.state %] [% lb_addr.post_code %]
-
[% lib.phone %]

[% user.family_name %], [% user.first_given_name %] @@ -46,46 +39,6 @@ $$ [% END %] - -
- Library Hours - [%- BLOCK format_time; date.format(time _ ' 1/1/1000', format='%I:%M %p'); END -%] -
- Monday - [% PROCESS format_time time = hours.dow_0_open %] - [% PROCESS format_time time = hours.dow_0_close %] -
-
- Tuesday - [% PROCESS format_time time = hours.dow_1_open %] - [% PROCESS format_time time = hours.dow_1_close %] -
-
- Wednesday - [% PROCESS format_time time = hours.dow_2_open %] - [% PROCESS format_time time = hours.dow_2_close %] -
-
- Thursday - [% PROCESS format_time time = hours.dow_3_open %] - [% PROCESS format_time time = hours.dow_3_close %] -
-
- Friday - [% PROCESS format_time time = hours.dow_4_open %] - [% PROCESS format_time time = hours.dow_4_close %] -
-
- Saturday - [% PROCESS format_time time = hours.dow_5_open %] - [% PROCESS format_time time = hours.dow_5_close %] -
-
- Sunday - [% PROCESS format_time time = hours.dow_6_open %] - [% PROCESS format_time time = hours.dow_6_close %] -
-
$$ ); diff --git a/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql b/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql new file mode 100644 index 0000000000..04a51fa081 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql @@ -0,0 +1,63 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0111'); + +INSERT INTO action_trigger.hook (key, core_type, description, passive) + VALUES ( + 'format.selfcheck.holds', + 'ahr', + 'Formats holds for self-checkout receipt', + TRUE + ); + +INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, group_field, granularity, template ) + VALUES ( + 12, + TRUE, + 1, + 'Self-Checkout Holds Receipt', + 'format.selfcheck.holds', + 'NOOP_True', + 'ProcessTemplate', + 'usr', + 'print-on-demand', +$$ +[%- USE date -%] +[%- SET user = target.0.usr -%] +
+ +
[% date.format %]
+
+ + [% user.family_name %], [% user.first_given_name %] +
    + [% FOR hold IN target %] + [%- + SET idx = loop.count - 1; + SET udata = user_data.$idx + -%] +
  1. +
    Title: [% hold.bib_rec.bib_record.simple_record.title %]
    +
    Author: [% hold.bib_rec.bib_record.simple_record.author %]
    +
    Pickup Location: [% hold.pickup_lib.name %]
    +
    Status: + [%- IF udata.ready -%] + Ready for pickup + [% ELSE %] + #[% udata.queue_position %] of [% udata.potential_copies %] copies. + [% END %] +
    +
  2. + [% END %] +
+
+$$ +); + + +INSERT INTO action_trigger.environment ( event_def, path) VALUES + ( 12, 'bib_rec.bib_record.simple_record'), + ( 12, 'pickup_lib'), + ( 12, 'usr'); + +COMMIT; -- 2.11.0