diff --git a/entity/Role_entity/Role_entity.aod b/entity/Role_entity/Role_entity.aod index d7ab4438873a74d8138e1ac0e23a93d189d49fff..39f6b5e727efa30c26531ecfb5ba08ef3393a43f 100644 --- a/entity/Role_entity/Role_entity.aod +++ b/entity/Role_entity/Role_entity.aod @@ -121,6 +121,7 @@ </entityField> <entityField> <name>UID</name> + <valueProcess>%aditoprj%/entity/Role_entity/entityfields/uid/valueProcess.js</valueProcess> </entityField> <entityConsumer> <name>RoleChildrens</name> diff --git a/entity/Role_entity/entityfields/uid/valueProcess.js b/entity/Role_entity/entityfields/uid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4a9b27cc967acf29eaaca8df845716ef50c06a33 --- /dev/null +++ b/entity/Role_entity/entityfields/uid/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string("CUSTOM_" + vars.get("$field.ROLENAME")); \ No newline at end of file diff --git a/entity/Role_entity/recordcontainers/jdito/contentProcess.js b/entity/Role_entity/recordcontainers/jdito/contentProcess.js index 0c6c46b70b1a95980ae3ddfc8a13498eb96d91ea..9ebefcd24295fe15fac6ad9bde259395bf31d6b4 100644 --- a/entity/Role_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Role_entity/recordcontainers/jdito/contentProcess.js @@ -2,15 +2,17 @@ import("system.translate"); import("system.vars"); import("system.result"); import("system.tools"); - + +var res = []; + var lang = vars.get("$sys.clientlanguage");//e.g. "de" var country = vars.get("$sys.clientcountry");//e.g. "DE" -locale = country ? lang + "_" + country : lang; +var locale = country ? lang + "_" + country : lang; + var selectedRole = vars.get("$local.idvalues"); var allRoles = tools.getAllRoles(); -var res = []; - var excludeRoles = {}; + if (vars.exists("$param.ExcludeRoles_param") && vars.get("$param.ExcludeRoles_param")) { JSON.parse(vars.getString("$param.ExcludeRoles_param")).forEach(function (e) @@ -27,16 +29,11 @@ for each (let role in allRoles) { } } -var ids = vars.get("$local.idvalues"); -if (ids != null) -{ - res = res.filter(function(resEntry) - { - for (let i = 0; i < ids.length; i++) - { - if (resEntry[0] == ids[i]) - return true; - } +if (selectedRole != null) { + res = res.filter(function(resEntry) { + if (resEntry[0] == selectedRole) + return true; + return false; }); }