[open-ils-commits] r15106 - in trunk/Open-ILS/src/sql/Pg: . upgrade (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 8 16:10:58 EST 2009
Author: erickson
Date: 2009-12-08 16:10:52 -0500 (Tue, 08 Dec 2009)
New Revision: 15106
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql
Log:
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
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-08 20:35:06 UTC (rev 15105)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-08 21:10:52 UTC (rev 15106)
@@ -51,7 +51,7 @@
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,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-12-08 20:35:06 UTC (rev 15105)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-12-08 21:10:52 UTC (rev 15106)
@@ -2756,16 +2756,9 @@
$$
[%- 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 -%]
<div>
<style> li { padding: 8px; margin 5px; }</style>
<div>[% date.format %]</div>
- <div>[% lib.name %]</div>
- <div>[% lib_addr.street1 %] [% lib_addr.street2 %]</div>
- <div>[% lib_addr.city %], [% lib_addr.state %] [% lb_addr.post_code %]</div>
- <div>[% lib.phone %]</div>
<br/>
[% user.family_name %], [% user.first_given_name %]
@@ -2778,46 +2771,6 @@
</li>
[% END %]
</ol>
-
- <div>
- Library Hours
- [%- BLOCK format_time; date.format(time _ ' 1/1/1000', format='%I:%M %p'); END -%]
- <div>
- Monday
- [% PROCESS format_time time = hours.dow_0_open %]
- [% PROCESS format_time time = hours.dow_0_close %]
- </div>
- <div>
- Tuesday
- [% PROCESS format_time time = hours.dow_1_open %]
- [% PROCESS format_time time = hours.dow_1_close %]
- </div>
- <div>
- Wednesday
- [% PROCESS format_time time = hours.dow_2_open %]
- [% PROCESS format_time time = hours.dow_2_close %]
- </div>
- <div>
- Thursday
- [% PROCESS format_time time = hours.dow_3_open %]
- [% PROCESS format_time time = hours.dow_3_close %]
- </div>
- <div>
- Friday
- [% PROCESS format_time time = hours.dow_4_open %]
- [% PROCESS format_time time = hours.dow_4_close %]
- </div>
- <div>
- Saturday
- [% PROCESS format_time time = hours.dow_5_open %]
- [% PROCESS format_time time = hours.dow_5_close %]
- </div>
- <div>
- Sunday
- [% PROCESS format_time time = hours.dow_6_open %]
- [% PROCESS format_time time = hours.dow_6_close %]
- </div>
- </div>
</div>
$$
);
@@ -2829,3 +2782,61 @@
( 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 -%]
+<div>
+ <style> li { padding: 8px; margin 5px; }</style>
+ <div>[% date.format %]</div>
+ <br/>
+
+ [% user.family_name %], [% user.first_given_name %]
+ <ol>
+ [% FOR hold IN target %]
+ [%-
+ SET idx = loop.count - 1;
+ SET udata = user_data.$idx
+ -%]
+ <li>
+ <div>Title: [% hold.bib_rec.bib_record.simple_record.title %]</div>
+ <div>Author: [% hold.bib_rec.bib_record.simple_record.author %]</div>
+ <div>Pickup Location: [% hold.pickup_lib.name %]</div>
+ <div>Status:
+ [%- IF udata.ready -%]
+ Ready for pickup
+ [% ELSE %]
+ #[% udata.queue_position %] of [% udata.potential_copies %] copies.
+ [% END %]
+ </div>
+ </li>
+ [% END %]
+ </ol>
+</div>
+$$
+);
+
+
+INSERT INTO action_trigger.environment ( event_def, path) VALUES
+ ( 12, 'bib_rec.bib_record.simple_record'),
+ ( 12, 'pickup_lib'),
+ ( 12, 'usr');
+
Modified: trunk/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql 2009-12-08 20:35:06 UTC (rev 15105)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0108.data.selfcheck-itemsout-receipt-template.sql 2009-12-08 21:10:52 UTC (rev 15106)
@@ -24,16 +24,9 @@
$$
[%- 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 -%]
<div>
<style> li { padding: 8px; margin 5px; }</style>
<div>[% date.format %]</div>
- <div>[% lib.name %]</div>
- <div>[% lib_addr.street1 %] [% lib_addr.street2 %]</div>
- <div>[% lib_addr.city %], [% lib_addr.state %] [% lb_addr.post_code %]</div>
- <div>[% lib.phone %]</div>
<br/>
[% user.family_name %], [% user.first_given_name %]
@@ -46,46 +39,6 @@
</li>
[% END %]
</ol>
-
- <div>
- Library Hours
- [%- BLOCK format_time; date.format(time _ ' 1/1/1000', format='%I:%M %p'); END -%]
- <div>
- Monday
- [% PROCESS format_time time = hours.dow_0_open %]
- [% PROCESS format_time time = hours.dow_0_close %]
- </div>
- <div>
- Tuesday
- [% PROCESS format_time time = hours.dow_1_open %]
- [% PROCESS format_time time = hours.dow_1_close %]
- </div>
- <div>
- Wednesday
- [% PROCESS format_time time = hours.dow_2_open %]
- [% PROCESS format_time time = hours.dow_2_close %]
- </div>
- <div>
- Thursday
- [% PROCESS format_time time = hours.dow_3_open %]
- [% PROCESS format_time time = hours.dow_3_close %]
- </div>
- <div>
- Friday
- [% PROCESS format_time time = hours.dow_4_open %]
- [% PROCESS format_time time = hours.dow_4_close %]
- </div>
- <div>
- Saturday
- [% PROCESS format_time time = hours.dow_5_open %]
- [% PROCESS format_time time = hours.dow_5_close %]
- </div>
- <div>
- Sunday
- [% PROCESS format_time time = hours.dow_6_open %]
- [% PROCESS format_time time = hours.dow_6_close %]
- </div>
- </div>
</div>
$$
);
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0111.data.selfcheck-holds-receipt-template.sql 2009-12-08 21:10:52 UTC (rev 15106)
@@ -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 -%]
+<div>
+ <style> li { padding: 8px; margin 5px; }</style>
+ <div>[% date.format %]</div>
+ <br/>
+
+ [% user.family_name %], [% user.first_given_name %]
+ <ol>
+ [% FOR hold IN target %]
+ [%-
+ SET idx = loop.count - 1;
+ SET udata = user_data.$idx
+ -%]
+ <li>
+ <div>Title: [% hold.bib_rec.bib_record.simple_record.title %]</div>
+ <div>Author: [% hold.bib_rec.bib_record.simple_record.author %]</div>
+ <div>Pickup Location: [% hold.pickup_lib.name %]</div>
+ <div>Status:
+ [%- IF udata.ready -%]
+ Ready for pickup
+ [% ELSE %]
+ #[% udata.queue_position %] of [% udata.potential_copies %] copies.
+ [% END %]
+ </div>
+ </li>
+ [% END %]
+ </ol>
+</div>
+$$
+);
+
+
+INSERT INTO action_trigger.environment ( event_def, path) VALUES
+ ( 12, 'bib_rec.bib_record.simple_record'),
+ ( 12, 'pickup_lib'),
+ ( 12, 'usr');
+
+COMMIT;
More information about the open-ils-commits
mailing list