Advanced search:

- deduplicate pre-existing criterion N°1454
- search's 'breadcrumb' and 'history.replaceState' now preserve the org_id parameter

SVN:trunk[5808]
This commit is contained in:
Bruno Da Silva
2018-05-22 16:03:38 +00:00
parent 571d90618e
commit 4f900e36c1

View File

@@ -195,6 +195,7 @@ $(function()
var sNewUrl = GetAbsoluteUrlAppRoot()+'pages/UI.php?operation=search'; var sNewUrl = GetAbsoluteUrlAppRoot()+'pages/UI.php?operation=search';
sNewUrl = sNewUrl + '&filter='+oData['filter']; sNewUrl = sNewUrl + '&filter='+oData['filter'];
sNewUrl = sNewUrl + '&c[menu]='+me._extractURLParameter(window.location.href, "c[menu]"); sNewUrl = sNewUrl + '&c[menu]='+me._extractURLParameter(window.location.href, "c[menu]");
sNewUrl = sNewUrl + '&c[org_id]='+me._extractURLParameter(window.location.href, "c[org_id]");
if ('' != me._extractURLParameter(window.location.href, "debug")) if ('' != me._extractURLParameter(window.location.href, "debug"))
{ {
sNewUrl = sNewUrl + '&debug='+me._extractURLParameter(window.location.href, "debug"); sNewUrl = sNewUrl + '&debug='+me._extractURLParameter(window.location.href, "debug");
@@ -687,11 +688,21 @@ $(function()
} }
var aANDs = (aORs[iORIdx]['and'] !== undefined) ? aORs[iORIdx]['and'] : []; var aANDs = (aORs[iORIdx]['and'] !== undefined) ? aORs[iORIdx]['and'] : [];
var aANDsStringified = [];//used in order to deduplicate the crterions
for(var iANDIdx in aANDs) for(var iANDIdx in aANDs)
{ {
var oCriteriaData = aANDs[iANDIdx]; var oCriteriaData = aANDs[iANDIdx];
var sCriteriaData = JSON.stringify(oCriteriaData);
if (aANDsStringified.indexOf(sCriteriaData) == -1)
{
aANDsStringified.push(sCriteriaData);
this._addCriteria(oCriteriaData, oCriterionGroupElem); this._addCriteria(oCriteriaData, oCriterionGroupElem);
} }
}
iORCount++; iORCount++;
} }