From 11a8a9b0b0fe8de3b6cfeae79385f7f7aeeeb2a6 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 21 Sep 2005 21:24:28 +0000 Subject: [PATCH] adding first round of stage one display template git-svn-id: svn://svn.open-ils.org/ILS/trunk@1852 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/reporter/templates/s1.ttk | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Open-ILS/src/reporter/templates/s1.ttk diff --git a/Open-ILS/src/reporter/templates/s1.ttk b/Open-ILS/src/reporter/templates/s1.ttk new file mode 100644 index 0000000000..b28dbd91d1 --- /dev/null +++ b/Open-ILS/src/reporter/templates/s1.ttk @@ -0,0 +1,63 @@ +[% + USE DBI; + USE WebSession; + USE utils = WebUtils; + USE testdoc = XML::LibXML(config_xml); + + userid = 1; + + dbname = testdoc.findvalue('/reporter/setup/database/name'); + dbhost = testdoc.findvalue('/reporter/setup/database/host'); + d_u = testdoc.findvalue('/reporter/setup/database/user'); + d_p = testdoc.findvalue('/reporter/setup/database/password'); + + dsn = "dbi:Pg:dbname=" _ dbname _';host=' _ dbhost; + + ''; + + DBI.connect(dsn,d_u,d_p); +%] + + + +

Reports: yay!

+ [% PROCESS PRINT_STAGE1 %] + + + + + + +[% BLOCK PRINT_STAGE1 %] + +[% FOR s1 IN DBI.query("select * from reporter.stage1 where pub is true;"); + USE doc = XML::LibXML(s1.filename); %] + + + + + + + + + + +[% END %] +
+ Name: + + [%doc.findvalue('/reporter/report/@name')%] + + Description: + + [%doc.findvalue('/reporter/report/description')%] + + Visible Stage2 reports: + + [% q = 'select count(*) as x from reporter.stage2 ' _ + 'where pub is true or owner = ' _ userid; + FOR r IN DBI.query(q); + r.x; + END %] +
+[% END %] -- 2.43.2