big ol reporter cleanup for the meeting
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Feb 2006 22:03:00 +0000 (22:03 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Feb 2006 22:03:00 +0000 (22:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3013 dcc99617-32d9-48b4-a31d-7c20da2025e4

28 files changed:
Open-ILS/src/reporter/tables.example.xml
Open-ILS/src/reporter/templates/dashboard.ttk
Open-ILS/src/reporter/templates/header.ttk
Open-ILS/src/reporter/templates/stage2.ttk
Open-ILS/src/reporter/templates/stage3.ttk
Open-ILS/src/reporter/templates/widgets/comparative-timerange.month
Open-ILS/src/reporter/templates/widgets/lib-choose.dropdown
Open-ILS/src/reporter/templates/widgets/lib-choose.multiselect
Open-ILS/src/reporter/templates/widgets/relative-timerange.day
Open-ILS/src/reporter/templates/widgets/relative-timerange.month
Open-ILS/src/reporter/templates/widgets/relative-timerange.quarter
Open-ILS/src/reporter/templates/widgets/relative-timerange.week
Open-ILS/src/reporter/templates/widgets/relative-timerange.year
Open-ILS/src/reporter/templates/widgets/specific-timerange.any
Open-ILS/src/reporter/templates/widgets/specific-timerange.day
Open-ILS/src/reporter/templates/widgets/specific-timerange.month
Open-ILS/src/reporter/templates/widgets/specific-timerange.multimonth
Open-ILS/src/reporter/templates/widgets/specific-timerange.multiquarter
Open-ILS/src/reporter/templates/widgets/specific-timerange.multiweek
Open-ILS/src/reporter/templates/widgets/specific-timerange.multiyear
Open-ILS/src/reporter/templates/widgets/specific-timerange.quarter
Open-ILS/src/reporter/templates/widgets/specific-timerange.week
Open-ILS/src/reporter/templates/widgets/specific-timerange.year
Open-ILS/src/reporter/templates/widgets/string-choose.dropdown
Open-ILS/src/reporter/templates/widgets/string-choose.multiselect
Open-ILS/src/reporter/templates/widgets/string-input.exact
Open-ILS/src/reporter/templates/widgets/string-input.initial-substring
Open-ILS/src/reporter/templates/widgets/string-input.multistring

index 5043a5f..25c276d 100644 (file)
                          key="date"
                          type="has_a"/>
                        <link
-                         field="due_date_hour"
+                         field="finish_date_hour"
                          table="generic_hour_series"
-                         id="circ_due_date_hour"
+                         id="circ_finish_hour"
                          key="date_hour"
                          type="has_a"/>
                        <link
                          key="date"
                          type="has_a"/>
                        <link
-                         field="finish_date_hour"
+                         field="due_date_hour"
                          table="generic_hour_series"
-                         id="circ_finish_hour"
+                         id="circ_due_date_hour"
                          key="date_hour"
                          type="has_a"/>
                        <link
                          widget-family="lib-choose"
                          create-type="serial"
                          datatype="int">
-                               <label>Unique Library ID</label>
-                               <description>Unique Library ID</description>
+                               <label>Unique Library</label>
+                               <description>Globally Unique Library Identifier</description>
                        </field>
                        <field
                          name="name"
                          widget-family="string-choose"
                          datatype="text">
-                               <label>Name</label>
-                               <description>Library Name</description>
+                               <label>Library Name</label>
+                               <description>Friendly Library Name</description>
                        </field>
                        <field
                          name="shortname"
index 63f3c20..064ee22 100644 (file)
@@ -34,37 +34,37 @@ BLOCK summary;
        WRAPPER html/table border=0 width='100%';
                WRAPPER html/row;
                        INCLUDE html/cell
-                               colspan=2
+                               content=link(content='Active reports',href='dashboard?detail=mycompletereports')
                                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;
-                               '<br/><br/><br/>';
+                       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='Active reports',href='dashboard?detail=mycompletereports')
+                               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_completed_reports limit=5;
+                               INCLUDE my_scheduled_reports limit=5;
                        END;
                END;
                WRAPPER html/row;
                        INCLUDE html/cell
-                               content=link(content='Manage scheduled reports',href='dashboard?detail=myreports')
+                               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 valign='top' style='height:200px';
-                               INCLUDE my_scheduled_reports limit=5;
+                       WRAPPER html/cell colspan=2 valign='top';
+                               INCLUDE report_template_tree;
+                               '<br/><br/><br/>';
                        END;
                END;
        END;
@@ -85,7 +85,7 @@ END;
 
 BLOCK my_scheduled_reports;
        q = "SELECT * FROM reporter.stage3 WHERE owner = " _ user.id() _
-               " AND runtime > now() ORDER BY runtime DESC";
+               " AND runtime > now() ORDER BY runtime";
        IF limit > 0;
                q = q _ ' LIMIT ' _ limit;
        END;
@@ -97,11 +97,12 @@ BLOCK my_scheduled_reports;
 END;
 
 BLOCK show_complete_reports;
-       WRAPPER html/table width='100%';
+       WRAPPER html/table width='100%' class='sortable' id='show_complete_reports';
                WRAPPER html/row;
-                       INCLUDE html/cell content='Run status' 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='Run time' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
+                       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;
@@ -133,7 +134,7 @@ BLOCK show_complete_reports;
                        END;
                        
                        name_link = link(content=p.reportname,href="stage3?id=$rid#$output.id");
-                       name_link = t.templatename _ ' :: ' _ name_link;
+                       #name_link = t.templatename _ ' :: ' _ name_link;
                        
                        WRAPPER html/row;
                                INCLUDE html/cell
@@ -143,12 +144,16 @@ BLOCK show_complete_reports;
                                        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(19).0
+                                       content=runtime.chunk(16).0
                                        col=bg
                                        style='border:solid gray 1px;';
                        END;
@@ -158,13 +163,14 @@ END;
 
 
 BLOCK show_reports;
-       WRAPPER html/table width='100%';
+       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='Report name' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
-                       INCLUDE html/cell content='Create date and time' 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;';
-                       INCLUDE html/cell content='Number of runs' 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;
@@ -190,23 +196,24 @@ BLOCK show_reports;
                                t = utils.JSON2perl( template.params );
 
 
-                               rtime = report.runtime.chunk(19).0;
+                               rtime = report.runtime.chunk(16).0;
                                IF report.disable;
                                        rtime = rtime _ '<br/>(Disabled)';
                                END;
 
                                name_link = link(content=p.reportname,href="stage3?id=$rid");
-                               name_link = t.templatename _ ' :: ' _ name_link;
+                               #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(19).0 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='border:solid gray 1px;';
-                               INCLUDE html/cell content=run_count.get.count col=bg style='border:solid gray 1px;';
+                                       style='text-align: center; border:solid gray 1px;';
                        END;
                END;
        END;
index 3361d24..53c9db3 100644 (file)
                .navbar { border-bottom: 1px solid gray; padding-right: 20px; padding-left: 5px; }
        </style>
 
+       <script language="javascript">
+
+addEvent(window, "load", sortables_init);
+
+var SORT_COLUMN_INDEX;
+
+function sortables_init() {
+    // Find all tables with class sortable and make them sortable
+    if (!document.getElementsByTagName) return;
+    tbls = document.getElementsByTagName("table");
+    for (ti=0;ti<tbls.length;ti++) {
+        thisTbl = tbls[ti];
+        if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {
+            //initTable(thisTbl.id);
+            ts_makeSortable(thisTbl);
+        }
+    }
+}
+
+function ts_makeSortable(table) {
+    if (table.rows && table.rows.length > 0) {
+        var firstRow = table.rows[0];
+    }
+    if (!firstRow) return;
+    
+    // We have a first row: assume it's the header, and make its contents clickable links
+    for (var i=0;i<firstRow.cells.length;i++) {
+        var cell = firstRow.cells[i];
+        var txt = ts_getInnerText(cell);
+        cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'+txt+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a>';
+    }
+}
+
+function ts_getInnerText(el) {
+       if (typeof el == "string") return el;
+       if (typeof el == "undefined") { return el };
+       if (el.innerText) return el.innerText;  //Not needed but it is faster
+       var str = "";
+       
+       var cs = el.childNodes;
+       var l = cs.length;
+       for (var i = 0; i < l; i++) {
+               switch (cs[i].nodeType) {
+                       case 1: //ELEMENT_NODE
+                               str += ts_getInnerText(cs[i]);
+                               break;
+                       case 3: //TEXT_NODE
+                               str += cs[i].nodeValue;
+                               break;
+               }
+       }
+       return str;
+}
+
+function ts_resortTable(lnk) {
+    // get the span
+    var span;
+    for (var ci=0;ci<lnk.childNodes.length;ci++) {
+        if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];
+    }
+    var spantext = ts_getInnerText(span);
+    var td = lnk.parentNode;
+    var column = td.cellIndex;
+    var table = getParent(td,'TABLE');
+    
+    // Work out a type for the column
+    if (table.rows.length <= 1) return;
+    var itm = ts_getInnerText(table.rows[1].cells[column]);
+    sortfn = ts_sort_caseinsensitive;
+    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/)) sortfn = ts_sort_date;
+    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/)) sortfn = ts_sort_date;
+    if (itm.match(/^[£$]/)) sortfn = ts_sort_currency;
+    if (itm.match(/^[\d\.]+$/)) sortfn = ts_sort_numeric;
+    SORT_COLUMN_INDEX = column;
+    var firstRow = new Array();
+    var newRows = new Array();
+    for (i=0;i<table.rows[0].length;i++) { firstRow[i] = table.rows[0][i]; }
+    for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }
+
+    newRows.sort(sortfn);
+
+    if (span.getAttribute("sortdir") == 'down') {
+        ARROW = '&nbsp;&nbsp;&uarr;';
+        newRows.reverse();
+        span.setAttribute('sortdir','up');
+    } else {
+        ARROW = '&nbsp;&nbsp;&darr;';
+        span.setAttribute('sortdir','down');
+    }
+    
+    // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
+    // don't do sortbottom rows
+    for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}
+    // do sortbottom rows only
+    for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}
+    
+    // Delete any other arrows there may be showing
+    var allspans = document.getElementsByTagName("span");
+    for (var ci=0;ci<allspans.length;ci++) {
+        if (allspans[ci].className == 'sortarrow') {
+            if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?
+                allspans[ci].innerHTML = '&nbsp;&nbsp;&nbsp;';
+            }
+        }
+    }
+        
+    span.innerHTML = ARROW;
+}
+
+function getParent(el, pTagName) {
+       if (el == null) return null;
+       else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())        // Gecko bug, supposed to be uppercase
+               return el;
+       else
+               return getParent(el.parentNode, pTagName);
+}
+function ts_sort_date(a,b) {
+    // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
+    if (aa.length == 10) {
+        dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);
+    } else {
+        yr = aa.substr(6,2);
+        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
+        dt1 = yr+aa.substr(3,2)+aa.substr(0,2);
+    }
+    if (bb.length == 10) {
+        dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);
+    } else {
+        yr = bb.substr(6,2);
+        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
+        dt2 = yr+bb.substr(3,2)+bb.substr(0,2);
+    }
+    if (dt1==dt2) return 0;
+    if (dt1<dt2) return -1;
+    return 1;
+}
+
+function ts_sort_currency(a,b) { 
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
+    return parseFloat(aa) - parseFloat(bb);
+}
+
+function ts_sort_numeric(a,b) { 
+    aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
+    if (isNaN(aa)) aa = 0;
+    bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); 
+    if (isNaN(bb)) bb = 0;
+    return aa-bb;
+}
+
+function ts_sort_caseinsensitive(a,b) {
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+}
+
+function ts_sort_default(a,b) {
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+}
+
+
+function addEvent(elm, evType, fn, useCapture)
+// addEvent and removeEvent
+// cross-browser event handling for IE5+,  NS6 and Mozilla
+// By Scott Andrew
+{
+  if (elm.addEventListener){
+    elm.addEventListener(evType, fn, useCapture);
+    return true;
+  } else if (elm.attachEvent){
+    var r = elm.attachEvent("on"+evType, fn);
+    return r;
+  } else {
+    alert("Handler could not be removed");
+  }
+} 
+       </script>
        [% content %]
 </head>
 
index 6dff0fe..d6d26d3 100644 (file)
@@ -278,7 +278,7 @@ BLOCK run_stage2;
                END;
        END;
 
-       '<br/><br/>';
+       '<br/><br/><div id="output_order_div"';
 
        WRAPPER form id="stage3_new" name="stage3_new" action="stage3" onsubmit="return send_it(this);" method="POST";
                INCLUDE hidden name='stage2' value=CGI.param('id');
@@ -292,7 +292,7 @@ BLOCK run_stage2;
                '</center><br/><br/>';
                '<script language="javascript">filters["reportname"] = "Report Name";</script>';
 
-               WRAPPER html/table width="100%";
+               WRAPPER html/table id='order_table' width="100%";
                        WRAPPER html/row  style="border-top: solid black 2px;";
                                INCLUDE html/cell colspan=2 content='<b>Output and Sort Order</b>' style="border-top: solid black 2px;";
                                INCLUDE html/cell colspan=2 content='<b>Output Formats</b>' align="center" style="border-top: solid black 2px;";
@@ -414,7 +414,7 @@ BLOCK run_stage2;
                                INCLUDE option value=column content=config.findvalue(xpath);
                        END;
                END;
-               '<br/><br/>';
+               '<br/><br/></div>';
 
                WRAPPER html/table border=0 width='100%';
                        WRAPPER html/row;
@@ -477,7 +477,8 @@ BLOCK run_stage2;
                                                                                current_value = report.filter.$t.$fieldname.$famname.$widgetname;
                                                                                logme(current_value);
        
-                                                                               INCLUDE $w_file widget_family=fam;
+                                                                               PROCESS $w_file widget_family=fam;
+                                                                               PROCESS editor;
                                                                CATCH;
                                                                        %]ARG!! Couldn't render widget [% $w_file %] ([% error.info %])!!![%
                                                                END;
@@ -554,6 +555,14 @@ BLOCK run_stage2;
                        END;
                END;
        
+               %]
+                       <div id='output_home'/>
+                       <script>
+                               document.getElementById('output_home').appendChild(
+                                       document.getElementById('output_order_div')
+                               );
+                       </script>
+               [%
 
                INCLUDE checkbox name="publicreport" value="t" checked=(report.publicreport == 't' ? 'checked' : '');
                'Public Report<br>';
index 138dec8..6a4e833 100644 (file)
@@ -283,6 +283,65 @@ BLOCK view_stage3;
                                INCLUDE html/cell content=rpt.recurrence style="border:solid gray 1px;";
                        END;
                        WRAPPER html/row;
+                               INCLUDE html/cell content="<b>Selection Criteria</b>" 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="<b>Output Attributes</b>" 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) _ '<br/>';
+
+                                               END;
+                                       END;
+                               END;
+                       END;
+                       WRAPPER html/row;
                                INCLUDE html/cell content="<b>Actions</b>" 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;
index bf1e979..c1025c6 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER select name=input_prefix _ ":target";
        count = 1;
        def = 1;
@@ -28,5 +29,10 @@ WRAPPER select name=input_prefix _ ":compare";
        END;
 END;
 ' months before target';
+END;
+
+BLOCK display;
+current_value.compare _' months before runtime compared to ' _ current_value.compare _ ' months before target';
+END;
 
 %]
index 4d27a51..29e4ff1 100644 (file)
@@ -2,6 +2,7 @@
 
 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;';
 
@@ -36,6 +37,7 @@ WRAPPER select id=input_prefix name=input_prefix onchange='change_hier_' _ table
                INCLUDE next_level parent_ou = f.id depth;
        END;
 END;
+END;
 
 
 BLOCK next_level;
@@ -72,4 +74,9 @@ BLOCK next_level;
        END;
 END;
 
+BLOCK display;
+org_units = DBI.tie('actor.org_unit', 'id')
+ou = org_units.$current_value;
+ou.name;
+END;
 %]
index eb0d8fa..af69d5d 100644 (file)
@@ -2,6 +2,7 @@
 
 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;';
 
@@ -43,6 +44,7 @@ WRAPPER select name=input_prefix multi="multi" onchange='change_multihier_' _ ta
                INCLUDE next_level parent_ou = f.id;
        END;
 END;
+END;
 
 BLOCK next_level;
        depth = depth + 1;
@@ -80,4 +82,12 @@ BLOCK next_level;
        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('<br/>');
+END;
 %]
index 8dc510c..cc3db6a 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER select name=input_prefix;
        count = 1;
        def = 1;
@@ -14,5 +15,9 @@ WRAPPER select name=input_prefix;
        END;
 END;
 ' days before runtime';
+END;
 
+BLOCK display;
+current_value _ ' days before runtime';
+END
 %]
index cc48031..f583a85 100644 (file)
@@ -2,6 +2,8 @@
 
 PROCESS inputs;
 
+BLOCK editor;
+
 WRAPPER select name=input_prefix;
        count = 1;
         IF current_value;
@@ -13,5 +15,10 @@ WRAPPER select name=input_prefix;
        END;
 END;
 ' months before runtime';
+END;
+
+BLOCK display;
+current_value _ ' months before runtime';
+END;
 
 %]
index 303b96e..850bac6 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER select name=input_prefix;
        count = 1;
        WHILE count < 37;
@@ -10,5 +11,9 @@ WRAPPER select name=input_prefix;
        END;
 END;
 ' (calendar) quarters before runtime';
+END;
 
+BLOCK display;
+current_value _ ' (calendar) quarters before runtime';
+END;
 %]
index 04efe7d..cbe2ac9 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER select name=input_prefix;
        count = 1;
         IF current_value;
@@ -13,5 +14,9 @@ WRAPPER select name=input_prefix;
        END;
 END;
 ' weeks before runtime';
+END;
 
+BLOCK display;
+current_value _ ' weeks before runtime';
+END;
 %]
index d60ff1b..0387ade 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER select name=input_prefix;
        count = 1;
         IF current_value;
@@ -13,5 +14,9 @@ WRAPPER select name=input_prefix;
        END;
 END;
 ' years before runtime';
+END;
 
+BLOCK display;
+current_value _ ' years before runtime';
+END;
 %]
index 0f6c3be..b6767c1 100644 (file)
@@ -6,6 +6,7 @@ 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';
@@ -76,4 +77,9 @@ WRAPPER html/table ;
        END;
 END;
 
+END;
+
+BLOCK display;
+END;
+
 %]
index 17d017d..d856271 100644 (file)
@@ -5,6 +5,7 @@ USE start = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER html/table ;
        WRAPPER html/row;
                INCLUDE html/cell content='Year';
@@ -29,5 +30,10 @@ WRAPPER html/table ;
        END;
 
 END;
+END;
+
+BLOCK display;
+current_value.year _ '-' _ current_value.month _ '-' _ current_value.day;
+END;
 
 %]
index 408da28..0b2d6cc 100644 (file)
@@ -6,6 +6,8 @@ USE end = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
+
 WRAPPER html/table ;
 
        WRAPPER html/row;
@@ -33,5 +35,12 @@ WRAPPER html/table ;
        END;
 
 END;
+END;
 
+BLOCK display;
+f = 'start-year';
+current_value.$f _ '-';
+f = 'start-month';
+current_value.$f;
+END;
 %]
index 40264db..a3a7753 100644 (file)
@@ -6,6 +6,8 @@ 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';
@@ -53,5 +55,21 @@ WRAPPER html/table ;
                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;
 
 %]
index 2ffe1b0..f229fb2 100644 (file)
@@ -5,6 +5,8 @@ USE start = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
+
 WRAPPER html/table ;
 
        WRAPPER html/row;
@@ -32,4 +34,10 @@ WRAPPER html/table ;
 
 END;
 
+END;
+
+BLOCK display;
+'Year: ' _ current_value.year _ ', Quarter: ' _ current_value.quarter;
+END;
+
 %]
index 642a127..4785422 100644 (file)
@@ -5,6 +5,8 @@ USE start = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
+
 WRAPPER html/table;
 
        WRAPPER html/row;
@@ -48,6 +50,10 @@ WRAPPER html/table;
                END;
        END;
 END;
+END;
 
+BLOCK display;
+current_value.year _ ', weeks ' _ current_value.start _ ' through ' _ current_value.end;
+END;
 
 %]
index c845134..017a46e 100644 (file)
@@ -5,6 +5,7 @@ USE start = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER html/table ;
 
        WRAPPER html/row;
@@ -24,5 +25,11 @@ WRAPPER html/table ;
        END;
 
 END;
+END;
+
+BLOCK display;
+ycl = 'year-count';
+current_value.year _ ' through ' _ current_value.year + current_value.$ycl;
+END;
 
 %]
index 9bacd82..4f5afd1 100644 (file)
@@ -5,6 +5,7 @@ USE start = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
 WRAPPER html/table ;
 
        WRAPPER html/row;
@@ -26,5 +27,10 @@ WRAPPER html/table ;
        END;
 
 END;
+END;
+
+BLOCK display;
+'Year: ' _ current_value.year _ ', Quarter: ' _ current_value.quarter;
+END;
 
 %]
index ec75376..3b24f37 100644 (file)
@@ -5,6 +5,8 @@ PROCESS inputs;
 USE date;
 USE start = DateTime(now = 1);
 
+BLOCK editor;
+
 'Year: ';
 INCLUDE name=input_prefix _ ':year' text size=4 value=start.year;
 
@@ -21,5 +23,10 @@ WRAPPER select name=input_prefix _ ':week';
                count = count + 1;
        END;
 END;
+END;
+
+BLOCK display;
+'Year: ' _ current_value.year _ ', Week: ' _ current_value.week;
+END;
 
 %]
index 34bd338..706ed8a 100644 (file)
@@ -5,6 +5,8 @@ USE start = DateTime(now = 1);
 
 PROCESS inputs;
 
+BLOCK editor;
+
 WRAPPER html/table ;
 
        WRAPPER html/row;
@@ -18,5 +20,10 @@ WRAPPER html/table ;
        END;
 
 END;
+END;
+
+BLOCK display;
+current_value;
+END;
 
 %]
index d7d923c..01856f9 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 q = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' ORDER BY ' _ fieldname _ ';';
 
 '<script language="javascript">filters["' _ input_prefix _ '"] = "' _ table_label _ ' -- ' _ field.findvalue('label') _ '";</script>';
@@ -17,5 +18,10 @@ WRAPPER select name=input_prefix;
                INCLUDE option value=f.$fieldname;
        END;
 END;
+END;
+
+BLOCK display;
+current_value;
+END;
 
 %]
index 158962d..edd6fc0 100644 (file)
@@ -2,6 +2,7 @@
 
 PROCESS inputs;
 
+BLOCK editor;
 q = 'SELECT DISTINCT ' _ fieldname _ ' FROM ' _ table.findvalue('tablename') _ ' ORDER BY ' _ fieldname _ ';';
 
 '<script language="javascript">filters["' _ input_prefix _ '"] = "' _ table_label _ ' -- ' _ field.findvalue('label') _ '";</script>';
@@ -18,5 +19,10 @@ WRAPPER select name=input_prefix multi=1 size=10;
                INCLUDE option value=f.$fieldname;
        END;
 END;
+END;
+
+BLOCK display;
+current_value;
+END;
 
 %]
index 1dae31a..36d357c 100644 (file)
@@ -1,4 +1,11 @@
 [%
 PROCESS inputs;
+BLOCK editor;
 INCLUDE text name=input_prefix size=20 value=current_value;
+END;
+
+BLOCK display;
+current_value;
+END;
+
 %]
index 1dae31a..a3dfb60 100644 (file)
@@ -1,4 +1,12 @@
 [%
 PROCESS inputs;
+
+BLOCK editor;
 INCLUDE text name=input_prefix size=20 value=current_value;
+END;
+
+BLOCK display;
+current_value;
+END;
+
 %]
index 3cece2d..48ef829 100644 (file)
@@ -1,4 +1,12 @@
 [%
 PROCESS inputs;
+
+BLOCK editor;
 INCLUDE textarea name=input_prefix value=current_value;
+END;
+
+BLOCK display;
+current_value;
+END;
+
 %]