more ui work
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Sep 2006 19:30:36 +0000 (19:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Sep 2006 19:30:36 +0000 (19:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6168 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/reports/oils_rpt_builder.js
Open-ILS/web/reports/oils_rpt_builder.xhtml
Open-ILS/web/reports/oils_rpt_utils.js

index ae8817e..d6942cb 100644 (file)
@@ -23,13 +23,14 @@ function oilsRptMakeLabel(path) {
 
 
 /* adds an item to the display window */
-function oilsAddRptDisplayItem(val) {
-       if( ! oilsAddSelectorItem(oilsRptDisplaySelector, val) ) 
+function oilsAddRptDisplayItem(val, name) {
+       if( ! oilsAddSelectorItem(oilsRptDisplaySelector, val, name) ) 
                return;
 
        /* add the selected columns to the report output */
        var splitp = oilsRptSplitPath(val);
-       oilsRpt.select.push( {relation:splitp[0], column:splitp[1]} );
+       name = (name) ? name : splitp[1];
+       oilsRpt.select.push( {relation:splitp[0], column:splitp[1], alias:name} );
        oilsRptDebug();
 }
 
@@ -76,8 +77,8 @@ function oilsDelSelectedFilterItems() {
 
 
 /* adds an item to the display window */
-function oilsAddSelectorItem(sel, val) {
-       var name = oilsRptMakeLabel(val);
+function oilsAddSelectorItem(sel, val, name) {
+       name = (name) ? name : oilsRptMakeLabel(val);
        _debug("adding selector item "+name+' = ' +val);
        for( var i = 0; i < sel.options.length; i++ ) {
                var opt = sel.options[i];
@@ -110,6 +111,12 @@ function oilsDelSelectedItems(sel) {
        return list;
 }
 
+function oilsRptHideEditorDivs() {
+       hideMe($('oils_rpt_tform_div'));
+       hideMe($('oils_rpt_filter_div'));
+       hideMe($('oils_rpt_agg_filter_div'));
+}
+
 
 function oilsRptDrawDataWindow(path) {
 
@@ -120,9 +127,8 @@ function oilsRptDrawDataWindow(path) {
        _debug("setting update data window for column "+col+' on class '+cls);
 
        var div = $('oils_rpt_column_editor');
-
        unHideMe(div);
-       /* don't let them see it until the position is fully determined */
+       /* don't let them see the floating div until the position is fully determined */
        div.style.visibility='hidden'; 
 
        oilsRptDrawTransformWindow(path, col, cls, field);
@@ -133,6 +139,15 @@ function oilsRptDrawDataWindow(path) {
 
        /* focus after all the shifting to make sure the div is at least visible */
        $('oils_rpt_tform_label_input').focus();
+
+
+       /* give the tab links behavior */
+       $('oils_rpt_tform_tab').onclick = 
+               function(){oilsRptHideEditorDivs();unHideMe($('oils_rpt_tform_div'))};
+       $('oils_rpt_filter_tab').onclick = 
+               function(){oilsRptHideEditorDivs();unHideMe($('oils_rpt_filter_div'))};
+       $('oils_rpt_agg_filter_tab').onclick = 
+               function(){oilsRptHideEditorDivs();unHideMe($('oils_rpt_agg_filter_div'))};
 }
 
 
index e5a0ed0..74da54e 100644 (file)
@@ -80,9 +80,9 @@
                <div id='oils_rpt_column_editor' class='floaty hide_me'>
 
                        <table id='oils_rpt_editor_tab_table'><tbody><tr>
-                               <td width='33%'><a id='oils_rpt_tform_tab'>Display Items and Transforms</a></td>
-                               <td width='33%'><a id='oils_rpt_tform_tab'>Filters</a></td>
-                               <td width='33%'><a id='oils_rpt_tform_tab'>Aggregate Filters</a></td>
+                               <td width='33%'><a id='oils_rpt_tform_tab' href='javascript:void(0);'>Display Items and Transforms</a></td>
+                               <td width='33%'><a id='oils_rpt_filter_tab' href='javascript:void(0);'>Filters</a></td>
+                               <td width='33%'><a id='oils_rpt_agg_filter_tab' href='javascript:void(0);'>Aggregate Filters</a></td>
                        </tr></tbody></table>
 
                        <div id='oils_rpt_tform_div'>
                                <br/><br/>
                                <button id='oils_rpt_tform_submit'>Add Item</button>
                        </div>
+
+                       <div id='oils_rpt_filter_div' class='hide_me'>
+                               <button id='oils_rpt_filter_submit'>Add Item</button>
+                       </div>
+
+                       <div id='oils_rpt_agg_filter_div' class='hide_me'>
+                               <button id='oils_rpt_agg_filter_submit'>Add Item</button>
+                       </div>
+
                        <div id='oils_rpt_column_editor_close_div'>
                                <button id='oils_rpt_column_editor_close_button'>Close Window</button>
                        </div>
index 0a45e3d..9322536 100644 (file)
@@ -21,7 +21,10 @@ function oilsRptDebug() {
        _debug(oilsRpt.toString());
        _debug("\n-------------------------------------\n");
        if(!oilsRptDebugEnabled) return;
-       //oilsRptDebugWindow;
+       if(!oilsRptDebugWindow)
+               oilsRptDebugWindow = window.open('','Debug','resizable,width=700,height=500,scrollbars=1'); 
+
+       oilsRptDebugWindow.document.body.innerHTML = oilsRpt.toHTMLString();
 }
 
 /* pretty print JSON */