From eea9116aacb4e7ca97a3e95ca9f3368e15f3a7c3 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 20 Sep 2006 19:30:36 +0000 Subject: [PATCH] more ui work git-svn-id: svn://svn.open-ils.org/ILS/trunk@6168 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/reports/oils_rpt_builder.js | 29 ++++++++++++++++++++++------- Open-ILS/web/reports/oils_rpt_builder.xhtml | 15 ++++++++++++--- Open-ILS/web/reports/oils_rpt_utils.js | 5 ++++- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Open-ILS/web/reports/oils_rpt_builder.js b/Open-ILS/web/reports/oils_rpt_builder.js index ae8817e593..d6942cb422 100644 --- a/Open-ILS/web/reports/oils_rpt_builder.js +++ b/Open-ILS/web/reports/oils_rpt_builder.js @@ -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'))}; } diff --git a/Open-ILS/web/reports/oils_rpt_builder.xhtml b/Open-ILS/web/reports/oils_rpt_builder.xhtml index e5a0ed0fc6..74da54e7fd 100644 --- a/Open-ILS/web/reports/oils_rpt_builder.xhtml +++ b/Open-ILS/web/reports/oils_rpt_builder.xhtml @@ -80,9 +80,9 @@
- - - + + +
Display Items and TransformsFiltersAggregate FiltersDisplay Items and TransformsFiltersAggregate Filters
@@ -90,6 +90,15 @@

+ +
+ +
+ +
+ +
+
diff --git a/Open-ILS/web/reports/oils_rpt_utils.js b/Open-ILS/web/reports/oils_rpt_utils.js index 0a45e3d6d4..9322536324 100644 --- a/Open-ILS/web/reports/oils_rpt_utils.js +++ b/Open-ILS/web/reports/oils_rpt_utils.js @@ -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 */ -- 2.11.0