Skip to content
Snippets Groups Projects
Commit 49346bd8 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

fix employee as attribute selection

parent 9324d848
No related branches found
No related tags found
No related merge requests found
......@@ -306,6 +306,9 @@
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>SHORT_UID</name>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......@@ -366,6 +369,9 @@
<name>ROLE_FILTER.value</name>
<isFilterable v="true" />
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>SHORT_UID.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
<filterExtensions>
<filterExtension>
......
......@@ -92,6 +92,7 @@ for (let i = 0, l = users.length; i < l; i++)
{
users[i][9] = nameMap[users[i][8]] || "";
users[i][12] = "";
users[i][13] = EmployeeUtils.sliceUserId(users[i][0]);
}
var order = vars.get("$local.order");
......
import("Employee_lib");
import("KeywordData_lib");
import("Context_lib");
import("system.util");
......@@ -158,6 +159,9 @@ AttributeUtil.getPossibleListValues = function (pAttributeId, pAttributeType, pI
if (module)
{
var uid = "#UID";
if (module == "Employee_entity")
uid = "SHORT_UID";
var title = "#CONTENTTITLE";
var config = entities.createConfigForLoadingRows()
.entity(module)
......@@ -782,6 +786,9 @@ $AttributeTypes.OBJECTSELECTION = {
{
if (pValue)
{
if (pModule == "Employee_entity")
pValue = EmployeeUtils.prefixUserId(pValue);
var title = "#CONTENTTITLE";
var config = entities.createConfigForLoadingRows()
.entity(pModule)
......@@ -794,6 +801,7 @@ $AttributeTypes.OBJECTSELECTION = {
},
getDropDownDefinitions : function ()
{
// TODO: use loadEntity from context_entity
var dropDownList = [];
project.getDataModels(project.DATAMODEL_KIND_ENTITY).forEach(
function (entity)
......
......@@ -49,6 +49,11 @@ EmployeeUtils.sliceUserId = function (pUserId)
return pUserId.slice(-36);
}
EmployeeUtils.prefixUserId = function (pUserId)
{
return "_____USER_" + pUserId;
}
/**
* generates a username from the firstname and lastname with the given structure
*
......
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