adding first round of stage one display template
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Sep 2005 21:24:28 +0000 (21:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Sep 2005 21:24:28 +0000 (21:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1852 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/reporter/templates/s1.ttk [new file with mode: 0644]

diff --git a/Open-ILS/src/reporter/templates/s1.ttk b/Open-ILS/src/reporter/templates/s1.ttk
new file mode 100644 (file)
index 0000000..b28dbd9
--- /dev/null
@@ -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;
+
+       '<!-- ' _ dsn _ ', ' _ d_u _ ', ' _ d_p _ ' -->';
+       
+       DBI.connect(dsn,d_u,d_p);
+%]
+
+<html>
+       <body>
+               <h1>Reports: yay!</h1>
+               [% PROCESS PRINT_STAGE1 %]
+       </body>
+</html>
+
+
+
+
+[% BLOCK PRINT_STAGE1 %]
+               <table border=1>
+[%                     FOR s1 IN DBI.query("select * from reporter.stage1 where pub is true;");
+                               USE doc = XML::LibXML(s1.filename); %]
+
+                               <tr>
+                                       <td>
+                                               Name:
+                                       </td>
+                                       <td>
+                                               [%doc.findvalue('/reporter/report/@name')%]
+                                       </td>
+                                       <td>
+                                               Description:
+                                       </td>
+                                       <td>
+                                               [%doc.findvalue('/reporter/report/description')%]
+                                       </td>
+                                       <td>
+                                               Visible Stage2 reports:
+                                       </td>
+                                       <td>
+                                               [% q = 'select count(*) as x from reporter.stage2 ' _
+                                                               'where pub is true or owner = ' _ userid;
+                                               FOR r IN DBI.query(q);
+                                                       r.x;
+                                               END %]
+                                       </td>
+                               </tr>
+
+[%                     END %]
+               </table>
+[% END %]