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

Sales 1081344 1078539 fix turn over district classification type filter fix

parent 8a3a7f82
No related branches found
No related tags found
No related merge requests found
......@@ -67,8 +67,6 @@ Adding the classification to other modules:
-add CLASSIFICATIONSTORAGE_ID to the Filterview and Preview.
-optional: check "filterable" if you want it filterable (probably not that useful)
Add the reference to the ClassificationView to the Mainview Context (see als organsiation and salesproject)
Add the classificationFilterExtensionSet:
-"ClassificationType_filter" for filtering of the achieved Classifications for each group
Add the entityFields you want to use to $ClassificationIndicatorRegistry.getEntityNumberFields() and $ClassificationIndicatorRegistry.getEntityDropDownFields()
And optionally add complex Fields in an registry like ClassificationIndicatorRegistry_basic
-> if you do add a new registry: don't forget to add its functions in ClassificationUpdate_lib
......
......@@ -11,11 +11,6 @@ import("system.result");
if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT && vars.get("$field.CLASSIFICATIONTYPEID") != $ClassificationPlaceholder.TOPSECRETPLACEHOLDER())
{
//We want to exclude all the classificationFilterFields.
//Excluding via this process works by returning a array with all the fieldNames you want to exclude.
//The ClassificationFilters are ClassificationFilterExtensionSets so the name of one of these fields looks like this:
// "#EXTENSION." + Set-Name + "." + Field-Name + "#" + Contenttype
// e.g: "#EXTENSION.ClassificationType_filter.d67397c5-5e05-433b-b61d-12807906aa5a#TEXT""
var classificationTypes = newSelect("CLASSIFICATIONTYPE.CLASSIFICATIONTYPEID, CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID, CLASSIFICATIONTYPE.OBJECT_TYPE")
.from("CLASSIFICATIONTYPE")
......@@ -30,8 +25,6 @@ if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT && vars.get("$fie
var previousObjectType;
for (let i = 0; i < classificationTypes.length; i++) {
//classificationTypeFilterFields are just the classificationTypeId with the correct prefix and contenttype
res.push("#EXTENSION.ClassificationType_filter."+classificationTypes[i][0]+"#TEXT")
//classificationGroupFilterFields are are a little more complicated:
//it's the classificationGroupId + the correct SqlCondition (as String) encoded via ClassificationGroupFilterNameCoder +correct prefix and contenttype
......
......@@ -13,7 +13,7 @@
<contentTitleProcess>%aditoprj%/entity/Member_entity/contentTitleProcess.js</contentTitleProcess>
<iconId>VAADIN:FILE_SOUND</iconId>
<titlePlural>${SALESPROJECT_MEMBER}</titlePlural>
<recordContainer>db</recordContainer>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
......
......@@ -62,106 +62,4 @@ memberRows = memberRows.map(function(row)
];
});
if (Utils.isNullOrEmpty(idValues) || memberRows.length === 0)
{
if (vars.get("$param.ObjectType_param") == "Salesproject" && vars.get("$param.ObjectRowId_param") != null)
{
var orgContactId = newSelect("SALESPROJECT.CONTACT_ID")
.from("SALESPROJECT")
.where("SALESPROJECT.SALESPROJECTID", "$param.ObjectRowId_param")
.cell();
var districtLoadingConfig = entities.createConfigForLoadingRows()
.entity("DistrictResponsible_entity")
.provider("OrganisationResponsibles")
.addParameter("OrgUid_param", orgContactId)
.fields(["#UID","DISTRICTRESPONSIBLEID", "DISTRICT_ID", "EMPLOYEE_CONTACT_ID",
"EMPLOYEE_CONTACT_ID.displayValue", "USER_EDIT", "USER_NEW",
"departmentAttributeName", "DATE_EDIT", "DATE_NEW"]);
var districtRows = entities.getRows(districtLoadingConfig);
districtRows = districtRows.map(function(row)
{
return [
row["#UID"],
row["DISTRICTRESPONSIBLEID"],
row["DISTRICT_ID"],
row["EMPLOYEE_CONTACT_ID"],
row["EMPLOYEE_CONTACT_ID.displayValue"],
row["USER_EDIT"],
row["USER_NEW"],
row["departmentAttributeName"],
row["DATE_EDIT"],
row["DATE_NEW"]
];
});
}
var responsibleUids = [];
if(districtRows != undefined)
{
districtRows.forEach(function(row){
responsibleUids.push(row[3]);
});
var loadingConfPers = entities.createConfigForLoadingRows()
.entity("Person_entity")
.uids(responsibleUids)
.fields(["ORGANISATION_ID", "ORGANISATION_NAME", "CONTACTROLE", "POSITION",
"FIRSTNAME", "LASTNAME", "SALUTATION", "TITLE", "PERSONID", "CONTACTID"]);
var persRowsMap = {};
entities.getRows(loadingConfPers).forEach(function(item) {
persRowsMap[item["CONTACTID"]] = item;
});
var persRows = [];
responsibleUids.forEach(function(uid) {
persRows.push(persRowsMap[uid]);
});
persRows = persRows.map(function(row){
return [row["SALUTATION"], row["TITLE"], row["FIRSTNAME"], row["LASTNAME"],
row["ORGANISATION_NAME"], row["ORGANISATION_ID"], row["CONTACTROLE"],
row["POSITION"], row["PERSONID"]];
});
districtRows.forEach(function(row, counter){
memberRows.push(
[row[0],
null,
row[3],
row[4],
persRows[counter][6],
row[7],
"VAADIN:GLOBE",
"TEXT:" + row[4].substring(row[4].indexOf(" ", 0)+1, row[4].length),
"70cbad1b-eac6-4369-ba50-4946e0fbcb3a",
translate.text("District Responsible"),
vars.get("$param.ObjectRowId_param"),
vars.get("$param.ObjectType_param"),
persRows[counter][5],
persRows[counter][4],
persRows[counter][2],
row[4],
persRows[counter][3],
persRows[counter][8],
persRows[counter][0],
persRows[counter][1],
persRows[counter][7],
null,
"DistrictResponsible",
"",
(new AttributeRelationQuery(
row[3],
$AttributeRegistry.loyalty()
).includeDisplayValue().getSingleAttribute() || {displayValue: ""}).displayValue
]);
});
}
}
result.object(memberRows);
\ No newline at end of file
......@@ -11603,9 +11603,11 @@ Bitte Datumseingabe prüfen</value>
</entry>
<entry>
<key>District: Name</key>
<value>Gebiet: Name</value>
</entry>
<entry>
<key>District: Number</key>
<value>Gebiet: Nummer</value>
</entry>
<entry>
<key>Bulkmail</key>
......
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