Skip to content
Snippets Groups Projects
Commit a99645b3 authored by c.wimmer's avatar c.wimmer
Browse files

[Projekt: Crowd-Development / Besuch vor Ort][TicketNr.: 1068875][[Bug]...

[Projekt: Crowd-Development / Besuch vor Ort][TicketNr.: 1068875][[Bug] Besuchsvorschlag Preview wenn Kontakt hinterlegt ist fehlerhaft]
parent 1e5e059e
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<entityProvider> <entityProvider>
<name>#PROVIDER</name> <name>#PROVIDER</name>
<targetContextField>TARGET_CONTEXT</targetContextField> <targetContextField>TARGET_CONTEXT</targetContextField>
<targetIdField>CONTACT_ID</targetIdField> <targetIdField>TARGET_ID</targetIdField>
<documentation>%aditoprj%/entity/VisitRecommendation_entity/entityfields/#provider/documentation.adoc</documentation> <documentation>%aditoprj%/entity/VisitRecommendation_entity/entityfields/#provider/documentation.adoc</documentation>
<dependencies> <dependencies>
<entityDependency> <entityDependency>
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
<description></description> <description></description>
<consumer>PersonConsumer</consumer> <consumer>PersonConsumer</consumer>
<groupable v="true" /> <groupable v="true" />
<linkedContext>Person</linkedContext>
<valueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_person_id/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_person_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_person_id/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_person_id/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
...@@ -237,6 +238,10 @@ ...@@ -237,6 +238,10 @@
<entityField> <entityField>
<name>STATUS</name> <name>STATUS</name>
</entityField> </entityField>
<entityField>
<name>TARGET_ID</name>
<valueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/target_id/valueProcess.js</valueProcess>
</entityField>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<jDitoRecordContainer> <jDitoRecordContainer>
......
import("system.vars");
import("system.result"); import("system.result");
result.string("Organisation") if(vars.get("$field.CONTACT_PERSON_ID"))
\ No newline at end of file result.string("Person")
else
result.string("Organisation")
\ No newline at end of file
import("system.result");
import("system.vars");
if(vars.get("$field.CONTACT_PERSON_ID"))
result.string(vars.get("$field.CONTACT_PERSON_ID"))
else
result.string(vars.get("$field.CONTACT_ID"))
\ No newline at end of file
...@@ -105,7 +105,7 @@ if(idValues == false) ...@@ -105,7 +105,7 @@ if(idValues == false)
.and("ACTIVITY.CATEGORY", "VISIT") .and("ACTIVITY.CATEGORY", "VISIT")
var visitFrequencyData = newSelect(["''" //0 var visitFrequencyData = newSelect(["''" //0
, "CONTACT.CONTACTID" //1 , "CONTACT.CONTACTID" //1
, "(" + newSelect("CONTACT.CONTACTID") , "(" + newSelect("CONTACT.CONTACTID")
.from("CONTACT") .from("CONTACT")
.leftJoin("AB_ATTRIBUTERELATION", "CONTACT.CONTACTID = AB_ATTRIBUTERELATION.OBJECT_ROWID") .leftJoin("AB_ATTRIBUTERELATION", "CONTACT.CONTACTID = AB_ATTRIBUTERELATION.OBJECT_ROWID")
...@@ -120,7 +120,9 @@ if(idValues == false) ...@@ -120,7 +120,9 @@ if(idValues == false)
,"ADDRESS.CITY" //6 ,"ADDRESS.CITY" //6
, "visitPlanFrequency.ID_VALUE"//7 , "visitPlanFrequency.ID_VALUE"//7
, activitySubQuery //8 , activitySubQuery //8
, "org.NAME"])//9 , "org.NAME" //9
, "PERSON.PERSONID" //10
])
.from("CONTACT") .from("CONTACT")
.join("ORGANISATION", "CONTACT.ORGANISATION_ID = org.ORGANISATIONID", "org") .join("ORGANISATION", "CONTACT.ORGANISATION_ID = org.ORGANISATIONID", "org")
.leftJoin("PERSON", "PERSON.PERSONID = CONTACT.PERSON_ID") .leftJoin("PERSON", "PERSON.PERSONID = CONTACT.PERSON_ID")
...@@ -131,6 +133,7 @@ if(idValues == false) ...@@ -131,6 +133,7 @@ if(idValues == false)
for (var i = 0; i < visitFrequencyData.length; i++) for (var i = 0; i < visitFrequencyData.length; i++)
{ {
var isPersonContact = visitFrequencyData[i][10] != ""
var dueDate = ""; var dueDate = "";
var lastVisitDate = ""; var lastVisitDate = "";
var today = datetime.date(); var today = datetime.date();
...@@ -177,7 +180,7 @@ if(idValues == false) ...@@ -177,7 +180,7 @@ if(idValues == false)
"", //USER_NEW.displayValue "", //USER_NEW.displayValue
"", //USER_NEW.value "", //USER_NEW.value
ContactUtils.getFullTitleByContactId(visitFrequencyData[i][1], false), //CONTACT_PERSON_ID.displayValue ContactUtils.getFullTitleByContactId(visitFrequencyData[i][1], false), //CONTACT_PERSON_ID.displayValue
visitFrequencyData[i][1], //CONTACT_PERSON_ID.value isPersonContact ? visitFrequencyData[i][1]: "", //CONTACT_PERSON_ID.value
"", //RESPONSIBLE.displayValue "", //RESPONSIBLE.displayValue
"" //RESPONSIBLE.value "" //RESPONSIBLE.value
]; ];
......
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