From 12bc5310704deef6f740080d559b24158c92a7bd Mon Sep 17 00:00:00 2001 From: dbs Date: Sat, 10 Nov 2007 02:06:00 +0000 Subject: [PATCH] Delete reporter cruft. Rename success and failure templates to match config file defaults. Ensure current reporter code gets installed as part of openils_all target. git-svn-id: svn://svn.open-ils.org/ILS/trunk@8055 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/Makefile | 14 +- Open-ILS/src/reporter/config.sql | 108 --- .../reporter/{report_failure.tmpl => report-fail} | 0 .../{report_success.tmpl => report-success} | 0 Open-ILS/src/reporter/report_base.example.xml | 26 - Open-ILS/src/reporter/report_stage1.example.xml | 14 - Open-ILS/src/reporter/reporter.schema-gen.pl | 111 --- Open-ILS/src/reporter/tables.example.xml | 758 --------------------- .../src/reporter/templates/advanced-dashboard.ttk | 231 ------- Open-ILS/src/reporter/templates/class_manip | 116 ---- Open-ILS/src/reporter/templates/dashboard.ttk | 323 --------- Open-ILS/src/reporter/templates/footer.ttk | 3 - Open-ILS/src/reporter/templates/header.ttk | 223 ------ Open-ILS/src/reporter/templates/html/body | 25 - Open-ILS/src/reporter/templates/html/cell | 25 - Open-ILS/src/reporter/templates/html/center | 1 - Open-ILS/src/reporter/templates/html/html | 6 - Open-ILS/src/reporter/templates/html/row | 17 - Open-ILS/src/reporter/templates/html/table | 19 - Open-ILS/src/reporter/templates/html/th | 25 - Open-ILS/src/reporter/templates/inputs | 97 --- Open-ILS/src/reporter/templates/logic_header.ttk | 44 -- Open-ILS/src/reporter/templates/login.ttk | 86 --- Open-ILS/src/reporter/templates/logout.ttk | 21 - Open-ILS/src/reporter/templates/navbar.ttk | 12 - Open-ILS/src/reporter/templates/select_sorter.js | 161 ----- Open-ILS/src/reporter/templates/stage1.ttk | 150 ---- Open-ILS/src/reporter/templates/stage2.ttk | 670 ------------------ Open-ILS/src/reporter/templates/stage3.ttk | 447 ------------ Open-ILS/src/reporter/templates/utils | 18 - Open-ILS/src/reporter/templates/widget_manip | 116 ---- .../templates/widgets/comparative-timerange.month | 38 -- .../reporter/templates/widgets/lib-choose.dropdown | 82 --- .../templates/widgets/lib-choose.multiselect | 93 --- .../templates/widgets/relative-timerange.day | 23 - .../templates/widgets/relative-timerange.month | 24 - .../templates/widgets/relative-timerange.quarter | 19 - .../templates/widgets/relative-timerange.week | 22 - .../templates/widgets/relative-timerange.year | 22 - .../templates/widgets/specific-timerange.any | 85 --- .../templates/widgets/specific-timerange.day | 39 -- .../templates/widgets/specific-timerange.month | 46 -- .../widgets/specific-timerange.multimonth | 75 -- .../widgets/specific-timerange.multiquarter | 43 -- .../templates/widgets/specific-timerange.multiweek | 59 -- .../templates/widgets/specific-timerange.multiyear | 35 - .../templates/widgets/specific-timerange.quarter | 36 - .../templates/widgets/specific-timerange.week | 32 - .../templates/widgets/specific-timerange.year | 29 - .../templates/widgets/string-choose.dropdown | 27 - .../templates/widgets/string-choose.multiselect | 28 - .../reporter/templates/widgets/string-input.exact | 11 - .../widgets/string-input.initial-substring | 12 - .../templates/widgets/string-input.multistring | 12 - Open-ILS/src/reporter/widgets.example.xml | 291 -------- 55 files changed, 7 insertions(+), 5043 deletions(-) delete mode 100644 Open-ILS/src/reporter/config.sql rename Open-ILS/src/reporter/{report_failure.tmpl => report-fail} (100%) rename Open-ILS/src/reporter/{report_success.tmpl => report-success} (100%) delete mode 100644 Open-ILS/src/reporter/report_base.example.xml delete mode 100644 Open-ILS/src/reporter/report_stage1.example.xml delete mode 100755 Open-ILS/src/reporter/reporter.schema-gen.pl delete mode 100644 Open-ILS/src/reporter/tables.example.xml delete mode 100644 Open-ILS/src/reporter/templates/advanced-dashboard.ttk delete mode 100644 Open-ILS/src/reporter/templates/class_manip delete mode 100644 Open-ILS/src/reporter/templates/dashboard.ttk delete mode 100644 Open-ILS/src/reporter/templates/footer.ttk delete mode 100644 Open-ILS/src/reporter/templates/header.ttk delete mode 100644 Open-ILS/src/reporter/templates/html/body delete mode 100644 Open-ILS/src/reporter/templates/html/cell delete mode 100644 Open-ILS/src/reporter/templates/html/center delete mode 100644 Open-ILS/src/reporter/templates/html/html delete mode 100644 Open-ILS/src/reporter/templates/html/row delete mode 100644 Open-ILS/src/reporter/templates/html/table delete mode 100644 Open-ILS/src/reporter/templates/html/th delete mode 100644 Open-ILS/src/reporter/templates/inputs delete mode 100644 Open-ILS/src/reporter/templates/logic_header.ttk delete mode 100644 Open-ILS/src/reporter/templates/login.ttk delete mode 100644 Open-ILS/src/reporter/templates/logout.ttk delete mode 100644 Open-ILS/src/reporter/templates/navbar.ttk delete mode 100644 Open-ILS/src/reporter/templates/select_sorter.js delete mode 100644 Open-ILS/src/reporter/templates/stage1.ttk delete mode 100644 Open-ILS/src/reporter/templates/stage2.ttk delete mode 100644 Open-ILS/src/reporter/templates/stage3.ttk delete mode 100644 Open-ILS/src/reporter/templates/utils delete mode 100644 Open-ILS/src/reporter/templates/widget_manip delete mode 100644 Open-ILS/src/reporter/templates/widgets/comparative-timerange.month delete mode 100644 Open-ILS/src/reporter/templates/widgets/lib-choose.dropdown delete mode 100644 Open-ILS/src/reporter/templates/widgets/lib-choose.multiselect delete mode 100644 Open-ILS/src/reporter/templates/widgets/relative-timerange.day delete mode 100644 Open-ILS/src/reporter/templates/widgets/relative-timerange.month delete mode 100644 Open-ILS/src/reporter/templates/widgets/relative-timerange.quarter delete mode 100644 Open-ILS/src/reporter/templates/widgets/relative-timerange.week delete mode 100644 Open-ILS/src/reporter/templates/widgets/relative-timerange.year delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.any delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.day delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.month delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.multimonth delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.multiquarter delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.multiweek delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.multiyear delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.quarter delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.week delete mode 100644 Open-ILS/src/reporter/templates/widgets/specific-timerange.year delete mode 100644 Open-ILS/src/reporter/templates/widgets/string-choose.dropdown delete mode 100644 Open-ILS/src/reporter/templates/widgets/string-choose.multiselect delete mode 100644 Open-ILS/src/reporter/templates/widgets/string-input.exact delete mode 100644 Open-ILS/src/reporter/templates/widgets/string-input.initial-substring delete mode 100644 Open-ILS/src/reporter/templates/widgets/string-input.multistring delete mode 100644 Open-ILS/src/reporter/widgets.example.xml diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 23ea095739..e3cedd643b 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -1,3 +1,4 @@ +# vim:noet:ts=4 export LDFLAGS += -L . -L$(TMP) -L $(OPENSRF_LIBS) export CFLAGS += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \ @@ -11,7 +12,7 @@ all: c_apps client-xul mod_xmlent install: perl-install web-install server-xul string-templates-install xsl-install c_apps-install circ_rules-install offline-install storage-bootstrap cgi-bootstrap -web-install: webcore-install autojs-install mod_xmlent-install offline-install +web-install: webcore-install autojs-install mod_xmlent-install offline-install reporter-install circ_rules-install: @echo $@ @@ -141,12 +142,11 @@ perl-install: reporter-install: @echo $@ -# @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)" -# cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml -# cp reporter/tables.example.xml $(ETCDIR) -# cp reporter/widgets.example.xml $(ETCDIR) -# mkdir -p $(REPORTERDIR) -# cp -r reporter/templates/* $(REPORTERDIR) + @echo "Installing Reporter email templates to $(REPORTERDIR) and example configs to $(ETCDIR)" + cp reporter/clark-kent.pl $(BINDIR) + cp reporter/report-fail $(DATADIR) + cp reporter/report-success $(DATADIR) + mkdir -p $(REPORTERDIR) # ----------------------------------------------------------------------------------- offline-install: diff --git a/Open-ILS/src/reporter/config.sql b/Open-ILS/src/reporter/config.sql deleted file mode 100644 index 49526e3597..0000000000 --- a/Open-ILS/src/reporter/config.sql +++ /dev/null @@ -1,108 +0,0 @@ -DROP SCHEMA reporter CASCADE; - -CREATE SCHEMA reporter; - -BEGIN; - -CREATE OR REPLACE VIEW reporter.date_series AS - SELECT CAST('1900/01/01' AS DATE) + x AS date, - CAST('1900/01/01' AS DATE) + x AS date_label - FROM GENERATE_SERIES( - 0, - CAST( EXTRACT( 'days' FROM CAST( NOW() - CAST( '1900/01/01' AS DATE ) AS INTERVAL ) ) AS INT ) - ) AS g(x); - -CREATE OR REPLACE VIEW reporter.date_hour_series AS - SELECT CAST(date + CAST(h || ' hours' AS INTERVAL) AS TIMESTAMP WITH TIME ZONE) AS date_hour, - CAST(date + CAST(h || ' hours' AS INTERVAL) AS TIMESTAMP WITH TIME ZONE) AS date_hour_label - FROM reporter.date_series, - GENERATE_SERIES(0,23) g(h); - - - -CREATE TABLE reporter.date_dim AS - SELECT - EXTRACT('year' FROM date_label)::INT AS year, - EXTRACT('month' FROM date_label)::INT AS month, - EXTRACT('day' FROM date_label)::INT AS day - FROM - (SELECT '1900-01-01'::date + g.x AS date_label - FROM GENERATE_SERIES(0, EXTRACT('days' FROM NOW() + '10 years'::INTERVAL - '1900-01-01'::TIMESTAMP WITH TIME ZONE)::INT) g(x)) as y - ORDER BY 1,2,3; - - -CREATE TABLE reporter.time_dim AS - SELECT - a.x AS hour, - b.x AS minute, - c.x AS second - FROM - GENERATE_SERIES(0, 23) as a(x), - GENERATE_SERIES(0, 59) as b(x), - GENERATE_SERIES(0, 59) as c(x) - order by 1,2,3; - - -CREATE TABLE reporter.stage2 ( - id serial primary key, - stage1 text not null, - params text not null, - owner int not null, - pub bool not null - default false, - create_date timestamp with time zone not null - default now(), - edit_date timestamp with time zone not null - default now() -); - -CREATE OR REPLACE FUNCTION reporter.force_edit_date_update () RETURNS TRIGGER AS $$ - BEGIN - NEW.edit_date = NOW(); - RETURN NEW; - END; -$$ LANGUAGE PLPGSQL; - -CREATE TRIGGER force_edit_date_update_trig - BEFORE UPDATE ON reporter.stage2 - FOR EACH ROW - EXECUTE PROCEDURE reporter.force_edit_date_update (); - -CREATE TABLE reporter.stage3 ( - id serial primary key, - stage2 int not null - references reporter.stage2 (id) - on delete restrict - deferrable - initially deferred, - params text not null, - owner int not null, - disable bool not null - default false, - pub bool not null - default false, - create_date timestamp with time zone not null - default now(), - runtime timestamp with time zone default now(), - recurrence interval -); - -CREATE TABLE reporter.output ( - id serial primary key, - stage3 int not null - references reporter.stage3 (id) - on delete restrict - deferrable - initially deferred, - queue_time timestamp with time zone not null default now(), - run_time timestamp with time zone, - run_pid int, - query text, - error text, - error_time timestamp with time zone, - complete_time timestamp with time zone, - state text check (state in ('wait','running','complete','error')) -); - -COMMIT; - diff --git a/Open-ILS/src/reporter/report_failure.tmpl b/Open-ILS/src/reporter/report-fail similarity index 100% rename from Open-ILS/src/reporter/report_failure.tmpl rename to Open-ILS/src/reporter/report-fail diff --git a/Open-ILS/src/reporter/report_success.tmpl b/Open-ILS/src/reporter/report-success similarity index 100% rename from Open-ILS/src/reporter/report_success.tmpl rename to Open-ILS/src/reporter/report-success diff --git a/Open-ILS/src/reporter/report_base.example.xml b/Open-ILS/src/reporter/report_base.example.xml deleted file mode 100644 index 41b8f2a6f3..0000000000 --- a/Open-ILS/src/reporter/report_base.example.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - /openils/var/web/reporter/ - - - - Pg - 127.0.0.1 - 5433 - develooper - postgres - - - - - - This file sucks in table definitions - - - This file sucks in widget definitions - - - diff --git a/Open-ILS/src/reporter/report_stage1.example.xml b/Open-ILS/src/reporter/report_stage1.example.xml deleted file mode 100644 index bdd5dbcbd2..0000000000 --- a/Open-ILS/src/reporter/report_stage1.example.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Silly Report base - - - - - - - diff --git a/Open-ILS/src/reporter/reporter.schema-gen.pl b/Open-ILS/src/reporter/reporter.schema-gen.pl deleted file mode 100755 index f6b4c74e26..0000000000 --- a/Open-ILS/src/reporter/reporter.schema-gen.pl +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/perl -use strict; use warnings; -use XML::LibXML; -use OpenSRF::Utils qw/:datetime/; -use DateTime; -use DateTime::Duration; -use DateTime::Format::ISO8601; - -my $dt_parser = DateTime::Format::ISO8601->new; -my $log = 'OpenSRF::Utils::Logger'; - - -my %chunkmap = - ( doy => '%j', - woy => '%U', - month => '%m', - year => '%Y', - ); - - -my $parser = XML::LibXML->new; -my $doc = $parser->parse_file($ARGV[0]); -$parser->process_xincludes($doc); - -print "BEGIN;\n\n"; -for my $table ($doc->findnodes('/reporter/tables/table')) { - my $tname = $table->getElementsByTagName('tablename')->string_value; - - (my $pkey_name = $tname) =~ s/\./_/gso; - $pkey_name .= '_pkey'; - warn "$tname\n"; - - my (@primary,@other,@indexed); - for my $field ($table->findnodes('fields/field')) { - my $fname = $field->getAttribute('name'); - my $fdatatype = $field->getAttribute('create-type') || $field->getAttribute('datatype'); - warn "\t$fname\n"; - - if ($field->getAttribute('indexed')) { - my $itype = $field->getAttribute('index-type') || 'BTREE'; - push @indexed, [$fname, $itype]; - } - - if ($field->getAttribute('primary')) { - push @primary, [$fname, $fdatatype]; - } else { - push @other, [$fname, $fdatatype]; - } - } - - warn "\n"; - print "DROP TABLE $tname CASCADE;\n"; - print "CREATE TABLE $tname (\n\t". - join(",\n\t", map { join("\t", @$_) } (@primary, @other))."\n". - do { - @primary ? - ",\tCONSTRAINT $pkey_name PRIMARY KEY (". - join(", ", map { $$_[0] } @primary). ")\n" : - '' - }. - ");\n"; - - print "\n"; - - if ($table->getAttribute('partition')) { - my ($part) = $table->getElementsByTagName('partition')->get_nodelist; - my ($field) = $part->getElementsByTagName('field')->get_nodelist; - my ($chunk) = $part->getElementsByTagName('chunk')->get_nodelist; - my ($start) = $part->getElementsByTagName('start')->get_nodelist; - my ($end) = $part->getElementsByTagName('end')->get_nodelist; - - $field = $field->textContent; - $chunk = $chunk->textContent; - $start = $dt_parser->parse_datetime( $start->textContent ); - $end = $dt_parser->parse_datetime( $end->textContent ); - - - while ( $start->epoch < $end->epoch ) { - - my $chunk_end = $start->clone; - $chunk_end->add( DateTime::Duration->new( $chunk => 1 ) ); - $chunk_end->subtract( DateTime::Duration->new( seconds => 1 ) ); - - my $tpart = $start->epoch; - - my $where = "BETWEEN '".$start->strftime('%FT%T%z'). - "' AND '".$chunk_end->strftime('%FT%T%z')."'"; - - print "CREATE TABLE ${tname}_${chunk}_$tpart () INHERITS ($tname);\n"; - print "ALTER TABLE ${tname}_${chunk}_$tpart\n". - "\tADD CONSTRAINT \"${tname}_${chunk}_${tpart}_test\"\n". - "\tCHECK ($field $where);\n"; - print "CREATE RULE \"${tname}_${chunk}_${tpart}_ins_rule\" AS\n\tON INSERT TO ". - "$tname \n\tWHERE NEW.$field $where". - "\n\tDO INSTEAD INSERT INTO ${tname}_${chunk}_$tpart VALUES (NEW.*);\n"; - for my $i (@indexed) { - print "CREATE INDEX \"${tname}_${chunk}_${tpart}_$$i[0]_idx\" ". - "ON ${tname}_${chunk}_$tpart USING $$i[1] ($$i[0]);\n"; - } - print "\n"; - $start->add( DateTime::Duration->new( $chunk => 1 ) ); - } - } else { - for my $i (@indexed) { - print "CREATE INDEX \"${tname}_$$i[0]_idx\" ON $tname USING $$i[1] ($$i[0]);\n"; - } - } - print "\n"; - -} -print "COMMIT;\n"; diff --git a/Open-ILS/src/reporter/tables.example.xml b/Open-ILS/src/reporter/tables.example.xml deleted file mode 100644 index 25c276d359..0000000000 --- a/Open-ILS/src/reporter/tables.example.xml +++ /dev/null @@ -1,758 +0,0 @@ - - - - - - Base table for creating circulation reports - stats.fleshed_circulation - - - - - Circulation ID - - - - ID of the Circulating Library - - - - ID of the Checkin Library - - - - ID of the Owning Library - - - - Date of the copy's cataloging - - - - Date and Hour of the circulation start - - - - Day the circulation is due - - - - Day and Hour the circulation is due - - - - Timestamp of the circulation due date - - - - Timestamp of the circulation start - - - - Timestamp of the circulation end - - - - Date of the circulation end - - - - Date and Hour of the circulation end - - - - MARC Item Language - - - - MARC Item Form of Material - - - - MARC Item Type - - - - Copy Call Number Label - - - - - - - - - - - - - - - - - - -
- - - - Base table for creating snapshot reports on copy information - stats.fleshed_copy - - - - - Copy ID - - - - Copy Barcode - - - - ID of the Owning Library - - - - ID of the Circulating Library - - - - Date of the copy's cataloging - - - - Date and Hour of the copy's cataloging - - - - Timestamp of the copy's cataloging - - - - Timestamp of the copy's last edit - - - - Date of the copy's last edit - - - - Date and Hour of the copy's last edit - - - - MARC Item Language - - - - MARC Item Form of Material - - - - MARC Item Type - - - - Copy Call Number Label - - - - - - - - - - - - - - - -
- - - - Base table for creating snapshot reports on call number/volume information - stats.fleshed_call_number - - - - - Call Number ID - - - - ID of the Owning Library - - - - Date of the call number's cataloging - - - - Date and Hour of the call number's cataloging - - - - Timestamp of the call number's cataloging - - - - Timestamp of the call number's last edit - - - - Date of the call number's last edit - - - - Date and Hour of the call number's last edit - - - - MARC Item Language - - - - MARC Item Form of Material - - - - MARC Item Type - - - - Call Number Label - - - - - - - - - - - - - - -
- - - - Table containing library hierarchy definition - actor.org_unit - - - - - Globally Unique Library Identifier - - - - Friendly Library Name - - - - Library Short (Policy) Name - - -
- - - - Table mapping MARC three character codes to language names - config.language_map - - - - - MARC Language Code - - - - Name associated with the MARC code - - -
- - - - View providing a day series starting at 1900 and ending at 'now' - reporter.date_series - - - - -
- - - - View providing a hour series starting at 1900 and ending at 'now' - reporter.date_hour_series - - - - -
- - - - Table mapping MARC three character codes to Item Form names - config.item_form_map - - - - - MARC Item Form Code - - - - Name associated with the MARC code - - -
- - - - Table mapping MARC three character codes to Item Type names - config.item_type_map - - - - - MARC Item Type Code - - - - Name associated with the MARC code - - -
- - - -
- diff --git a/Open-ILS/src/reporter/templates/advanced-dashboard.ttk b/Open-ILS/src/reporter/templates/advanced-dashboard.ttk deleted file mode 100644 index bda9ac3912..0000000000 --- a/Open-ILS/src/reporter/templates/advanced-dashboard.ttk +++ /dev/null @@ -1,231 +0,0 @@ -[% - -PROCESS inputs; -PROCESS class_manip; -PROCESS widget_manip; -PROCESS logic_header.ttk; - -pagetype = CGI.param('detail'); - -%] [% - -SWITCH pagetype; - CASE 'myreports'; - INCLUDE header.ttk title="Reporter Dashboard -- My Recent Reports"; - INCLUDE navbar.ttk + my_reports; - CASE 'mytemplates'; - INCLUDE header.ttk title="Reporter Dashboard -- My Recent Templates"; - INCLUDE navbar.ttk + my_templates; - CASE 'othersreports'; - INCLUDE header.ttk title="Reporter Dashboard -- Others Recent Public Reports"; - INCLUDE navbar.ttk + public_reports; - CASE 'otherstemplates'; - INCLUDE header.ttk title="Reporter Dashboard -- Others Recent Public Templates"; - INCLUDE navbar.ttk + public_templates; - CASE 'facttables'; - INCLUDE header.ttk title="Reporter Dashboard -- Core Fact Tables"; - INCLUDE navbar.ttk + fact_tables; - CASE; - INCLUDE header.ttk title="Reporter Dashboard"; - INCLUDE navbar.ttk + summary; -END; - -PROCESS logout.ttk; - -BLOCK summary; - WRAPPER html/table border=0 width='100%'; - WRAPPER html/row; - INCLUDE html/cell - width='50%' - content=link(content='My Recent Reports',href='dashboard?detail=myreports') - align='center' - style='border-bottom:1px solid black'; - INCLUDE html/cell - content=link(content='Others Recent Public Reports',href='dashboard?detail=othersreports') - align='center' - style='border-bottom:1px solid black'; - END; - WRAPPER html/row; - WRAPPER html/cell valign='top' style='height:200px'; - INCLUDE my_reports limit=5; - END; - WRAPPER html/cell valign='top'; - INCLUDE public_reports limit=5; - END; - END; - WRAPPER html/row; - INCLUDE html/cell - content=link(content='My Recent Templates',href='dashboard?detail=mytemplates') - align='center' - style='border-bottom:1px solid black'; - INCLUDE html/cell - content=link(content='Others Recent Public Templates',href='dashboard?detail=otherstemplates') - align='center' - style='border-bottom:1px solid black'; - END; - WRAPPER html/row; - WRAPPER html/cell valign='top' style='height:200px'; - INCLUDE my_templates limit=5; - END; - WRAPPER html/cell valign='top'; - INCLUDE public_templates limit=5; - END; - END; - WRAPPER html/row; - INCLUDE html/cell - colspan=2 - align='center' - content=link(content='Core Fact Tables',href='dashboard?detail=facttables') - style='border-bottom:1px solid black'; - END; - WRAPPER html/row; - WRAPPER html/cell colspan=2 valign='top'; - INCLUDE fact_tables; - END; - END; - END; -END; - -BLOCK my_reports; - q = "SELECT * FROM reporter.stage3 WHERE owner = " _ user.id() _ - " ORDER BY runtime DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_reports; - -END; - -BLOCK public_reports; - q = "SELECT * FROM reporter.stage3 WHERE pub is true" _ - " and owner != " _ user.id() _ " ORDER BY runtime DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_reports; - -END; - -BLOCK show_reports; - WRAPPER html/table width='100%'; - WRAPPER html/row; - INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Report Name' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Scheduled Run Time
Last Run Time' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Recurrence' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Runs' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - END; - FOR report = DBI.query(q); - rid = report.id; - bg='lightblue'; - IF loop.count % 2; - bg='white'; - END; - run_q = 'SELECT * FROM reporter.output WHERE stage3 = ? ORDER BY queue_time LIMIT 1'; - run_count_q = 'SELECT count(*) as count FROM reporter.output WHERE stage3 = ?'; - - s = DBI.prepare(run_count_q); - run_count = s.execute(rid); - - s = DBI.prepare(run_q); - run = s.execute(rid); - - WRAPPER html/row; - p = utils.JSON2perl( report.params ); - INCLUDE html/cell content=(report.pub ? 'Y' : 'N') col=bg style='border:solid gray 1px;' align='center'; - INCLUDE html/cell content=link(content=p.reportname,href="stage3?id=$rid") col=bg style='border:solid gray 1px;'; - INCLUDE html/cell nowrap='nowrap' content=report.create_date.chunk(19).0 col=bg style='border:solid gray 1px;'; - INCLUDE html/cell - nowrap='nowrap' - content=report.runtime.chunk(19).0 _ '
' _ run.get.run_time.chunk(19).0 - col=bg - style='border:solid gray 1px;'; - INCLUDE html/cell content=report.recurrence col=bg style='border:solid gray 1px;'; - INCLUDE html/cell content=run_count.get.count col=bg style='border:solid gray 1px;'; - END; - END; - END; -END; - -BLOCK my_templates; - q = "SELECT * FROM reporter.stage2 WHERE " _ - " owner = " _ user.id() _ " ORDER BY create_date DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_templates; - -END; - -BLOCK public_templates; - q = "SELECT * FROM reporter.stage2 WHERE pub is true" _ - " and owner != " _ user.id() _ " ORDER BY create_date DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_templates; - -END; - -BLOCK show_templates; - WRAPPER html/table width='100%' class='withborder'; - WRAPPER html/row; - INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Template Name' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - END; - FOR template = DBI.query(q); - tid = template.id; - bg='lightblue'; - IF loop.count % 2; - bg='white'; - END; - WRAPPER html/row; - p = utils.JSON2perl( template.params ); - INCLUDE html/cell content=(template.pub ? 'Y' : 'N') col=bg style='border:solid gray 1px;' align='center'; - INCLUDE html/cell content=link(content=p.templatename,href="stage2?id=$tid") col=bg style='border:solid gray 1px;'; - INCLUDE html/cell content=template.create_date.chunk(10).0 col=bg style='border:solid gray 1px;'; - END; - END; - END; -END; - -BLOCK fact_tables; - WRAPPER html/table width='100%' class='withborder'; - WRAPPER html/row; - INCLUDE html/cell content='Fact table' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Description' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - END; - - fact_table_xpath = "/reporter/tables/table[@fact-table='true']"; - FOR tab = config.findnodes(fact_table_xpath); - tid = tab.findvalue('@id'); - bg='lightblue'; - IF loop.count % 2; - bg='white'; - END; - WRAPPER html/row; - p = utils.JSON2perl( template.params ); - INCLUDE html/cell - col=bg - content=link(content=tab.findvalue('label'),href="stage1?id=$tid") style='border:solid gray 1px;'; - INCLUDE html/cell content=tab.findvalue('description') style='border:solid gray 1px;'; - END; - END; - END; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/class_manip b/Open-ILS/src/reporter/templates/class_manip deleted file mode 100644 index dd01c20229..0000000000 --- a/Open-ILS/src/reporter/templates/class_manip +++ /dev/null @@ -1,116 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK class_table; - WRAPPER html/table width='100%' style='border-top: 1px solid black'; - WRAPPER html/row; - WRAPPER html/cell align="right" width="30%"; - %]Name:[% - END; - WRAPPER html/cell; - classname.findvalue('label'); - END; - END; - WRAPPER html/row; - WRAPPER html/cell align="right"; - %]Description:[% - END; - WRAPPER html/cell; - classname.findvalue('description'); - END; - END; - IF classname.findvalue('@fact-table') == 'true' AND CGI.param('create_stage2') != 1; - WRAPPER html/row; - WRAPPER html/cell align="right"; - %]Actions:[% - END; - WRAPPER html/cell; - IF CGI.param('detail'); - %]No Details[% - ELSE; - %]Details[% - END; - %]|New Report Template[% - END; - END; - WRAPPER html/row; - 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()); - FOR r = DBI.query(q); - INCLUDE anchor - href="stage2?id=" _ r.id - content=utils.JSON2perl(r.params).templatename; - '
'; - END; - END; - END; - END; - - INCLUDE class_detail IF CGI.param('detail') == 1; - END; -END; - - - - - - -BLOCK class_fields; - FOR f = classname.findnodes('fields/field'); - WRAPPER html/row; - WRAPPER html/cell align="right"; - f.findvalue('label'); - END; - WRAPPER html/cell; - %] ([% - IF f.findvalue('description'); - f.findvalue('description'); - %] -- [% - END; - f.findvalue('@name')%]::[%f.findvalue('@datatype') %])[% - END; - END; - END; -END; - - - - - - -BLOCK class_detail; - - INCLUDE class_fields; - - IF classname.findvalue('@fact-table') == 'true' AND nosub != 1; - WRAPPER html/row; - WRAPPER html/cell align="right"; - %]Report Dimensions
and Attributes:
[% - END; - WRAPPER html/cell; - incs = classname.findnodes('links/link/@field'); - - FOR dim = incs; - link_xpath = '/reporter/tables/table[@id="' _ fact_table _'"]'_ - '/links/link[@field="' _ dim.value() _ '"]/@table'; - logme(link_xpath); - - dim_table = config.findvalue(link_xpath); - - dim_xpath = '/reporter/tables/table[@id="' _ dim_table _ '"]'; - logme(dim_xpath); - - dim_def = config.findnodes(dim_xpath); - - INCLUDE class_table classname = dim_def; - END; - END; - END; - END; -END; - -%] - diff --git a/Open-ILS/src/reporter/templates/dashboard.ttk b/Open-ILS/src/reporter/templates/dashboard.ttk deleted file mode 100644 index 064ee229e2..0000000000 --- a/Open-ILS/src/reporter/templates/dashboard.ttk +++ /dev/null @@ -1,323 +0,0 @@ -[% - -PROCESS inputs; -PROCESS class_manip; -PROCESS widget_manip; -PROCESS logic_header.ttk; - -pagetype = CGI.param('detail'); -templates = DBI.tie('reporter.stage2', 'id') -reports = DBI.tie('reporter.stage3', 'id') -outputs = DBI.tie('reporter.output', 'id') - - -%] [% - -SWITCH pagetype; - CASE 'myreports'; - INCLUDE header.ttk title="Reporter Dashboard -- Scheduled Reports"; - INCLUDE navbar.ttk + my_scheduled_reports; - CASE 'mycompletereports'; - INCLUDE header.ttk title="Reporter Dashboard -- Active Reports"; - INCLUDE navbar.ttk + my_completed_reports; - CASE 'report_template_tree'; - INCLUDE header.ttk title="Reporter Dashboard -- Schedule a report"; - INCLUDE navbar.ttk + report_template_tree; - CASE; - INCLUDE header.ttk title="Reporter Dashboard"; - INCLUDE navbar.ttk + summary; -END; - -PROCESS logout.ttk; - -BLOCK summary; - WRAPPER html/table border=0 width='100%'; - WRAPPER html/row; - INCLUDE html/cell - content=link(content='Active reports',href='dashboard?detail=mycompletereports') - align='center' - style='border-bottom:1px solid black'; - END; - WRAPPER html/row; - WRAPPER html/cell valign='top' style='height:200px'; - INCLUDE my_completed_reports limit=5; - END; - END; - WRAPPER html/row; - INCLUDE html/cell - content=link(content='Manage scheduled reports',href='dashboard?detail=myreports') - align='center' - style='border-bottom:1px solid black'; - END; - WRAPPER html/row; - WRAPPER html/cell valign='top' style='height:200px'; - INCLUDE my_scheduled_reports limit=5; - END; - END; - WRAPPER html/row; - INCLUDE html/cell - colspan=2 - align='center' - content=link(content='Schedule a new report',href='dashboard?detail=report_template_tree') - style='border-bottom:1px solid black'; - END; - WRAPPER html/row; - WRAPPER html/cell colspan=2 valign='top'; - INCLUDE report_template_tree; - '


'; - END; - END; - END; -END; - -BLOCK my_completed_reports; - q = "SELECT o.* FROM reporter.stage3 s JOIN reporter.output o ON (o.stage3 = s.id) WHERE s.owner = " _ user.id() _ - " ORDER BY COALESCE(o.complete_time, o.error_time, o.run_time, o.queue_time) DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_complete_reports; - -END; - -BLOCK my_scheduled_reports; - q = "SELECT * FROM reporter.stage3 WHERE owner = " _ user.id() _ - " AND runtime > now() ORDER BY runtime"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_reports; - -END; - -BLOCK show_complete_reports; - WRAPPER html/table width='100%' class='sortable' id='show_complete_reports'; - WRAPPER html/row; - INCLUDE html/cell content='Status' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Base Template' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Report Defintion' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Last Action Time' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - END; - FOR output = DBI.query(q); - rid = output.stage3; - - bg='lightblue'; - IF loop.count % 2; - bg='white'; - END; - - report = reports.$rid; - - tid = report.stage2; - template = templates.$tid; - - p = utils.JSON2perl( report.params ); - t = utils.JSON2perl( template.params ); - - state = 'Waiting in line...'; - - IF output.state == 'complete'; - state = 'Complete'; - runtime = output.complete_time; - ELSIF output.state == 'error'; - state = 'ERROR'; - runtime = output.error_time; - ELSIF output.state == 'running'; - state = 'Running'; - runtime = output.run_time; - END; - - name_link = link(content=p.reportname,href="stage3?id=$rid#$output.id"); - #name_link = t.templatename _ ' :: ' _ name_link; - - WRAPPER html/row; - INCLUDE html/cell - width='5%' - nowrap='nowrap' - content=state - col=bg - style='padding:5px; border:solid gray 1px;'; - INCLUDE html/cell - content=t.templatename - col=bg - style='border:solid gray 1px;'; - INCLUDE html/cell - content=name_link - col=bg - style='border:solid gray 1px;'; - INCLUDE html/cell - nowrap='nowrap' - content=runtime.chunk(16).0 - col=bg - style='border:solid gray 1px;'; - END; - END; - END; -END; - - -BLOCK show_reports; - WRAPPER html/table width='100%' class='sortable' id='show_reports'; - WRAPPER html/row; - INCLUDE html/cell content='Runs' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Base Template' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Report Definition' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - #INCLUDE html/cell content='Create date' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Scheduled Run Time' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - END; - FOR report = DBI.query(q); - rid = report.id; - bg='lightblue'; - IF loop.count % 2; - bg='white'; - END; - run_q = 'SELECT * FROM reporter.output WHERE stage3 = ? ORDER BY queue_time LIMIT 1'; - run_count_q = 'SELECT count(*) as count FROM reporter.output WHERE stage3 = ?'; - - s = DBI.prepare(run_count_q); - run_count = s.execute(rid); - - s = DBI.prepare(run_q); - run = s.execute(rid); - - WRAPPER html/row; - - tid = report.stage2; - template = templates.$tid; - - p = utils.JSON2perl( report.params ); - t = utils.JSON2perl( template.params ); - - - rtime = report.runtime.chunk(16).0; - IF report.disable; - rtime = rtime _ '
(Disabled)'; - END; - - name_link = link(content=p.reportname,href="stage3?id=$rid"); - #name_link = t.templatename _ ' :: ' _ name_link; - - INCLUDE html/cell content=run_count.get.count col=bg style='text-align: center; border:solid gray 1px;'; - INCLUDE html/cell content=(report.pub ? 'Y' : 'N') col=bg style='border:solid gray 1px;' align='center'; - INCLUDE html/cell content=t.templatename col=bg style='border:solid gray 1px;'; - INCLUDE html/cell content=name_link col=bg style='border:solid gray 1px;'; - #INCLUDE html/cell nowrap='nowrap' content=report.create_date.chunk(16).0 col=bg style='border:solid gray 1px;'; - INCLUDE html/cell - nowrap='nowrap' - content=rtime - col=bg - style='text-align: center; border:solid gray 1px;'; - END; - END; - END; -END; - -BLOCK my_templates; - q = "SELECT * FROM reporter.stage2 WHERE " _ - " owner = " _ user.id() _ " ORDER BY create_date DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_templates; - -END; - -BLOCK public_templates; - q = "SELECT * FROM reporter.stage2 WHERE pub is true" _ - " and owner != " _ user.id() _ " ORDER BY create_date DESC"; - IF limit > 0; - q = q _ ' LIMIT ' _ limit; - END; - - logme(q); - - INCLUDE show_templates; - -END; - -BLOCK show_templates; - WRAPPER html/table width='100%' class='withborder'; - WRAPPER html/row; - INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Template Name' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;'; - END; - FOR template = DBI.query(q); - tid = template.id; - bg='lightblue'; - IF loop.count % 2; - bg='white'; - END; - WRAPPER html/row; - p = utils.JSON2perl( template.params ); - INCLUDE html/cell content=(template.pub ? 'Y' : 'N') col=bg style='border:solid gray 1px;' align='center'; - INCLUDE html/cell content=link(content=p.templatename,href="stage2?id=$tid") col=bg style='border:solid gray 1px;'; - INCLUDE html/cell content=template.create_date.chunk(10).0 col=bg style='border:solid gray 1px;'; - END; - END; - END; -END; - -BLOCK report_template_tree; - - fact_table_xpath = "/reporter/tables/table[@fact-table='true']"; - - FOR tab = config.findnodes(fact_table_xpath); - counter = loop.count - tid = tab.findvalue('@id'); - tname = tab.findvalue('label'); - tdesc = tab.findvalue('description'); - "
"; - content=link(content=tab.findvalue('label'),href="stage1?id=$tid") style='border:solid gray 1px;'; - ""; - - q = "SELECT * FROM reporter.stage2 WHERE (pub is true" _ - " or owner = " _ user.id() _ ") and stage1 = '$tid' ORDER BY create_date DESC"; - - FOR template = DBI.query(q); - p = utils.JSON2perl( template.params ); - s2id = template.id; - ""; - - q3 = "SELECT * FROM reporter.stage3 WHERE (pub is true" _ - " or owner = " _ user.id() _ ") and stage2 = '$s2id' ORDER BY create_date DESC"; - FOR report = DBI.query(q3); - p = utils.JSON2perl( report.params ); - s3id = report.id; - ""; - END; - - END; - END; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/footer.ttk b/Open-ILS/src/reporter/templates/footer.ttk deleted file mode 100644 index cafa17e2ca..0000000000 --- a/Open-ILS/src/reporter/templates/footer.ttk +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Open-ILS/src/reporter/templates/header.ttk b/Open-ILS/src/reporter/templates/header.ttk deleted file mode 100644 index 8714e0d9b9..0000000000 --- a/Open-ILS/src/reporter/templates/header.ttk +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - [% title %] - - - - - [% content %] - - diff --git a/Open-ILS/src/reporter/templates/html/body b/Open-ILS/src/reporter/templates/html/body deleted file mode 100644 index 9593f6da15..0000000000 --- a/Open-ILS/src/reporter/templates/html/body +++ /dev/null @@ -1,25 +0,0 @@ -[% - - #--------------------------------------------------------------------------------- - #html/body: ... element for HTML pages - # - # ARGS: - # - # content # body content - #--------------------------------------------------------------------------------- - - ""; - - content; - - ""; - -%] diff --git a/Open-ILS/src/reporter/templates/html/cell b/Open-ILS/src/reporter/templates/html/cell deleted file mode 100644 index 8a9d680f2c..0000000000 --- a/Open-ILS/src/reporter/templates/html/cell +++ /dev/null @@ -1,25 +0,0 @@ -[%# html/cell: an empty and orphaned HTML table cell, . . . - # ARGS: - # col # background colour (default: none) - # align # horizontal alignment (default: none) - # valign # vertical alignment (default: none) - # colspan # span multiple columns (defualt: none) - # rowspan # span multiple rows (defualt: none) - # content # box content --%] - - -[%- content -%] - - diff --git a/Open-ILS/src/reporter/templates/html/center b/Open-ILS/src/reporter/templates/html/center deleted file mode 100644 index c72e721df3..0000000000 --- a/Open-ILS/src/reporter/templates/html/center +++ /dev/null @@ -1 +0,0 @@ -
[% content %]
diff --git a/Open-ILS/src/reporter/templates/html/html b/Open-ILS/src/reporter/templates/html/html deleted file mode 100644 index c45a0c6f32..0000000000 --- a/Open-ILS/src/reporter/templates/html/html +++ /dev/null @@ -1,6 +0,0 @@ - -[% USE x = Unicode %] - - -[% content; %] - diff --git a/Open-ILS/src/reporter/templates/html/row b/Open-ILS/src/reporter/templates/html/row deleted file mode 100644 index a1ecd266c3..0000000000 --- a/Open-ILS/src/reporter/templates/html/row +++ /dev/null @@ -1,17 +0,0 @@ -[%# row: an empty and orphaned HTML table row, . . . - # ARGS: - # col # background colour (default: none) - # valign # vertical alignment (default: none) - # align # horizontal alignment (default: none) - # content # box content --%] - - -[%- content -%] - - diff --git a/Open-ILS/src/reporter/templates/html/table b/Open-ILS/src/reporter/templates/html/table deleted file mode 100644 index 1a2a83a46a..0000000000 --- a/Open-ILS/src/reporter/templates/html/table +++ /dev/null @@ -1,19 +0,0 @@ -[%# table: an empty HTML table . . .
- # ARGS: - # border # border width (default: 0) - # col # background colour (default: none) - # width # width of box (default: none, grow to fit content) - # pad # cellpadding (default: none) - # cellspace # cellspacing (default: none) - # content # box content --%] - -[%- content -%] -
diff --git a/Open-ILS/src/reporter/templates/html/th b/Open-ILS/src/reporter/templates/html/th deleted file mode 100644 index 9877d65d3d..0000000000 --- a/Open-ILS/src/reporter/templates/html/th +++ /dev/null @@ -1,25 +0,0 @@ -[%# html/cell: an empty and orphaned HTML table cell, . . . - # ARGS: - # col # background colour (default: none) - # align # horizontal alignment (default: none) - # valign # vertical alignment (default: none) - # colspan # span multiple columns (defualt: none) - # rowspan # span multiple rows (defualt: none) - # content # box content --%] - - -[%- content -%] - - diff --git a/Open-ILS/src/reporter/templates/inputs b/Open-ILS/src/reporter/templates/inputs deleted file mode 100644 index 0f9373ba50..0000000000 --- a/Open-ILS/src/reporter/templates/inputs +++ /dev/null @@ -1,97 +0,0 @@ -[% - -BLOCK form; - '
' _ content _ '
'; -END; - -BLOCK text; - %][% -END; - -BLOCK textarea; - %][% -END; - -BLOCK select; - %][% -END; - -BLOCK option; - %][% -END; - -BLOCK hidden; - %][% -END; - -BLOCK radio; - %][% -END; - -BLOCK checkbox; - %][% -END; - -BLOCK submit; - %][% -END; - -BLOCK button; - %][% -END; - -MACRO link INCLUDE anchor; - -BLOCK anchor; - %][%content%][% -END; - -%] - diff --git a/Open-ILS/src/reporter/templates/logic_header.ttk b/Open-ILS/src/reporter/templates/logic_header.ttk deleted file mode 100644 index dcb361daf4..0000000000 --- a/Open-ILS/src/reporter/templates/logic_header.ttk +++ /dev/null @@ -1,44 +0,0 @@ - -[% - -PROCESS utils; - -BLOCK logme_block; - "\n\t\n"; -END; - -MACRO logme(a) PROCESS logme_block x = a.list.join(', '); - -USE CGI; -USE DBI; -USE WebSession; -USE utils = WebUtils; -USE config = XML.LibXML(config_xml, expand_xinclude => 1); - - -dir = '/reporter/setup/files/' _ stage_dir; -dir = config.findvalue(dir); - -dbdriver = config.findvalue('/reporter/setup/database/driver'); -dbname = config.findvalue('/reporter/setup/database/name'); -dbhost = config.findvalue('/reporter/setup/database/host'); -dbport = config.findvalue('/reporter/setup/database/port') || '5432'; -d_u = config.findvalue('/reporter/setup/database/user'); -d_p = config.findvalue('/reporter/setup/database/password'); - -dsn = "dbi:" _ dbdriver _ ":dbname=" _ dbname _';host=' _ dbhost _ ';port=' _ dbport; - -logme([dsn,d_u,d_p]); - -DBI.connect(dsn,d_u,d_p,pg_enable_utf8=1); - -stage2_insert = 'INSERT INTO reporter.stage2 (stage1, params, owner, pub)' _ - ' VALUES ( ?,?,?,? )'; - -stage3_insert = 'INSERT INTO reporter.stage3 (stage2, params, owner, pub, runtime, recurrence)' _ - ' VALUES ( ?,?,?,?,?,? )'; -%] diff --git a/Open-ILS/src/reporter/templates/login.ttk b/Open-ILS/src/reporter/templates/login.ttk deleted file mode 100644 index 9e453ab94d..0000000000 --- a/Open-ILS/src/reporter/templates/login.ttk +++ /dev/null @@ -1,86 +0,0 @@ - - - [% INCLUDE header.ttk title="Login" %] - - - - - -
-
-

Reports Login

- - - - - - - - - - - - -
Username:
Password:
-
- - - - [% INCLUDE footer.ttk %] - - - - - - diff --git a/Open-ILS/src/reporter/templates/logout.ttk b/Open-ILS/src/reporter/templates/logout.ttk deleted file mode 100644 index 731c51b877..0000000000 --- a/Open-ILS/src/reporter/templates/logout.ttk +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/Open-ILS/src/reporter/templates/navbar.ttk b/Open-ILS/src/reporter/templates/navbar.ttk deleted file mode 100644 index 458c1ad2e2..0000000000 --- a/Open-ILS/src/reporter/templates/navbar.ttk +++ /dev/null @@ -1,12 +0,0 @@ - - Logout | - Dashboard - [% IF links.list.size > 0; - ' | '; - links.list.join(' | '); - END; %] - - -
-
- diff --git a/Open-ILS/src/reporter/templates/select_sorter.js b/Open-ILS/src/reporter/templates/select_sorter.js deleted file mode 100644 index e195313e54..0000000000 --- a/Open-ILS/src/reporter/templates/select_sorter.js +++ /dev/null @@ -1,161 +0,0 @@ - diff --git a/Open-ILS/src/reporter/templates/stage1.ttk b/Open-ILS/src/reporter/templates/stage1.ttk deleted file mode 100644 index 7a62f2958b..0000000000 --- a/Open-ILS/src/reporter/templates/stage1.ttk +++ /dev/null @@ -1,150 +0,0 @@ -[% - -PROCESS inputs; -PROCESS class_manip; -PROCESS widget_manip; -PROCESS logic_header.ttk; -INCLUDE logout.ttk; - -WRAPPER html/html; - INCLUDE header.ttk + navbar.ttk title="Basic Report Types"; - WRAPPER html/body html.body.onload= - "if (document.getElementById('templatename')) {" _ - "document.getElementById('templatename').focus();" _ - "document.getElementById('templatename').select();}"; - IF !CGI.param('id'); - INCLUDE all_stage1; - ELSE; - INCLUDE one_stage1; - END; - END; - INCLUDE footer.ttk; -END; - - - - -#============================================================================= - - -BLOCK one_stage1; - table_xpath = - '/reporter/tables/table[@id="' _ - CGI.param('id') _ '"]'; - table = config.findnodes(table_xpath); - - fact_table = table.findvalue('@id'); - logme(fact_table); - - INCLUDE class_table classname=table; - - INCLUDE stage2_new IF CGI.param('create_stage2') == 1; - -END; - - - - -BLOCK all_stage1; - '
    '; - - FOR tab = config.findnodes("/reporter/tables/table[@fact-table='true']"); - - fact_table = tab.findvalue("@id"); - logme("Fact Table is $fact_table"); - - '
  • '; - - INCLUDE class_table classname=tab; - - IF loop.count != loop.size; - '
    '; - END; - END; - '
'; -END; - - - - - -BLOCK stage2_new; - col_xpath = "/reporter/tables/table[@id='" _ fact_table _ "']/fields/field[@core='true']"; - logme(col_xpath); - - %]
- - - -
- Template name


-
- Select Filter Widgets and Output Dimensions
[% - - - WRAPPER html/table width="100%" style='border-top: 1px solid black'; - WRAPPER html/row; - WRAPPER html/cell colspan=2 align='left' style="padding-left: 30px; border: solid black 1px; background: lightgray;"; - # hidden input here ... - table = config.findnodes("/reporter/tables/table[@id='$fact_table']"); - INCLUDE hidden name="filter" value=fact_table; - table.findvalue('label'); - ' Core Columns'; - END; - END; - #WRAPPER html/row; - # INCLUDE html/cell content='Attribute' align='right'; - # INCLUDE html/cell content='Widget' align='center'; - #END; - INCLUDE widget_selector tableid=fact_table columns=config.findnodes(col_xpath) force=1; - END; - - dim_xpath = "/reporter/tables/table[@id='$fact_table']/links/link"; - FOR dim_link = config.findnodes(dim_xpath); - dim_table = dim_link.findvalue('@table'); - link_id = dim_link.findvalue('@id'); - dimension = config.findnodes("/reporter/tables/table[@id='$dim_table']"); - - '

'; - - WRAPPER html/table width="100%" style='border-top: 1px solid black'; - WRAPPER html/row; - WRAPPER html/cell align='left' width="33%" style="padding-left: 30px; border: solid black 1px; background: lightgray;"; - - link_label_xpath = '../../fields/field[@name="' _ dim_link.findvalue('@field') _ '"]/label'; - dim_link.findvalue(link_label_xpath); - - ' -- '; - dimension.findvalue('label'); - ' Dimension'; - - END; - WRAPPER html/cell align='left' style="padding-left: 30px; border: solid black 1px; background: white;"; - # checkbox input here ... - INCLUDE checkbox name="filter" value=link_id checked=1; - 'Allow these columns to be used in Report Output'; - END; - END; - INCLUDE widget_selector tableid=link_id; - END; - END; - - %] - Public template

- [% - INCLUDE submit name='button' value='Save'; - - '
'; - -END; - -%] - diff --git a/Open-ILS/src/reporter/templates/stage2.ttk b/Open-ILS/src/reporter/templates/stage2.ttk deleted file mode 100644 index d6d26d308b..0000000000 --- a/Open-ILS/src/reporter/templates/stage2.ttk +++ /dev/null @@ -1,670 +0,0 @@ -[% - -WRAPPER html/html; - WRAPPER header.ttk + navbar.ttk title="Report Templates"; - PROCESS inputs; - PROCESS class_manip; - PROCESS widget_manip; - INCLUDE logout.ttk; - END; - - WRAPPER html/body; - - PROCESS logic_header.ttk; - PROCESS select_sorter.js; - - templates = DBI.tie('reporter.stage2', 'id') - reports = DBI.tie('reporter.stage3', 'id') - tmpl = {}; - - - IF CGI.param('id'); - tid = CGI.param('id'); - tmpl = templates.$tid; - END; - - IF CGI.param('action') == 'save'; - PROCESS save_stage2; - ELSIF CGI.param('action') == 'edit'; - rid = CGI.param('report'); - r = reports.$rid; - report = utils.JSON2perl( r.params ); - PROCESS run_stage2; - ELSIF CGI.param('action') == 'run'; - PROCESS run_stage2; - ELSE; - PROCESS view_stage2; - END; - END; - INCLUDE footer.ttk; -END; - - - - -BLOCK save_stage2; - stage1 = CGI.param('stage1'); - pub = CGI.param('publictemplate') OR 'f'; - owner = user.id(); - - p_obj = {}; - FOR p = CGI.param(); - - logme([p,CGI.param(p)]); - - parts = p.split(':'); - p1 = parts.0; - p2 = parts.1; - p3 = parts.2; - p4 = parts.3; - - IF p4 - AND (CGI.param("$p1").list.grep("^$p2$").size > 0) - AND (CGI.param("$p1:$p2").list.grep("^$p3$").size > 0) - AND (CGI.param("$p1:$p2:$p3").list.grep("^$p4$").size > 0); - - p_obj.$p1.$p2.$p3.$p4 = CGI.param(p); - - ELSIF p2 - AND (CGI.param("$p1").list.grep(p2).size > 0); - p_obj.dims.$p2 = 1; - ELSIF p1 != 'filter'; - p_obj.$p1 = CGI.param(p); - END; - - END; - - params = utils.perl2JSON( p_obj ); - - logme([stage1, params, owner, pub]); - - q = DBI.prepare( stage2_insert ); - CALL q.execute(stage1, params, owner, pub); - - FOR new_s2 = DBI.query("SELECT * FROM reporter.stage2_id_seq;"); - tid = new_s2.last_value; - INCLUDE view_stage2 tmpl = templates.$tid; - END; -END; - - - - -BLOCK edit_stage2; - -END; - - - - - -BLOCK view_stage2; - logme(tmpl.params); - params = utils.JSON2perl( tmpl.params ); - - WRAPPER html/table border=0 width='100%'; - WRAPPER html/row; - WRAPPER html/cell colspan=5 align='center'; - s1_name_xpath = '/reporter/tables/table[@id="' _ params.stage1 _ '"]/label'; - INCLUDE anchor - content=config.findvalue( s1_name_xpath ) - href="stage1?id=" _ params.stage1; - ' :: ' _ params.templatename _ '
'; - INCLUDE anchor - content="Create a report from this template" - href=CGI.url('-path', 1) _ '?action=run&id=' _ tmpl.id; - END; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=4 content="Filterable Attributes:"; - END; - - core_table = params.stage1; - - tables = params.filter.keys; - tables.unshift(core_table); - tables = tables.unique; - - FOR t = tables; - logme(['table id or link id', t]); - - f_table = INCLUDE find_table_id id=t; - - table = config.findnodes( "/reporter/tables/table[@id='$f_table']"); - WRAPPER html/row; - INCLUDE html/cell; - WRAPPER html/cell colspan=4 align='left'; - - IF t != f_table; - link_xpath = '//*[@id="' _ t _ '"]'; - dim_link = config.findnodes(link_xpath); - - link_label_xpath = - '../../fields/field[@name="' _ - dim_link.findvalue('@field') _ '"]/label'; - dim_link.findvalue(link_label_xpath); - - ' -- '; - END; - - table.findvalue( 'label' ); - END; - END; - - FOR f_field = params.filter.$t.keys; - logme([f_table,f_field]); - FOR f_fam = params.filter.$t.$f_field.keys; - logme([f_table,f_field,f_fam]); - f_widget = params.filter.$t.$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']" ); - - INCLUDE html/cell colspan=2; - INCLUDE html/cell align='right' content=field.findvalue( 'label' ); - INCLUDE html/cell align='center' content=fam.findvalue( 'label' ); - INCLUDE html/cell align='left' content=widget.findvalue( 'label' ); - END; - END; - END; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=5 content="
"; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=5 content="Attributes Available for Output"; - END; - - tables = params.dims.keys; - tables.unshift(core_table); - tables = tables.unique; - - FOR t = tables; - - f_table = INCLUDE find_table_id id=t; - - table = config.findnodes( "/reporter/tables/table[@id='$f_table']"); - tname = table.findvalue( "label" ); - tdesc = table.findvalue( "desription" ); - - #NEXT IF table.findvalue('@fact-table') == 'true'; - - WRAPPER html/row; - INCLUDE html/cell; - WRAPPER html/cell colspan=4 align='left'; - IF t != f_table; - link_xpath = '//*[@id="' _ t _ '"]'; - dim_link = config.findnodes(link_xpath); - - link_label_xpath = - '../../fields/field[@name="' _ - dim_link.findvalue('@field') _ '"]/label'; - dim_link.findvalue(link_label_xpath); - - ' -- '; - END; - tname; - END; - END; - - - FOR field = table.findnodes('fields/field[not(@primary) or @primary != "true"]'); - link_test = 'links/link[@field="' _ field.findvalue('@name') _ '" and (not(@hidden) or @hidden!="false")]'; - logme(['view_stage2 -> link_test',link_test]); - NEXT IF table.findnodes( link_test ); - - fname = field.findvalue( "label" ); - fdesc = field.findvalue( "desription" ); - - WRAPPER html/row; - - INCLUDE html/cell colspan=2; - INCLUDE html/cell align='right' content=fname; - INCLUDE html/cell colspan=2 align='center' content=fdesc; - END; - END; - END; - - END; -END; - - -BLOCK run_stage2; - logme(tmpl.params); - params = utils.JSON2perl( tmpl.params ); - - %] - -
- [% - - WRAPPER html/table width="100%"; - WRAPPER html/row; - WRAPPER html/cell align='center'; - s1_name_xpath = '/reporter/tables/table[@id="' _ params.stage1 _ '"]/label'; - INCLUDE anchor - content=config.findvalue( s1_name_xpath ) - href="stage1?id=" _ params.stage1; - ' :: ' _ params.templatename; - END; - END; - END; - - '

'; - - WRAPPER html/table border=0 width='100%'; - WRAPPER html/row; - INCLUDE html/cell colspan=4 content="Filterable Attributes

" style="border-top: solid black 2px;"; - END; - - core_table = params.stage1; - - tables = params.filter.keys; - tables.unshift(core_table) IF tables.grep("^$core_table$"); - tables = tables.unique; - - FOR t = tables; - NEXT UNLESS params.filter.$t.keys; - f_table = INCLUDE find_table_id id=t; - table = config.findnodes( "/reporter/tables/table[@id='$f_table']"); - - table_label = table.findvalue( 'label' ); - - WRAPPER html/row; - WRAPPER html/cell colspan=3 align='center' style="border: solid black 1px; background: lightgray;"; - IF t != f_table; - link_xpath = '//*[@id="' _ t _ '"]'; - dim_link = config.findnodes(link_xpath); - - link_label_xpath = - '../../fields/field[@name="' _ - dim_link.findvalue('@field') _ '"]/label'; - - table_label = table_label _ ' -- ' _ dim_link.findvalue(link_label_xpath); - END; - table_label; - END; - END; - - FOR f_field = params.filter.$t.keys; - logme([f_table,f_field]); - FOR f_fam = params.filter.$t.$f_field.keys; - logme([f_table,f_field,f_fam]); - f_widget = params.filter.$t.$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 align='left' style="padding-left: 50px;" content=field.findvalue( 'label' ); - - WRAPPER html/cell align='left'; - TRY; - classname = table.findvalue('@id'); - fieldname = field.findvalue('@name'); - widgetname = widget.findvalue('@name'); - famname = fam.findvalue('@name'); - table_alias = t; - - input_prefix = "filter:$t:$fieldname:$famname:$widgetname"; - current_value = report.filter.$t.$fieldname.$famname.$widgetname; - logme(current_value); - - PROCESS $w_file widget_family=fam; - PROCESS editor; - CATCH; - %]ARG!! Couldn't render widget [% $w_file %] ([% error.info %])!!![% - END; - END; - END; - END; - END; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=4 content="
"; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=4 content="Attributes Available for Output

" style="border-top: solid black 2px;"; - END; - - table = config.findnodes( "/reporter/tables/table[@id='$core_table']" ); - classname = table.findvalue( "@id" ); - tname = table.findvalue( "label" ); - tdesc = table.findvalue( "desription" ); - - WRAPPER html/row; - INCLUDE html/cell colspan=4 align='center' content=tname style="border: solid black 1px; background: lightgray;"; - END; - - pkey_field = table.findnodes('fields/field[@primary = "true"]'); - pid = pkey_field.findvalue('@name'); - plabel = pkey_field.findvalue('label'); - - WRAPPER html/row; - WRAPPER html/cell align='left' style="padding-left: 50px;"; - INCLUDE checkbox - checked=( - !report || report.output.$classname.$pid == 'include' - ? 'checked' - : '' - ) - name="output:$classname:$pid" - value="include" - onclick="field_add_remove(this)"; - INCLUDE hidden name="xform:type:$classname:$pid" value="count_dist"; - %] - - [% - "Per group count of $plabel

"; - END; - INCLUDE html/cell align='center'; - END; - - - tables = params.dims.keys; - tables.unshift(core_table); - tables = tables.unique; - - core_done = 0; - - FOR f_table = tables; - noheader = 0; - noheader = 1 IF f_table == core_table; - INCLUDE show_filter_atts; - WRAPPER html/row; - INCLUDE html/cell colspan=4 content="

"; - END; - END; - END; - - %] -
- - [% - - INCLUDE checkbox name="publicreport" value="t" checked=(report.publicreport == 't' ? 'checked' : ''); - 'Public Report
'; - INCLUDE submit name="action" value="Run Now"; - INCLUDE submit name="action" value="Schedule"; - - END; -END; - -BLOCK show_filter_atts; - t = f_table; - f_table = INCLUDE find_table_id id=t; - table = config.findnodes( "/reporter/tables/table[@id='$f_table']"); - classname = table.findvalue( "@id" ); - tname = table.findvalue( "label" ); - tdesc = table.findvalue( "desription" ); - - IF ! noheader; - WRAPPER html/row; - WRAPPER html/cell colspan=4 align='center' style="border: solid black 1px; background: lightgray;"; - IF t != f_table; - link_xpath = '//*[@id="' _ t _ '"]'; - dim_link = config.findnodes(link_xpath); - - link_label_xpath = - '../../fields/field[@name="' _ - dim_link.findvalue('@field') _ '"]/label'; - dim_link.findvalue(link_label_xpath); - - ' -- '; - END; - tname; - END; - END; - END; - - fields_xpath = 'fields/field[(not(@primary) or @primary != "true") or @hidden="false"]'; - - - count = 1; - - FOR field = table.findnodes(fields_xpath); - link_test = '../../links/link[@field="' _ field.findvalue('@name') _ '" and (not(@hidden) or @hidden!="false")]'; - link_test = 'links/link[@field="' _ field.findvalue('@name') _ '" and (not(@hidden) or @hidden!="false")]'; - logme(['show_filter_atts -> link_test', t, link_test]); - NEXT IF table.findnodes( link_test ); - - fname = field.findvalue( "label" ); - fid = field.findvalue( "@name" ); - - bg_color = 'white'; - IF count % 2; - bg_color = 'lightcyan'; - END; - - WRAPPER html/row; - - WRAPPER html/cell align='left' col=bg_color style="padding-left: 50px;"; - INCLUDE checkbox - name="output:$t:$fid" - value="include" - onclick="field_add_remove(this)" - checked=(report.output.$t.$fid == 'include' ? 'checked' : ''); - %] - - [% - - fname; - END; - INCLUDE html/cell align='right' content='Output Transformation:' col=bg_color; - WRAPPER html/cell align='left' col=bg_color style="padding-left: 50px;"; - - dtype = field.findvalue('@transform-group'); - IF !dtype; - dtype = field.findvalue('@datatype'); - END; - - WRAPPER select id="xform:type:$t:$fid" name="xform:type:$t:$fid" onchange="show_hide_params(this)"; - INCLUDE option value='' content='None' selected=(report.xform.type.$t.$fid == '' ? 1 : 0); - FOR xform = dtype_xform_map.$dtype; - xform_label = dtype_xforms.$xform.label; - IF dtype_xforms.$xform.param; - xform_label = "$xform_label (*)"; - END; - INCLUDE option value=xform content=xform_label selected=(report.xform.type.$t.$fid == xform ? 1 : 0); - END; - END; - - %] - -
- - *Output Tranformation Parameter: - [% INCLUDE text name="xform:param:$t:$fid" value=report.xform.param.$t.$fid %] - - - [% - END; - END; - count = count + 1; - END; -END; -%] diff --git a/Open-ILS/src/reporter/templates/stage3.ttk b/Open-ILS/src/reporter/templates/stage3.ttk deleted file mode 100644 index 6a4e83349f..0000000000 --- a/Open-ILS/src/reporter/templates/stage3.ttk +++ /dev/null @@ -1,447 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); -USE two_digits = format('%02d'); - -PROCESS inputs; -PROCESS class_manip; -PROCESS widget_manip; -PROCESS logic_header.ttk; -INCLUDE logout.ttk; - -templates = DBI.tie('reporter.stage2', 'id') -reports = DBI.tie('reporter.stage3', 'id') -output = DBI.tie('reporter.output', 'id') -rpt = {}; -tmpl = {}; - - -IF CGI.param('output'); - oid = CGI.param('output'); - out = output.$oid; - - rid = out.stage3; - rpt = reports.$rid; - - tid = rpt.stage2; - tmpl = templates.$tid; -END; - -IF CGI.param('id'); - rid = CGI.param('id'); - rpt = reports.$rid; - tid = rpt.stage2; - tmpl = templates.$tid; -END; - - -WRAPPER html/html; - INCLUDE header.ttk + navbar.ttk title="Reports"; - WRAPPER html/body; - IF CGI.param('action') == 'Schedule'; - PROCESS schedule_stage3; - ELSIF CGI.param('action') == 'enable_stage3'; - PROCESS enable; - ELSIF CGI.param('action') == 'disable_stage3'; - PROCESS disable; - ELSIF CGI.param('action') == 'Reschedule'; - PROCESS resched; - ELSIF CGI.param('action') == 'Save'; - PROCESS save_stage3; - ELSIF CGI.param('action') == 'delete_stage3'; - PROCESS delete_stage3; - ELSIF CGI.param('action') == 'delete_output'; - PROCESS delete_output; - ELSIF CGI.param('action') == 'rerun'; - PROCESS rerun; - ELSIF CGI.param('action') == 'Run Now'; - PROCESS save_stage3; - ELSIF CGI.param('id'); - PROCESS view_stage3; - ELSE; - PROCESS list_stage3s; - END; - END; - INCLUDE footer.ttk; -END; - - -BLOCK schedule_stage3; - WRAPPER form method='POST'; - 'Run Date:'; - INCLUDE text name='runtime' value= start.year _ '-' _ two_digits(start.month) _ '-' _ two_digits(start.day); - '
'; - - 'Optional Recurrence:'; - INCLUDE text name='recurrence-count' value='0'; - WRAPPER select name='recurrence-interval'; - INCLUDE option value='days' content='Day(s)'; - INCLUDE option value='weeks' content='Week(s)'; - INCLUDE option value='months' content='Month(s)'; - END; - - FOR p = CGI.param(); - NEXT IF p == 'action'; - NEXT IF p == 'runtime'; - FOR pval = CGI.param(p); - INCLUDE hidden name=p value=pval; - END; - END; - '
'; - INCLUDE submit name='action' value='Save'; - END; -END; - -BLOCK list_stage3s; -END; - - -BLOCK save_stage3; - stage2 = CGI.param('stage2'); - runtime = CGI.param('runtime') OR 'now'; - pub = CGI.param('publicreport') OR 'f'; - owner = user.id(); - - p_obj = {}; - FOR p = CGI.param(); - - logme([p,CGI.param(p)]); - - parts = p.split(':'); - p1 = parts.0; - p2 = parts.1; - p3 = parts.2; - p4 = parts.3; - p5 = parts.4; - p6 = parts.5; - - IF p6; - - IF p_obj.$p1.$p2.$p3.$p4.$p5.$p6.defined; - IF p_obj.$p1.$p2.$p3.$p4.$p5.$p6.size > 1; - p_obj.$p1.$p2.$p3.$p4.$p5.$p6.push(CGI.param(p)); - ELSE; - tmp = [ p_obj.$p1.$p2.$p3.$p4.$p5.$p6, CGI.param(p) ]; - p_obj.$p1.$p2.$p3.$p4.$p5.$p6 = tmp; - END; - ELSE; - p_obj.$p1.$p2.$p3.$p4.$p5.$p6 = CGI.param(p); - END; - - ELSIF p5; - - IF p_obj.$p1.$p2.$p3.$p4.$p5.defined; - IF p_obj.$p1.$p2.$p3.$p4.$p5.size > 1; - p_obj.$p1.$p2.$p3.$p4.$p5.push(CGI.param(p)); - ELSE; - tmp = [ p_obj.$p1.$p2.$p3.$p4.$p5, CGI.param(p) ]; - p_obj.$p1.$p2.$p3.$p4.$p5 = tmp; - END; - ELSE; - p_obj.$p1.$p2.$p3.$p4.$p5 = CGI.param(p); - END; - - ELSIF p4; - - IF p_obj.$p1.$p2.$p3.$p4.defined; - IF p_obj.$p1.$p2.$p3.$p4.size > 1; - p_obj.$p1.$p2.$p3.$p4.push(CGI.param(p)); - ELSE; - tmp = [ p_obj.$p1.$p2.$p3.$p4, CGI.param(p) ]; - p_obj.$p1.$p2.$p3.$p4 = tmp; - END; - ELSE; - p_obj.$p1.$p2.$p3.$p4 = CGI.param(p); - END; - - ELSIF p3; - - IF p_obj.$p1.$p2.$p3.defined; - IF p_obj.$p1.$p2.$p3.size > 1; - p_obj.$p1.$p2.$p3.push(CGI.param(p)); - ELSE; - tmp = [ p_obj.$p1.$p2.$p3, CGI.param(p) ]; - p_obj.$p1.$p2.$p3 = tmp; - END; - ELSE; - p_obj.$p1.$p2.$p3 = CGI.param(p); - END; - - ELSIF p2; - - IF p_obj.$p1.$p2.defined; - IF p_obj.$p1.$p2.size > 1; - p_obj.$p1.$p2.push(CGI.param(p)); - ELSE; - tmp = [ p_obj.$p1.$p2, CGI.param(p) ]; - p_obj.$p1.$p2 = tmp; - END; - ELSE; - p_obj.$p1.$p2 = CGI.param(p); - END; - - ELSE; - - p_obj.$p = CGI.param(p); - - END; - END; - - params = utils.perl2JSON( p_obj ); - - recurrence = '0 sec'; - IF CGI.param('recurrence-count') > 0; - recurrence = CGI.param('recurrence-count') _ ' ' _ CGI.param('recurrence-interval'); - END; - - logme([stage2, params, owner, pub]); - - q = DBI.prepare( stage3_insert ); - CALL q.execute(stage2, params, owner, pub, runtime, recurrence); - - FOR new_s3 = DBI.query("SELECT * FROM reporter.stage3_id_seq;"); - rid = new_s3.last_value; - rpt = reports.$rid; - tid = rpt.stage2; - tmpl = templates.$tid; - INCLUDE view_stage3; - END; -END; - -BLOCK delete_stage3; - q = DBI.prepare( 'DELETE FROM reporter.stage3 WHERE id = ?' ); - CALL q.execute(rpt.id); -END; - -BLOCK delete_output; - q = DBI.prepare( 'DELETE FROM reporter.output WHERE id = ?' ); - CALL q.execute(out.id); - INCLUDE view_stage3; -END; - -BLOCK enable; - q = DBI.prepare( 'UPDATE reporter.stage3 SET disable = FALSE WHERE id = ?' ); - CALL q.execute(CGI.param('id')); - INCLUDE view_stage3; -END; - -BLOCK disable; - q = DBI.prepare( 'UPDATE reporter.stage3 SET disable = TRUE WHERE id = ?' ); - CALL q.execute(CGI.param('id')); - INCLUDE view_stage3; -END; - -BLOCK resched; - q = DBI.prepare( 'UPDATE reporter.stage3 SET runtime = ? WHERE id = ?' ); - CALL q.execute(CGI.param('newtime'), CGI.param('id')); - INCLUDE view_stage3; -END; - -BLOCK rerun; - q = DBI.prepare( 'UPDATE reporter.stage3 SET rerun = TRUE WHERE id = ?' ); - CALL q.execute(rpt.id); - INCLUDE view_stage3; -END; - -BLOCK view_stage3; - logme(rpt.params); - params = utils.JSON2perl( rpt.params ); - s2_params = utils.JSON2perl( tmpl.params ); - - - WRAPPER html/center; - WRAPPER html/table style="border-collapse:collapse"; - WRAPPER html/row; - INCLUDE html/cell content="Report Name" style="border:solid gray 1px;"; - INCLUDE html/cell content=params.reportname style="border:solid gray 1px;"; - END; - WRAPPER html/row; - INCLUDE html/cell content="Based on Template" style="border:solid gray 1px;"; - INCLUDE html/cell content=s2_params.templatename style="border:solid gray 1px;"; - END; - WRAPPER html/row; - INCLUDE html/cell content="Creation Time" style="border:solid gray 1px;"; - INCLUDE html/cell content=rpt.create_date.chunk(19).0 style="border:solid gray 1px;"; - END; - WRAPPER html/row; - INCLUDE html/cell content="Scheduled Run Time" style="border:solid gray 1px;"; - IF user.id == rpt.owner; - WRAPPER html/cell style="border:solid gray 1px;"; - WRAPPER form method="post"; - INCLUDE hidden name="id" value=rpt.id; - INCLUDE text name="newtime" value=rpt.runtime.chunk(19).0; - INCLUDE submit name="action" value="Reschedule"; - END; - END; - ELSE; - INCLUDE html/cell content=rpt.runtime style="border:solid gray 1px;"; - END; - END; - WRAPPER html/row; - INCLUDE html/cell content="Recurrence Interval" style="border:solid gray 1px;"; - INCLUDE html/cell content=rpt.recurrence style="border:solid gray 1px;"; - END; - WRAPPER html/row; - INCLUDE html/cell content="Selection Criteria" style="border:solid gray 1px; vertical-align: top;"; - WRAPPER html/cell style="border:solid gray 1px;"; - WRAPPER html/table width="100%" style="border-collapse:collapse;"; - FOR t = params.filter.keys; - FOR c = params.filter.$t.keys; - FOR wf = params.filter.$t.$c.keys; - FOR w = params.filter.$t.$c.$wf.keys; - WRAPPER html/row; - xpath = '/reporter/tables/table[@id="' _ t _ '" and @fact-table="true"]'; - table = config.findnodes(xpath); - IF !table; - xpath = '/reporter/tables/table[@id=//link[@id="' _ t _ '"]/@table]'; - table = config.findnodes(xpath); - END; - - INCLUDE html/cell - content = table.findvalue('label') - style="border:solid gray 1px; top; font-weight:bold;"; - - xpath = 'fields/field[@name="' _ c _ '"]/label'; - INCLUDE html/cell - content = table.findvalue(xpath) - style="border:solid gray 1px; font-weight:bold;"; - - WRAPPER html/cell - style="border:solid gray 1px; vertical-align: top;"; - w_file = 'widgets/' _ wf _ '.' _ w; - current_value = params.filter.$t.$c.$wf.$w; - PROCESS $w_file; - PROCESS display; - END; - END; - END; - END; - END; - END; - END; - END; - END; - WRAPPER html/row; - INCLUDE html/cell content="Output Attributes" style="border:solid gray 1px; vertical-align: top;"; - WRAPPER html/cell style="border:solid gray 1px;"; - FOR t = params.output.keys; - FOR c = params.output.$t.keys; - xpath = '/reporter/tables/table[@id="' _ t _ '" and @fact-table="true"]'; - table = config.findnodes(xpath); - IF !table; - xpath = '/reporter/tables/table[@id=//link[@id="' _ t _ '"]/@table]'; - table = config.findnodes(xpath); - END; - - xpath = 'fields/field[@name="' _ c _ '"]/label'; - table.findvalue('label') _ ' -- ' _ table.findvalue(xpath) _ '
'; - - END; - END; - END; - END; - WRAPPER html/row; - INCLUDE html/cell content="Actions" style="border:solid gray 1px;"; - WRAPPER html/cell style="border:solid gray 1px;"; - INCLUDE anchor content='Refresh' href=CGI.url('-path', 1) _ '?id=' _ rpt.id; - '   '; - INCLUDE anchor content='Clone and Edit' href='stage2?action=edit&id=' _ rpt.stage2 _ '&report=' _ rpt.id; - '   '; - IF user.id == rpt.owner; - INCLUDE anchor content='Run again' href=CGI.url('-path', 1) _ '?action=rerun&id=' _ rpt.id; - '   '; - IF rpt.disable; - INCLUDE anchor content='Enable' href=CGI.url('-path', 1) _ '?action=enable_stage3&id=' _ rpt.id; - ELSE; - INCLUDE anchor content='Disable' href=CGI.url('-path', 1) _ '?action=disable_stage3&id=' _ rpt.id; - END; - '   '; - INCLUDE anchor content='Delete' href=CGI.url('-path', 1) _ '?action=delete_stage3&id=' _ rpt.id; - '   '; - END; - END; - END; - END; - END; - - '

'; - - type_map = { 'csv' => 'csv', 'excel' => 'xls', 'html' => 'html' }; - - WRAPPER html/center; - 'Report Runs:'; - run_q = DBI.prepare("SELECT * FROM reporter.output WHERE stage3 = ? ORDER BY queue_time DESC"); - FOR run = run_q.execute(rpt.id); - ""; - WRAPPER html/table style="border-collapse:collapse"; - WRAPPER html/row; - INCLUDE html/cell content="Current State" style="border:solid gray 1px;" width="20%"; - WRAPPER html/cell style="border:solid gray 1px;"; - run.state; - IF run.state == 'complete'; - '
'; - FOR f = params.output_format.list; - h = tmpl.stage1 _ '/' _ tmpl.id _ - '/' _ rpt.id _ '/' _ run.id _ - '/report-data.' _ type_map.$f; - link(content=f, href=h); - IF !loop.last; - ' | '; - END; - END; - END; - END; - END; - WRAPPER html/row; - INCLUDE html/cell content="Queue Time" style="border:solid gray 1px;"; - INCLUDE html/cell content=run.queue_time style="border:solid gray 1px;"; - END; - IF run.run_time; - WRAPPER html/row; - INCLUDE html/cell content="Run Time" style="border:solid gray 1px;"; - INCLUDE html/cell content=run.run_time style="border:solid gray 1px;"; - END; - END; - IF run.complete_time; - WRAPPER html/row; - INCLUDE html/cell content="Complete Time" style="border:solid gray 1px;"; - INCLUDE html/cell content=run.complete_time style="border:solid gray 1px;"; - END; - END; - IF run.query; - WRAPPER html/row; - INCLUDE html/cell content="Query" style="border:solid gray 1px;"; - INCLUDE html/cell content=run.query style="border:solid gray 1px;"; - END; - END; - IF run.error; - WRAPPER html/row; - INCLUDE html/cell content="Error" style="border:solid gray 1px;"; - INCLUDE html/cell content=run.error style="border:solid gray 1px;"; - END; - END; - IF run.error_time; - WRAPPER html/row; - INCLUDE html/cell content="Error Time" style="border:solid gray 1px;"; - INCLUDE html/cell content=run.error_time style="border:solid gray 1px;"; - END; - END; - IF run.complete_time || run.error_time; - WRAPPER html/row; - INCLUDE html/cell content="Actions" style="border:solid gray 1px;"; - WRAPPER html/cell style="border:solid gray 1px;"; - IF user.id == rpt.owner; - INCLUDE anchor content='Delete' href=CGI.url('-path', 1) _ '?action=delete_output&output=' _ run.id; - '   '; - END; - END; - END; - END; - END; - '


'; - END; - END; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/utils b/Open-ILS/src/reporter/templates/utils deleted file mode 100644 index f983766912..0000000000 --- a/Open-ILS/src/reporter/templates/utils +++ /dev/null @@ -1,18 +0,0 @@ -[% - -BLOCK find_table_id; - xpath = '//*[@id="' _ id _ '"]'; - node = config.findnodes(xpath); - IF node; - t = node.findvalue('@table'); - IF t; - xpath = '//*[@id="' _ t _ '"]'; - node = config.findnodes(xpath); - END; - node.findvalue('@id'); - ELSE; - logme(['arrrrrgggg!!!',id]); - END; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widget_manip b/Open-ILS/src/reporter/templates/widget_manip deleted file mode 100644 index 62af29719f..0000000000 --- a/Open-ILS/src/reporter/templates/widget_manip +++ /dev/null @@ -1,116 +0,0 @@ -[% - -PROCESS inputs; -PROCESS utils; - -BLOCK widget_selector; - - logme("widget_selector called for table $tableid"); - - linkid = tableid; - tableid = INCLUDE find_table_id id=tableid; - - choose_base_cols = 0; - - # if we got some columns, use them. if not, get all non-primary columns - IF ! columns; - columns = []; - choose_base_cols = 1; - columns_xpath = - '/reporter/tables/table[@id="' _ tableid _ - '"]/fields/field[(not(@primary) or @primary!="true") or @filterable="true"]'; - FOR c = config.findnodes(columns_xpath); - link_text_xpath = '../../links/link[@field="' _ c.findvalue('@name') _ '" and (not(@hidden) or @hidden!="false")]'; - NEXT IF c.findnodes(link_text_xpath); - columns.push(c); - END; - logme("widget_selector had to grab columns for table $tableid linked from $linkid"); - END; - - column_input_type="checkbox"; - IF force && ! choose_base_cols; - column_input_type="hidden"; - END; - - FOR column = columns; - column_name=column.findvalue('@name'); - - WRAPPER html/row; - WRAPPER html/cell valign='top' align='right'; - # checkbox for column filter here ... - INCLUDE $column_input_type - name="filter:$linkid" - value=column_name - checked=0; - column.findvalue('label'); - END; - WRAPPER html/cell; - - col_widget_fams_xpath = - '/reporter/widgets/widget-family[@datatype="' _ - column.findvalue('@datatype') _ '"]'; - - IF column.findnodes('@widget-family'); - col_widget_fams_xpath = - '/reporter/widgets/widget-family[@name="' _ - column.findvalue('@widget-family') _ '"]'; - END; - - logme("finding widget families using $col_widget_fams_xpath"); - - widget_fams = config.findnodes(col_widget_fams_xpath); - - '
    '; - FOR fam = widget_fams; - - fam_input = 'radio'; - IF loop.size == 1; - fam_input = 'hidden'; - END; - - checked = 0; - IF loop.count == 1; - checked = 1; - END; - - fam_name = fam.findvalue('@name'); - # radio for widget family here ... - '
  • '; - INCLUDE $fam_input - name="filter:$linkid:$column_name" - value= fam_name; - fam.findvalue('label'); - '
      '; - - FOR widget = fam.findnodes('widget'); - - fam_input = 'radio'; - IF loop.size == 1; - fam_input = 'hidden'; - END; - - checked = 0; - IF loop.count == 1; - checked = 1; - END; - - widget_name = widget.findvalue('@name'); - # radio for widget here ... - '
    • '; - INCLUDE $fam_input - name="filter:$linkid:$column_name:$fam_name" - value= widget_name; - widget.findvalue('label'); - '
    • '; - END; - '
    '; - '
  • '; - END; - '
'; - END; - END; - END; -END; - -%] - diff --git a/Open-ILS/src/reporter/templates/widgets/comparative-timerange.month b/Open-ILS/src/reporter/templates/widgets/comparative-timerange.month deleted file mode 100644 index c1025c6c41..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/comparative-timerange.month +++ /dev/null @@ -1,38 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -WRAPPER select name=input_prefix _ ":target"; - count = 1; - def = 1; - IF current_value.target; - def = current_value.target; - END; - WHILE count < 37; - INCLUDE option value=count selected=(count == def ? 1 : 0); - count = count + 1; - END; -END; - -' months before runtime
Compared to '; - -WRAPPER select name=input_prefix _ ":compare"; - count = 1; - def = 12; - IF current_value.compare; - def = current_value.compare; - END; - WHILE count < 37; - INCLUDE option value=count selected=(count == def ? 1 : 0); - count = count + 1; - END; -END; -' months before target'; -END; - -BLOCK display; -current_value.compare _' months before runtime compared to ' _ current_value.compare _ ' months before target'; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/lib-choose.dropdown b/Open-ILS/src/reporter/templates/widgets/lib-choose.dropdown deleted file mode 100644 index 29e4ff1d62..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/lib-choose.dropdown +++ /dev/null @@ -1,82 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -root = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' WHERE parent_ou IS NULL ORDER BY name;'; -q = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' WHERE parent_ou = ? ORDER BY name;'; - -org_unit_type = DBI.tie('actor.org_unit_type', 'id') - -%] - - - -[% - -WRAPPER select id=input_prefix name=input_prefix onchange='change_hier_' _ table_alias _ '(this);'; - depth = 0; - INCLUDE option value='' content='Select One'; - INCLUDE option value='' content='----------'; - FOR f = DBI.query(root); - INCLUDE option value=f.id content=f.name; - INCLUDE next_level parent_ou = f.id depth; - END; -END; -END; - - -BLOCK next_level; - depth = depth + 1; - x = depth; - s = DBI.prepare(q); - FOR f = s.execute(parent_ou); - ou_t = f.ou_type; - - logme(["can_have_vols for ou_t", ,org_unit_type.$ou_t.can_have_vols]); - - IF org_unit_type.$ou_t.can_have_vols == 1; - %] - - [% - END; - - x = depth; - val = ''; - WHILE x > 0; - val = val _ '  '; - x = x - 1; - END; - - selected = ''; - IF current_value == f.id; - selected = 'selected'; - END; - - INCLUDE option value=f.id content=f.name content=val _ f.name id='dr_' _ f.id; - INCLUDE next_level parent_ou = f.id; - END; -END; - -BLOCK display; -org_units = DBI.tie('actor.org_unit', 'id') -ou = org_units.$current_value; -ou.name; -END; -%] diff --git a/Open-ILS/src/reporter/templates/widgets/lib-choose.multiselect b/Open-ILS/src/reporter/templates/widgets/lib-choose.multiselect deleted file mode 100644 index af69d5d7ec..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/lib-choose.multiselect +++ /dev/null @@ -1,93 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -root = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' WHERE parent_ou IS NULL ORDER BY name;'; -q = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' WHERE parent_ou = ? ORDER BY name;'; - -org_unit_type = DBI.tie('actor.org_unit_type', 'id') - -%] - - - -[% - -WRAPPER select name=input_prefix multi="multi" onchange='change_multihier_' _ table_alias _ '(this);'; - depth = 0; - FOR f = DBI.query(root); - sel = 0; - FOR v = current_value; - sel = 1 IF v == f.id; - LAST; - END; - INCLUDE option value=f.id content=f.name selected=sel; - INCLUDE next_level parent_ou = f.id; - END; -END; -END; - -BLOCK next_level; - depth = depth + 1; - x = depth; - s = DBI.prepare(q); - FOR f = s.execute(parent_ou); - ou_t = f.ou_type; - - logme(["can_have_vols for ou_t", ,org_unit_type.$ou_t.can_have_vols]); - - IF org_unit_type.$ou_t.can_have_vols == 1; - %] - - [% - END; - - x = depth; - val = ''; - WHILE x > 0; - val = val _ '  '; - x = x - 1; - END; - - selected = ''; - FOR v = current_value; - IF v == f.id; - selected = 'selected'; - LAST; - END; - END; - INCLUDE option value=f.id content=val _ f.name id='mh_' _ f.id; - INCLUDE next_level parent_ou = f.id; - END; -END; - -BLOCK display; - org_units = DBI.tie('actor.org_unit', 'id'); - list = []; - FOR o = current_value; - list.push(org_units.$o.name); - END; - list.join('
'); -END; -%] diff --git a/Open-ILS/src/reporter/templates/widgets/relative-timerange.day b/Open-ILS/src/reporter/templates/widgets/relative-timerange.day deleted file mode 100644 index cc3db6a541..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/relative-timerange.day +++ /dev/null @@ -1,23 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -WRAPPER select name=input_prefix; - count = 1; - def = 1; - IF current_value; - def = current_value; - END; - WHILE count < 366; - INCLUDE option value=count selected=(count == def ? 1 : 0); - count = count + 1; - END; -END; -' days before runtime'; -END; - -BLOCK display; -current_value _ ' days before runtime'; -END -%] diff --git a/Open-ILS/src/reporter/templates/widgets/relative-timerange.month b/Open-ILS/src/reporter/templates/widgets/relative-timerange.month deleted file mode 100644 index f583a85709..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/relative-timerange.month +++ /dev/null @@ -1,24 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; - -WRAPPER select name=input_prefix; - count = 1; - IF current_value; - def = current_value; - END; - WHILE count < 37; - INCLUDE option value=count selected=(count == def ? 1 : 0); - count = count + 1; - END; -END; -' months before runtime'; -END; - -BLOCK display; -current_value _ ' months before runtime'; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/relative-timerange.quarter b/Open-ILS/src/reporter/templates/widgets/relative-timerange.quarter deleted file mode 100644 index 850bac673a..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/relative-timerange.quarter +++ /dev/null @@ -1,19 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -WRAPPER select name=input_prefix; - count = 1; - WHILE count < 37; - INCLUDE option value=count; - count = count + 1; - END; -END; -' (calendar) quarters before runtime'; -END; - -BLOCK display; -current_value _ ' (calendar) quarters before runtime'; -END; -%] diff --git a/Open-ILS/src/reporter/templates/widgets/relative-timerange.week b/Open-ILS/src/reporter/templates/widgets/relative-timerange.week deleted file mode 100644 index cbe2ac9799..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/relative-timerange.week +++ /dev/null @@ -1,22 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -WRAPPER select name=input_prefix; - count = 1; - IF current_value; - def = current_value; - END; - WHILE count < 53; - INCLUDE option value=count selected=(count == def ? 1 : 0); - count = count + 1; - END; -END; -' weeks before runtime'; -END; - -BLOCK display; -current_value _ ' weeks before runtime'; -END; -%] diff --git a/Open-ILS/src/reporter/templates/widgets/relative-timerange.year b/Open-ILS/src/reporter/templates/widgets/relative-timerange.year deleted file mode 100644 index 0387aded9b..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/relative-timerange.year +++ /dev/null @@ -1,22 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -WRAPPER select name=input_prefix; - count = 1; - IF current_value; - def = current_value; - END; - WHILE count < 37; - INCLUDE option value=count selected=(count == def ? 1 : 0); - count = count + 1; - END; -END; -' years before runtime'; -END; - -BLOCK display; -current_value _ ' years before runtime'; -END; -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.any b/Open-ILS/src/reporter/templates/widgets/specific-timerange.any deleted file mode 100644 index b6767c1b88..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.any +++ /dev/null @@ -1,85 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); -USE end = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; -WRAPPER html/table ; - WRAPPER html/row; - INCLUDE html/cell colspan=6 align='center' content='Start time'; - END; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Month'; - INCLUDE html/cell content='Day'; - INCLUDE html/cell content='Hour'; - INCLUDE html/cell content='Minute'; - INCLUDE html/cell content='Second'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-year' size=4 value=start.year; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-month' size=4 value=start.month; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-day' size=4 value=start.day; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-hour' size=4 value=start.hour; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-minute' size=4 value=start.minute; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-second' size=4 value=start.second; - END; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=6 align='center' content='End time'; - END; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Month'; - INCLUDE html/cell content='Day'; - INCLUDE html/cell content='Hour'; - INCLUDE html/cell content='Minute'; - INCLUDE html/cell content='Second'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-year' size=4 value=end.year; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-month' size=4 value=end.month; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-day' size=4 value=end.day; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-hour' size=4 value=end.hour; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-minute' size=4 value=end.minute; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-second' size=4 value=end.second; - END; - END; -END; - -END; - -BLOCK display; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.day b/Open-ILS/src/reporter/templates/widgets/specific-timerange.day deleted file mode 100644 index d856271f13..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.day +++ /dev/null @@ -1,39 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; -WRAPPER html/table ; - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Month'; - INCLUDE html/cell content='Day'; - END; - - y = (current_value.year ? current_value.year : start.year); - m = (current_value.month ? current_value.month : start.month); - d = (current_value.day ? current_value.day : start.day); - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':year' size=4 value=y; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':month' size=4 value=m; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':day' size=4 value=d; - END; - END; - -END; -END; - -BLOCK display; -current_value.year _ '-' _ current_value.month _ '-' _ current_value.day; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.month b/Open-ILS/src/reporter/templates/widgets/specific-timerange.month deleted file mode 100644 index 0b2d6cc794..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.month +++ /dev/null @@ -1,46 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); -USE end = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; - -WRAPPER html/table ; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Month'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - v = start.year; - f = 'start-year'; - IF current_value.$f; - v = current_value.$f; - END; - INCLUDE text name=input_prefix _ ':start-year' size=4 value=v; - END; - WRAPPER html/cell; - v = start.month; - f = 'start-month'; - IF current_value.$f; - v = current_value.$f; - END; - INCLUDE text name=input_prefix _ ':start-month' size=4 value=v; - END; - END; - -END; -END; - -BLOCK display; -f = 'start-year'; -current_value.$f _ '-'; -f = 'start-month'; -current_value.$f; -END; -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multimonth b/Open-ILS/src/reporter/templates/widgets/specific-timerange.multimonth deleted file mode 100644 index a3a77538fc..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multimonth +++ /dev/null @@ -1,75 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); -USE end = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; - -WRAPPER html/table ; - WRAPPER html/row; - INCLUDE html/cell colspan=2 align='center' content='Start time'; - END; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Month'; - END; - - syl = 'start-year'; - sml = 'start-month'; - eyl = 'end-year'; - eml = 'end-month'; - - sy = (current_value.$syl ? current_value.$syl : start.year); - sm = (current_value.$sml ? current_value.$sml : start.month); - ey = (current_value.$eyl ? current_value.$eyl : end.year); - em = (current_value.$eml ? current_value.$eml : end.month); - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-year' size=4 value=sy; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':start-month' size=4 value=sm; - END; - END; - - WRAPPER html/row; - INCLUDE html/cell colspan=2 align='center' content='End time'; - END; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Month'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-year' size=4 value=ey; - END; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':end-month' size=4 value=em; - END; - END; -END; -END; - -BLOCK display; - syl = 'start-year'; - sml = 'start-month'; - eyl = 'end-year'; - eml = 'end-month'; - - sy = (current_value.$syl ? current_value.$syl : start.year); - sm = (current_value.$sml ? current_value.$sml : start.month); - ey = (current_value.$eyl ? current_value.$eyl : end.year); - em = (current_value.$eml ? current_value.$eml : end.month); - - sy _ '-' _ sm _ ' through ' _ ey _ '-' _ em; - -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiquarter b/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiquarter deleted file mode 100644 index f229fb2ef0..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiquarter +++ /dev/null @@ -1,43 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; - -WRAPPER html/table ; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Quarter'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':year' size=4 value=start.year; - END; - WRAPPER html/cell; - WRAPPER select name=input_prefix _ ':quarter'; - FOR i IN [1,2,3,4]; - INCLUDE option value=i; - END; - END; - END; - WRAPPER html/cell; - 'For '; - INCLUDE text name=input_prefix _ ':quarter-count' value=2; - ' quarters'; - END; - END; - -END; - -END; - -BLOCK display; -'Year: ' _ current_value.year _ ', Quarter: ' _ current_value.quarter; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiweek b/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiweek deleted file mode 100644 index 4785422892..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiweek +++ /dev/null @@ -1,59 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; - -WRAPPER html/table; - - WRAPPER html/row; - WRAPPER html/cell; - 'Year: '; - INCLUDE name=input_prefix _ ':year' text size=4 value=(current_value.year ? current_value.year : start.year); - END; - END; - - WRAPPER html/row; - WRAPPER html/cell; - 'Start week of year: '; - WRAPPER select name=input_prefix _ ':start'; - count = 1; - WHILE count < 53; - selected = 0; - IF count == current_value.start; - selected = 1; - END; - INCLUDE option value=count; - count = count + 1; - END; - END; - END; - END; - - WRAPPER html/row; - WRAPPER html/cell; - 'End week of year: '; - WRAPPER select name=input_prefix _ ':end'; - count = 1; - WHILE count < 53; - selected = 0; - IF count == current_value.end; - selected = 1; - END; - INCLUDE option value=count; - count = count + 1; - END; - END; - END; - END; -END; -END; - -BLOCK display; -current_value.year _ ', weeks ' _ current_value.start _ ' through ' _ current_value.end; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiyear b/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiyear deleted file mode 100644 index 017a46ed3b..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.multiyear +++ /dev/null @@ -1,35 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; -WRAPPER html/table ; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':year' size=4 value=(current_value.year ? current_value.year : start.year); - END; - WRAPPER html/cell; - 'For '; - ycl = 'year-count'; - INCLUDE text name=input_prefix _ ':year-count' value=(current_value.$ycl ? current_value.$ycl : 2); - ' years'; - END; - END; - -END; -END; - -BLOCK display; -ycl = 'year-count'; -current_value.year _ ' through ' _ current_value.year + current_value.$ycl; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.quarter b/Open-ILS/src/reporter/templates/widgets/specific-timerange.quarter deleted file mode 100644 index 4f5afd1b36..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.quarter +++ /dev/null @@ -1,36 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; -WRAPPER html/table ; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - INCLUDE html/cell content='Quarter'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix _ ':year' size=4 value=start.year; - END; - WRAPPER html/cell; - WRAPPER select name=input_prefix _ ':quarter'; - FOR i IN [1,2,3,4]; - INCLUDE option value=i; - END; - END; - END; - END; - -END; -END; - -BLOCK display; -'Year: ' _ current_value.year _ ', Quarter: ' _ current_value.quarter; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.week b/Open-ILS/src/reporter/templates/widgets/specific-timerange.week deleted file mode 100644 index 3b24f37fa0..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.week +++ /dev/null @@ -1,32 +0,0 @@ -[% - -PROCESS inputs; - -USE date; -USE start = DateTime(now = 1); - -BLOCK editor; - -'Year: '; -INCLUDE name=input_prefix _ ':year' text size=4 value=start.year; - - -'
Week of year: '; -WRAPPER select name=input_prefix _ ':week'; - count = 1; - WHILE count < 54; - selected = 0; - IF count == current_value.week; - selected = 1; - END; - INCLUDE option value=count; - count = count + 1; - END; -END; -END; - -BLOCK display; -'Year: ' _ current_value.year _ ', Week: ' _ current_value.week; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/specific-timerange.year b/Open-ILS/src/reporter/templates/widgets/specific-timerange.year deleted file mode 100644 index 706ed8ac7e..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/specific-timerange.year +++ /dev/null @@ -1,29 +0,0 @@ -[% - -USE date; -USE start = DateTime(now = 1); - -PROCESS inputs; - -BLOCK editor; - -WRAPPER html/table ; - - WRAPPER html/row; - INCLUDE html/cell content='Year'; - END; - - WRAPPER html/row; - WRAPPER html/cell; - INCLUDE text name=input_prefix size=4 value=(current_value ? current_value : start.year); - END; - END; - -END; -END; - -BLOCK display; -current_value; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/string-choose.dropdown b/Open-ILS/src/reporter/templates/widgets/string-choose.dropdown deleted file mode 100644 index 01856f94ee..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/string-choose.dropdown +++ /dev/null @@ -1,27 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -q = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' ORDER BY ' _ fieldname _ ';'; - -''; - -WRAPPER select name=input_prefix; - INCLUDE option value='' content='Select One'; - INCLUDE option value='' content='----------'; - FOR f = DBI.query(q); - selected == 0; - IF f.$fieldname == current_value; - selected = 1; - END; - INCLUDE option value=f.$fieldname; - END; -END; -END; - -BLOCK display; -current_value; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/string-choose.multiselect b/Open-ILS/src/reporter/templates/widgets/string-choose.multiselect deleted file mode 100644 index edd6fc0188..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/string-choose.multiselect +++ /dev/null @@ -1,28 +0,0 @@ -[% - -PROCESS inputs; - -BLOCK editor; -q = 'SELECT DISTINCT ' _ fieldname _ ' FROM ' _ table.findvalue('tablename') _ ' ORDER BY ' _ fieldname _ ';'; - -''; - -WRAPPER select name=input_prefix multi=1 size=10; - FOR f = DBI.query(q); - selected = 0; - FOR v = current_value; - IF v == f.$fieldname; - selected = 1; - LAST; - END; - END; - INCLUDE option value=f.$fieldname; - END; -END; -END; - -BLOCK display; -current_value; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/string-input.exact b/Open-ILS/src/reporter/templates/widgets/string-input.exact deleted file mode 100644 index 36d357c0d4..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/string-input.exact +++ /dev/null @@ -1,11 +0,0 @@ -[% -PROCESS inputs; -BLOCK editor; -INCLUDE text name=input_prefix size=20 value=current_value; -END; - -BLOCK display; -current_value; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/string-input.initial-substring b/Open-ILS/src/reporter/templates/widgets/string-input.initial-substring deleted file mode 100644 index a3dfb6096a..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/string-input.initial-substring +++ /dev/null @@ -1,12 +0,0 @@ -[% -PROCESS inputs; - -BLOCK editor; -INCLUDE text name=input_prefix size=20 value=current_value; -END; - -BLOCK display; -current_value; -END; - -%] diff --git a/Open-ILS/src/reporter/templates/widgets/string-input.multistring b/Open-ILS/src/reporter/templates/widgets/string-input.multistring deleted file mode 100644 index 48ef829d2b..0000000000 --- a/Open-ILS/src/reporter/templates/widgets/string-input.multistring +++ /dev/null @@ -1,12 +0,0 @@ -[% -PROCESS inputs; - -BLOCK editor; -INCLUDE textarea name=input_prefix value=current_value; -END; - -BLOCK display; -current_value; -END; - -%] diff --git a/Open-ILS/src/reporter/widgets.example.xml b/Open-ILS/src/reporter/widgets.example.xml deleted file mode 100644 index 92f4ed038b..0000000000 --- a/Open-ILS/src/reporter/widgets.example.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - This widget filters a column based on an exact string - match. - - - - - - - This widget filters a column based on an set of strings. - - - - - - - This widget filters a column based on an initial substring - match. - - - - - - - - - - - - - This widget filters a column based on an exact string match. - - - - - - - This widget filters a column based on multiple strings. - - - - - - - - - - - - This widget allows the user to pick an arbitrary time range - on which to report. - - - $full_col = "CAST(DATE_TRUNC('month', $full_col) AS DATE)"; - $where_clause = - "$full_col IN ( CAST(DATE_TRUNC('month', NOW() - CAST( ? || ' month' AS INTERVAL )) AS DATE), ". - " CAST(DATE_TRUNC('month', NOW() - CAST( ? || ' month' AS INTERVAL )) AS DATE))"; - push @$bind_list, $$val{target}, $$val{target} + $$val{compare}; - - - - - - - - - - - - - - This widget allows the user to pick a specific date on which - to report. - - - $full_col = "DATE_TRUNC('day', $full_col)"; - $where_clause = "$full_col = CAST(? AS DATE)"; - push @$bind_list, sprintf('%d/%02d/%02d', @$val{qw/year month day/}); - - - - - - - This widget allows the user to pick a specific week of the year - on which to report. - - - $where_clause = - "( EXTRACT('year' FROM $full_col) = ? ". - " AND EXTRACT('week' FROM $full_col) = ? )"; - push @$bind_list, $$val{year}, $$val{week}; - - - - - - - This widget allows the user to pick a range of weeks of the year - on which to report. - - - $where_clause = - "( EXTRACT('year' FROM $full_col) = ? ". - " AND EXTRACT('week' FROM $full_col) ". - "BETWEEN ? AND ? )"; - push @$bind_list, $$val{year}, $$val{start}, $$val{end}; - - - - - - - This widget allows the user to pick a specific year and month - on which to report. - - - $where_clause = - "( EXTRACT('year' FROM $full_col) = ? ". - " AND EXTRACT('month' FROM $full_col) = ? )"; - push @$bind_list, $$val{'start-year'}, $$val{'start-month'}; - - - - - - - This widget allows the user to pick a range of month on which to - report. - - - $where_clause = - "DATE_TRUNC('month', $full_col) ". - "BETWEEN CAST(? AS DATE) AND CAST(? AS DATE)"; - push @$bind_list, - sprintf('%d/%02d/01', @$val{qw/start-year start-month/}), - sprintf('%d/%02d/01', @$val{qw/end-year end-month/}); - - - - - - - - - This widget allows the user to pick a specific year on which to - report. - - - $where_clause = "EXTRACT('year' FROM $full_col) = ?"; - push @$bind_list, $val; - - - - - - - This widget allows the user to pick a range of years on which to - report. - - - $where_clause = "EXTRACT('year' FROM $full_col) BETWEEN ? AND ?"; - push @$bind_list, $$val{year}, $$val{year} + $$val{year-count}; - - - - - - - - - - - - This widget allows the user to pick a date relative to the - report runtime on which to report. - - - $where_clause = - "CAST($full_col AS DATE) = ". - "CAST((NOW() - CAST(? || ' day' AS INTERVAL)) AS DATE)"; - push @$bind_list, $val; - - - - - - - This widget allows the user to pick a week (sun-sat) relative - to the report runtime on which to report. - - - $where_clause = - "( CAST(DATE_TRUNC('week', $full_col) AS DATE) = ". - " CAST(DATE_TRUNC('week', NOW() - CAST(? || ' weeks' AS INTERVAL) ) AS DATE) "; - push @$bind_list, $val; - - - - - - - This widget allows the user to pick a month relative to the - report runtime on which to report. - - - $where_clause = - "CAST(DATE_TRUNC('month', $full_col) AS DATE) = ". - "CAST(DATE_TRUNC('month', NOW()) - CAST(? || ' months' AS INTERVAL) AS DATE)"; - push @$bind_list, $val; - - - - - - - - - This widget allows the user to pick a year relative to the - report runtime on which to report. - - - $where_clause = - "CAST(DATE_TRUNC('year', $full_col) AS DATE)= ". - "CAST(DATE_TRUNC('year', NOW()) - CAST(? || ' years' AS INTERVAL) AS DATE)"; - push @$bind_list, $val; - - - - - - - - - - - - This widget filters on an exact Library Name match. - - - - - - - This widget filters based on multiple Library names. - - - - - -- 2.11.0