[open-ils-commits] r15039 - in trunk/Open-ILS/src/sql/Pg: . upgrade (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 30 09:14:25 EST 2009
Author: erickson
Date: 2009-11-30 09:14:23 -0500 (Mon, 30 Nov 2009)
New Revision: 15039
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0096.data.selfcheck-receipt-template2.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
access the user_data hash directly from the env variable and don't clobber said variable in the process
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-11-28 23:43:37 UTC (rev 15038)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-11-30 14:14:23 UTC (rev 15039)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0095'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0096'); -- 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-11-28 23:43:37 UTC (rev 15038)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-11-30 14:14:23 UTC (rev 15039)
@@ -2656,7 +2656,7 @@
[% FOR circ IN target %]
[%-
SET idx = loop.count - 1;
- SET user_data = EventProcessor.findEvent( event.$idx ).environment.user_data
+ SET udata = user_data.$idx
-%]
<li>
<div>[% helpers.get_copy_bib_basics(circ.target_copy.id).title %]</div>
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0096.data.selfcheck-receipt-template2.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0096.data.selfcheck-receipt-template2.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0096.data.selfcheck-receipt-template2.sql 2009-11-30 14:14:23 UTC (rev 15039)
@@ -0,0 +1,84 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0096');
+
+UPDATE action_trigger.event_definition SET template =
+$$
+[%- 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 %]
+ <ol>
+ [% FOR circ IN target %]
+ [%-
+ SET idx = loop.count - 1;
+ SET udata = user_data.$idx
+ -%]
+ <li>
+ <div>[% helpers.get_copy_bib_basics(circ.target_copy.id).title %]</div>
+ <div>Barcode: [% circ.target_copy.barcode %]</div>
+ [% IF udata.renewal_failure %]
+ <div style='color:red;'>Renewal Failed</div>
+ [% ELSE %]
+ <div>Due Date: [% date.format(helpers.format_date(circ.due_date), '%Y-%m-%d') %]</div>
+ [% END %]
+ </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>
+$$
+
+WHERE id = 10;
+
+COMMIT;
More information about the open-ils-commits
mailing list