From 1ab6649e0aa6d9a4321607210af7f4895c03b784 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 28 Sep 2005 21:14:32 +0000 Subject: [PATCH] adding widgets dir git-svn-id: svn://svn.open-ils.org/ILS/trunk@1883 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/reporter/templates/stage1.ttk | 4 +- Open-ILS/src/reporter/templates/stage2.ttk | 69 ++++++++++++++++++- .../templates/widgets/specific-timerange.any | 1 + 3 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.any diff --git a/Open-ILS/src/reporter/templates/stage1.ttk b/Open-ILS/src/reporter/templates/stage1.ttk index 9399911f10..531812dfee 100644 --- a/Open-ILS/src/reporter/templates/stage1.ttk +++ b/Open-ILS/src/reporter/templates/stage1.ttk @@ -106,9 +106,7 @@ BLOCK stage1_summary links=0; END; END; WRAPPER html/row; - WRAPPER html/cell align="right" valign='top'; - %]Report Templates:[% - END; + INCLUDE html/cell align="right" valign='top' content='Report Templates:'; WRAPPER html/cell; q = 'select * from reporter.stage2 ' _ 'where pub is true or owner = ' _ DBI.quote(user.id()); diff --git a/Open-ILS/src/reporter/templates/stage2.ttk b/Open-ILS/src/reporter/templates/stage2.ttk index 90919af12c..b867855e4f 100644 --- a/Open-ILS/src/reporter/templates/stage2.ttk +++ b/Open-ILS/src/reporter/templates/stage2.ttk @@ -97,7 +97,10 @@ BLOCK view_stage2; INCLUDE anchor text=config.findvalue( s1_name_xpath ) href="stage1?id=" _ params.stage1; - ' :: ' _ params.templatename; + ' :: ' _ params.templatename _ '
'; + INCLUDE anchor + text="Create a report from this template" + href=CGI.url('-path', 1, '-query', 1) _ '&action=run'; END; END; @@ -146,7 +149,71 @@ END; BLOCK run_stage2; + logme(tmpl.params); + params = utils.JSON2perl( tmpl.params ); + + %]
[% + + WRAPPER html/table border=0 width='100%'; + WRAPPER html/row; + WRAPPER html/cell colspan=4 align='center'; + s1_name_xpath = '/reporter/tables/table[@id="' _ params.stage1 _ '"]/label'; + INCLUDE anchor + text=config.findvalue( s1_name_xpath ) + href="stage1?id=" _ params.stage1; + ' :: ' _ params.templatename; + END; + END; + + WRAPPER html/row; + INCLUDE html/cell colspan=4 content="Filters:"; + END; + + FOR f_table IN params.filter.keys; + logme([f_table]); + table = config.findnodes( "/reporter/tables/table[@id='$f_table']"); + WRAPPER html/row; + INCLUDE html/cell; + INCLUDE html/cell colspan=3 align='left' content=table.findvalue( 'label' ); + END; + + FOR f_field IN params.filter.$f_table.keys; + logme([f_table,f_field]); + FOR f_fam IN params.filter.$f_table.$f_field.keys; + logme([f_table,f_field,f_fam]); + f_widget = params.filter.$f_table.$f_field.$f_fam; + logme([f_table,f_field,f_fam,f_widget]); + + WRAPPER html/row; + field = table.findnodes( "fields/field[@name='$f_field']" ); + fam = config.findnodes( "/reporter/widgets/widget-family[@name='$f_fam']" ); + widget = fam.findnodes( "widget[@name='$f_widget']" ); + + w_file = 'widgets/' _ fam.findvalue('@name') _ '.' _ widget.findvalue('@name'); + INCLUDE html/cell colspan=2; + INCLUDE html/cell align='right' content=field.findvalue( 'label' ); + + WRAPPER html/cell align='center'; + TRY; + INCLUDE $w_file; + CATCH; + %]ARG!! Couldn't render widget [% $w_file %] ([% error.info %])!!![% + END; + END; + END; + END; + END; + END; + + WRAPPER html/row; + INCLUDE html/cell colspan=5 content="Available Attributes:"; + END; + + END; + + INCLUDE submit name="action" value="schedule"; + %]
[% END; %] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.any b/Open-ILS/src/reporter/templates/widgets/specific-timerange.any new file mode 100644 index 0000000000..f109e24f29 --- /dev/null +++ b/Open-ILS/src/reporter/templates/widgets/specific-timerange.any @@ -0,0 +1 @@ +don't mind me, just a placeholder -- 2.43.2