From ae47d1c1ee151a457c6ff86def995ca8675f4867 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 11 May 2007 04:10:17 +0000 Subject: [PATCH] keep column removal from killing order_by git-svn-id: svn://svn.open-ils.org/ILS/trunk@7240 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/reports/xul/template-config.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/reports/xul/template-config.js b/Open-ILS/web/reports/xul/template-config.js index 9fb451c4e9..66f9e53499 100644 --- a/Open-ILS/web/reports/xul/template-config.js +++ b/Open-ILS/web/reports/xul/template-config.js @@ -12,14 +12,21 @@ function removeReportAtom (args) { var tree = tabpanel.getElementsByTagName('tree')[0]; var fields = getSelectedItems(tree); + for (var i in fields) { var field = fields[i]; var colname = field.firstChild.firstChild.nextSibling.getAttribute('label'); - var relation_alias = field.getAttribute('relation'); - delete rpt_rel_cache[relation_alias].fields[tabname][colname]; + if (tabname == 'dis_tab') { + var _o_tmp = []; + for each (var _o_col in rpt_rel_cache.order_by) { + if (_o_col.relation == relation_alias && _o_col.field == colname) continue; + _o_tmp.push( _o_col ); + } + rpt_rel_cache.order_by = _o_tmp + } with (rpt_rel_cache[relation_alias].fields) { if ( getKeys(dis_tab).length == 0 && getKeys(filter_tab).length == 0 && getKeys(aggfilter_tab).length == 0 ) -- 2.11.0