From fdd590ebc59f8d71fc2a1a04a08e83c5893ab2c0 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 26 Sep 2005 21:30:03 +0000 Subject: [PATCH] removing stage1 reporter xml config git-svn-id: svn://svn.open-ils.org/ILS/trunk@1875 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/reporter/tables.example.xml | 2 +- Open-ILS/src/reporter/templates/logout.ttk | 2 +- Open-ILS/src/reporter/templates/stage1.ttk | 59 +++++++++++----------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/Open-ILS/src/reporter/tables.example.xml b/Open-ILS/src/reporter/tables.example.xml index 65b3f39cb2..4d4ec28a66 100644 --- a/Open-ILS/src/reporter/tables.example.xml +++ b/Open-ILS/src/reporter/tables.example.xml @@ -3,7 +3,7 @@ - Silly Fact table + Base table for creating reports on silly wordsstats.silly_fact diff --git a/Open-ILS/src/reporter/templates/logout.ttk b/Open-ILS/src/reporter/templates/logout.ttk index d0b1989564..7fc38ca9ef 100644 --- a/Open-ILS/src/reporter/templates/logout.ttk +++ b/Open-ILS/src/reporter/templates/logout.ttk @@ -16,7 +16,7 @@ cookie.remove(COOKIE_SES); - location.href = location.href.replace( /\w+\/?$/, "" ); + location.href = location.href.replace( /(\?.*$)/, "" ); } diff --git a/Open-ILS/src/reporter/templates/stage1.ttk b/Open-ILS/src/reporter/templates/stage1.ttk index b9242a6769..f6d17633d8 100644 --- a/Open-ILS/src/reporter/templates/stage1.ttk +++ b/Open-ILS/src/reporter/templates/stage1.ttk @@ -53,24 +53,20 @@ END; BLOCK one_stage1; %]|Show all[% - uid = DBI.quote(user.id()); - rid = DBI.quote(CGI.param('id')); + table_xpath = + '/reporter/tables/table[@id="' _ + CGI.param('id') _ '"]'; + table = config.findnodes(table_xpath); - q = "select * from reporter.stage1 where (pub is true or owner = $uid) and id = $rid;"; - FOR s1 IN DBI.query(q); - file = dir _ '/' _ s1.filename; - USE doc = XML.LibXML(file); + fact_table = table.findvalue('@id'); + logme(fact_table); - fact_table = doc.findvalue('//report/@fact-table'); - logme(fact_table); + INCLUDE stage1_summary; + INCLUDE stage2_new IF CGI.param('create_stage2') == 1; - PROCESS stage1_summary; - PROCESS stage2_new IF CGI.param('create_stage2') == 1; - - END; END; @@ -78,19 +74,18 @@ END; BLOCK all_stage1; ''; @@ -100,13 +95,14 @@ END; BLOCK stage1_summary links=0; + fact_table = table.findvalue('@id'); WRAPPER html/table width="100%"; WRAPPER html/row; WRAPPER html/cell align="right"; %]Name:[% END; WRAPPER html/cell; - doc.findvalue('/reporter/report/@name'); + table.findvalue('label'); END; END; WRAPPER html/row; @@ -114,7 +110,7 @@ BLOCK stage1_summary links=0; %]Description:[% END; WRAPPER html/cell; - doc.findvalue('/reporter/report/description'); + table.findvalue('description'); END; END; WRAPPER html/row; @@ -123,11 +119,11 @@ BLOCK stage1_summary links=0; END; WRAPPER html/cell; IF CGI.param('detail'); - %]No Details[% + %]No Details[% ELSE; - %]Details[% + %]Details[% END; - %]|New Report Template[% + %]|New Report Template[% END; END; PROCESS stage1_detail IF CGI.param('detail') == 1; @@ -338,7 +334,7 @@ BLOCK dim_description; %]Name:[% END; WRAPPER html/cell; - dim.findvalue('name'); + dim.findvalue('label'); END; END; PROCESS table_fields table = dim; @@ -389,7 +385,12 @@ BLOCK stage1_detail; %]Report Attributes
(dimensions):[% END; WRAPPER html/cell; - incs = doc.findnodes('//report/dims/dim/@include'); + incs_xpath = + '/reporter/tables/table[@id="' _ fact_table _'"]'_ + '/links/link/@field'; + logme(incs_xpath); + + incs = config.findnodes(incs_xpath); FOR dim IN incs; %]
[% -- 2.43.2