Skip to content
Snippets Groups Projects
Commit 85d2f437 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '1057726_FixRolesFilter' into '2020.1'

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

See merge request xrm/basic!248
parents 7c6bd179 9b240391
No related branches found
No related tags found
No related merge requests found
import("JditoFilter_lib");
import("Util_lib"); import("Util_lib");
import("system.translate"); import("system.translate");
import("system.vars"); import("system.vars");
...@@ -39,6 +40,31 @@ if (selectedRole != null) { ...@@ -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 order = vars.get("$local.order");
var columnOrder = { var columnOrder = {
"ROLENAME.value" : 1, "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