Skip to content
Snippets Groups Projects
Commit 16a3c1f8 authored by S.Listl's avatar S.Listl
Browse files

EmployeeRole fix

parent ffffd284
No related branches found
No related tags found
No related merge requests found
import("system.translate");
import("system.util");
import("Util_lib");
import("system.vars");
......@@ -96,7 +97,7 @@ var attributeSql = sqlCondition.buildSql("select " + defaultFields.join(", ") +
var attributeValues = db.table(attributeSql).map(function (row)
{
let attributeId = row[1];
let attributeName = row[4];
let attributeName = translate.text(row[4]);
if (!getTree && !displaySimpleName && row[2])
{
let parentName = AttributeUtil.getFullAttributeName(row[2]);
......@@ -105,7 +106,7 @@ var attributeValues = db.table(attributeSql).map(function (row)
let value = row[AttributeTypeUtil.getTypeColumnIndex(row[3]) + defaultFields.length];
let viewValue;
if (row[3].trim() == $AttributeTypes.COMBO)
viewValue = row[6];
viewValue = translate.text(row[6]);
else
viewValue = AttributeTypeUtil.getAttributeViewValue(row[3].trim(), value, row[5]);
......@@ -139,11 +140,12 @@ function _fetchAttributes (pAttributeIds)
db.table(sqlCondition.buildSql(sqlSelect, "1=2"))
.forEach(function (row)
{
this[row[0]] = true;
this[row[0]] = true; //make entry in attributeObj to avoid duplicates
if (row[1])
nextIds.push(row[1]);
else
row[1] = null;
row[5] = translate.text(row[5]); //translate attribute name
parentAttributes.push(row);
}, attributeObj);
if (nextIds.length)
......
......@@ -6,6 +6,16 @@ var roles = [];
var userTitle = vars.exists("$param.UserTitle_param") && vars.get("$param.UserTitle_param");
if (userTitle && tools.existUsers(userTitle))
roles = tools.getRoles(userTitle).map(function (role) {return [role, role]});
{
var existsObj = {};
tools.getRoles(userTitle).forEach(function (role)
{
if (!this[role])
{
roles.push([role, role]);
this[role] = true;
}
}, existsObj);
}
result.object(roles);
\ No newline at end of file
......@@ -57,6 +57,10 @@
<key>Do you really want to delete this recurring appointment?</key>
<value>Wollen Sie wirklich die Serie löschen?</value>
</entry>
<entry>
<key>Open admin view</key>
<value>Admin-Ansicht öffnen</value>
</entry>
<entry>
<key>Long string value</key>
<value>Langer String-Wert</value>
......
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>EmployeeRoleEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<noneLayout>
<name>layout</name>
</noneLayout>
</layout>
<children>
<genericMultipleViewTemplate>
<name>GenericMultiple</name>
<entityField>#ENTITY</entityField>
<columns>
<neonTableColumn>
<name>ecaa1457-eb60-4116-a46c-9c91e2d3fd63</name>
<entityField>ROLE</entityField>
</neonTableColumn>
</columns>
</genericMultipleViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>EmployeeRoleEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<noneLayout>
<name>layout</name>
</noneLayout>
</layout>
<children>
<genericMultipleViewTemplate>
<name>GenericMultiple</name>
<entityField>#ENTITY</entityField>
<columns>
<neonTableColumn>
<name>ecaa1457-eb60-4116-a46c-9c91e2d3fd63</name>
<entityField>ROLE</entityField>
<width v="100" />
</neonTableColumn>
</columns>
</genericMultipleViewTemplate>
</children>
</neonView>
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