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

1039932 use same picture in Person and Employee

parent c887cbf4
No related branches found
No related tags found
No related merge requests found
Showing with 45 additions and 42 deletions
......@@ -133,15 +133,6 @@
<element>LASTNAME</element>
</fields>
</entityFieldGroup>
<entityField>
<name>IMAGE</name>
<contentType>IMAGE</contentType>
<valueProcess>%aditoprj%/entity/Employee_entity/entityfields/image/valueProcess.js</valueProcess>
<onValueChange>%aditoprj%/entity/Employee_entity/entityfields/image/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>DEPARTMENT</name>
<title>Department</title>
......@@ -373,6 +364,16 @@
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>PICTURE</name>
<contentType>IMAGE</contentType>
<valueProcess>%aditoprj%/entity/Employee_entity/entityfields/picture/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Employee_entity/entityfields/picture/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Employee_entity/entityfields/picture/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.db");
import("system.result");
import("system.neon");
import("system.vars");
import("Person_lib");
import("Sql_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
var personId = newSelect("PERSON_ID")
.from("CONTACT")
.whereIfSet("CONTACT.CONTACTID", "$field.CONTACT_ID")
.cell(true)
if (personId)
result.string(PersUtils.getImage(personId, (vars.getString("$field.FIRSTNAME") + " " + vars.getString("$field.LASTNAME")).trim()));
}
import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
result.string(vars.get("$field.PICTURE") || ("TEXT:" + (vars.getString("$field.FIRSTNAME") + " " + vars.getString("$field.LASTNAME")).trim()));
\ No newline at end of file
import("system.vars");
import("Entity_lib");
// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023
FieldChanges.setChange("$field.IMAGE", vars.get("$local.value"));
\ No newline at end of file
import("system.vars");
import("Entity_lib");
// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023
FieldChanges.setChange("$field.PICTURE", vars.get("$local.value"));
\ No newline at end of file
import("system.neon");
import("system.vars");
import("Sql_lib");
import("system.result");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
var picture = newSelect("PERSON.PICTURE")
.from("CONTACT")
.join("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID")
.whereIfSet("CONTACT.CONTACTID", "$field.CONTACT_ID")
.cell(true);
result.string(picture);
}
......@@ -6,17 +6,15 @@ import("Person_lib");
import("Entity_lib");
// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023
FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function (state, value)
FieldChanges.assimilateChangeAndDispose("$field.PICTURE", function (state, value)
{
var personId = newSelect("PERSON_ID")
.from("CONTACT")
.where("CONTACT.CONTACTID", "$field.CONTACT_ID")
.cell()
var personCondition = newWhere("PERSON.PERSONID", newSelect("PERSON_ID").from("CONTACT").where("CONTACT.CONTACTID", "$field.CONTACT_ID"))
.tableName("PERSON");
if (state == FieldChanges.STATE_CHANGED())
PersUtils.setImage(personId, value);
personCondition.updateFields({"PICTURE" : value});
else
PersUtils.removeImage(personId);
personCondition.updateFields({"PICTURE" : ""});
});
var rowdata = vars.get("$local.rowdata");
......
......@@ -11,7 +11,7 @@
<children>
<tableViewTemplate>
<name>Employees</name>
<iconField>IMAGE</iconField>
<iconField>PICTURE</iconField>
<titleField>NAME_fieldGroup</titleField>
<subtitleField>TITLE</subtitleField>
<descriptionField>EMAIL_ADDRESS</descriptionField>
......@@ -22,7 +22,7 @@
<columns>
<neonTableColumn>
<name>15185ef0-5402-43c4-b5c9-1e0e836ef1c3</name>
<entityField>IMAGE</entityField>
<entityField>PICTURE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>3e3552f9-9591-45ae-a0bb-a85210c2b382</name>
......
......@@ -14,7 +14,7 @@
<columns>
<neonTableColumn>
<name>e37a558f-1936-4e23-aac5-11c23028c1d5</name>
<entityField>IMAGE</entityField>
<entityField>PICTURE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>b7eb1603-f9eb-46ae-8096-cfecaee359d5</name>
......
......@@ -11,7 +11,7 @@
<children>
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<iconField>PICTURE</iconField>
<titleField>NAME_fieldGroup</titleField>
<subtitleField>TITLE</subtitleField>
<entityField>#ENTITY</entityField>
......
......@@ -22,4 +22,4 @@ var contacts = newSelect(["CONTACTID", new ContactTitleRenderer(Contact.createWi
result.object([
new WorkflowServiceTaskParameter("documentTemplateId", "Document template", WorkflowServiceTaskParameter.ENUM(), templates),
new WorkflowServiceTaskParameter("recipientContactId", "Recipient", WorkflowServiceTaskParameter.ENUM(), contacts)
]);l
\ No newline at end of file
]);
\ No newline at end of file
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