Skip to content
Snippets Groups Projects
Commit 9b240391 authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Sebastian Listl
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1057726][Roles: Filter funktioniert nicht]

parent 7c6bd179
No related branches found
No related tags found
No related merge requests found
import("JditoFilter_lib");
import("Util_lib");
import("system.translate");
import("system.vars");
......@@ -39,6 +40,31 @@ if (selectedRole != null) {
});
}
var filter = vars.get("$local.filter");
//TODO: this is a workaround that filters the records manually, it should be possible to filter the users with a tools.* method
var filterFields = ["UID", "ROLENAME", "ROLETITLE", "ROLETYPE", "ROLEDESCRIPTION", "USERCOUNT", "IS_ASSIGNABLE"];
var filterFns = {
"$$$LOOKUPFIELD$$$" : function (pRecordValue, pFilterValue, pOperator, pRow)
{
if (pOperator == "CONTAINS")
{
pRow = [pRow[1], pRow[3], pRow[4], pRow[5]];
var filterValues = pFilterValue.split(" ").filter(function (val) {return val.trim();});
return filterValues.every(function (filterValue)
{
return pRow.some(function (fieldValue)
{
return (new RegExp(filterValue, "i")).test(fieldValue);
});
});
}
return false;
}
};
res = JditoFilterUtils.filterRecords(filterFields, res, filter.filter, filterFns);
var order = vars.get("$local.order");
var columnOrder = {
"ROLENAME.value" : 1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment