From e70f5302172b6b6439f7d3af4f08c8fd06929d08 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 5 Dec 2006 15:21:44 +0000 Subject: [PATCH] fixed logic bug in filter removal code git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6650 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/reports/oils_rpt_builder.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/reports/oils_rpt_builder.js b/Open-ILS/web/reports/oils_rpt_builder.js index e86e87ff5e..e1e3b86655 100644 --- a/Open-ILS/web/reports/oils_rpt_builder.js +++ b/Open-ILS/web/reports/oils_rpt_builder.js @@ -489,13 +489,24 @@ function _oilsDelSelectedFilterItems(type) { /* the values in this list are formed: :: */ var list = oilsDelSelectedItems(oilsRptFilterSelector); + _debug("deleting filter items " + list); + for( var i = 0; i < list.length; i++ ) { var enc_path = list[i]; var data = oilsRptParseFilterEncPath(enc_path); + + _debug("trimming filter items with enc_path = " + enc_path); + _debug(data.path); + _debug(data.operation); + _debug(data.tform); + _debug(data.tform); + _debug(type); + _debug('---------------------'); + oilsRpt.def[type] = grep( oilsRpt.def[type], function(f) { - return oilsRptFilterDataMatches( + return ! oilsRptFilterDataMatches( f, data.path, data.operation, data.tform ); } ); @@ -519,10 +530,17 @@ function oilsRptFilterDataMatches(filter, path, operation, tform) { var rel = hex_md5(oilsRptPathRel(path)); var col = oilsRptPathCol(path); + /* + _debug("oilsRptFilterDataMatches(): " + col + " : " + rel + " : " + tform + " : " + operation); + _debug("oilsRptFilterDataMatches(): " + filter.column.colname + " : " + filter.relation + " : " + + filter.column.transform + " : " + oilsRptObjectKeys(filter.condition)[0]); + _debug("------------------"); + */ + if( col == filter.column.colname && rel == filter.relation && tform == filter.column.transform && - operation == oilsRptObjectKeys(filter)[0] ) return true; + operation == oilsRptObjectKeys(filter.condition)[0] ) return true; return false; } -- 2.11.0