From 8b3fadf83adecc4441f33f38420c0a3668e85770 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 28 Sep 2005 19:30:17 +0000 Subject: [PATCH] progressing to stage 2 now focus username on login.ttk git-svn-id: svn://svn.open-ils.org/ILS/trunk@1879 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/reporter/templates/login.ttk | 10 +- Open-ILS/src/reporter/templates/stage1.ttk | 101 +++++++------- Open-ILS/src/reporter/templates/stage2.ttk | 152 +++++++++++++++++++++ 3 files changed, 211 insertions(+), 52 deletions(-) create mode 100644 Open-ILS/src/reporter/templates/stage2.ttk diff --git a/Open-ILS/src/reporter/templates/login.ttk b/Open-ILS/src/reporter/templates/login.ttk index 5ccef68d6f..f03b526803 100644 --- a/Open-ILS/src/reporter/templates/login.ttk +++ b/Open-ILS/src/reporter/templates/login.ttk @@ -10,6 +10,7 @@ var cookie = new cookieObject("ses", 1, "/", COOKIE_SES); function initPage() { + document.getElementById("reports_login_username").focus(); document.getElementById("reports_login_username").onkeypress = checkInputClicks; document.getElementById("reports_login_password").onkeypress = checkInputClicks; } @@ -56,7 +57,8 @@ -

+
+

Reports Login

@@ -71,11 +73,7 @@
- -

- Org Test -

- [% INCLUDE orgtree.ttk %] +
diff --git a/Open-ILS/src/reporter/templates/stage1.ttk b/Open-ILS/src/reporter/templates/stage1.ttk index f6d17633d8..9399911f10 100644 --- a/Open-ILS/src/reporter/templates/stage1.ttk +++ b/Open-ILS/src/reporter/templates/stage1.ttk @@ -1,35 +1,14 @@ [% -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); - -dbname = config.findvalue('/reporter/setup/database/name'); -dbhost = config.findvalue('/reporter/setup/database/host'); -d_u = config.findvalue('/reporter/setup/database/user'); -d_p = config.findvalue('/reporter/setup/database/password'); - -dsn = "dbi:Pg:dbname=" _ dbname _';host=' _ dbhost; - -logme([dsn,d_u,d_p]); - -DBI.connect(dsn,d_u,d_p); - +PROCESS inputs; +PROCESS logic_header.ttk; WRAPPER html/html; INCLUDE header.ttk title="Basic Report Types"; - WRAPPER html/body; + WRAPPER html/body html.body.onload= + "if (document.getElementById('templatename')) {" _ + "document.getElementById('templatename').focus();" _ + "document.getElementById('templatename').select();}"; INCLUDE logout.ttk; IF !CGI.param('id'); IF CGI.param('detail'); @@ -126,6 +105,22 @@ BLOCK stage1_summary links=0; %]|New Report Template[% END; END; + WRAPPER html/row; + WRAPPER html/cell align="right" valign='top'; + %]Report Templates:[% + END; + WRAPPER html/cell; + q = 'select * from reporter.stage2 ' _ + 'where pub is true or owner = ' _ DBI.quote(user.id()); + FOR r IN DBI.query(q); + INCLUDE anchor + href="stage2?id=" _ r.id + text=utils.JSON2perl(r.params).templatename; + '
'; + END; + END; + END; + PROCESS stage1_detail IF CGI.param('detail') == 1; END; END; @@ -137,12 +132,21 @@ BLOCK stage2_new; col_xpath = "/reporter/tables/table[@id='" _ fact_table _ "']/fields/field[@core='true']"; logme(col_xpath); + %]
+ + +
+ + Public template

[% + + WRAPPER html/table width="100%" border=1; WRAPPER html/row; WRAPPER html/cell colspan=2; # hidden input here ... table = config.findnodes("/reporter/tables/table[@id='$fact_table']"); - INCLUDE hidden name="filtertable" value=fact_table; + INCLUDE hidden name="filter" value=fact_table; table.findvalue('label'); ' Core Columns'; END; @@ -159,7 +163,7 @@ BLOCK stage2_new; WRAPPER html/row; WRAPPER html/cell colspan=2; # checkbox input here ... - INCLUDE checkbox name="filtertable" value=dim_table checked=1; + INCLUDE checkbox name="filter" value=dim_table checked=1; dimension.findvalue('label'); ' Dimension'; END; @@ -168,6 +172,10 @@ BLOCK stage2_new; END; END; + INCLUDE submit name='button' value='Save'; + + %]
[% + END; @@ -193,10 +201,10 @@ BLOCK widget_selector; column_name=column.findvalue('@name'); WRAPPER html/row; - WRAPPER html/cell valign='top'; + WRAPPER html/cell valign='top' align='right'; # checkbox for column filter here ... INCLUDE $column_input_type - name="filtercolumn:$tableid" + name="filter:$tableid" value=column_name checked=1; column.findvalue('label'); @@ -234,7 +242,7 @@ BLOCK widget_selector; # radio for widget family here ... '
  • '; INCLUDE $fam_input - name="filterfamily:$tableid:$column_name" + name="filter:$tableid:$column_name" value= fam_name; fam.findvalue('label'); '