From 275f4ebbbe1a4b10576e32036507deafd27469ba Mon Sep 17 00:00:00 2001
From: "a.schindlbeck" <a.schindlbeck@adito.de>
Date: Thu, 25 Jul 2019 07:39:04 +0200
Subject: [PATCH] #1041362 Attendees werden beim Terminerstellen wieder richtig
 aufgenommen

---
 .../Appointment_entity/Appointment_entity.aod   |  1 +
 .../entityfields/attendees/valueProcess.js      | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 entity/Appointment_entity/entityfields/attendees/valueProcess.js

diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod
index 1a2a3e9f37..621f5a8bfd 100644
--- a/entity/Appointment_entity/Appointment_entity.aod
+++ b/entity/Appointment_entity/Appointment_entity.aod
@@ -75,6 +75,7 @@
     <entityField>
       <name>ATTENDEES</name>
       <dropDownProcess>%aditoprj%/entity/Appointment_entity/entityfields/attendees/dropDownProcess.js</dropDownProcess>
+      <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/attendees/valueProcess.js</valueProcess>
     </entityField>
     <entityField>
       <name>TRANSPARENCY</name>
diff --git a/entity/Appointment_entity/entityfields/attendees/valueProcess.js b/entity/Appointment_entity/entityfields/attendees/valueProcess.js
new file mode 100644
index 0000000000..859cad665f
--- /dev/null
+++ b/entity/Appointment_entity/entityfields/attendees/valueProcess.js
@@ -0,0 +1,17 @@
+import("system.neon");
+import("system.vars");
+import("system.calendars");
+import("system.result");
+
+/**
+ * Following if() is only for passing param-parts from "new Appointment"-Dialog to AppointmentEditViewTemplate
+ */
+if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Entry_param") && vars.get("$this.value") == null)
+{
+    var event = JSON.parse(vars.getString("$param.Entry_param"));
+
+    if(event[calendars.AFFECTEDUSERS])
+        result.string(event[calendars.AFFECTEDUSERS]);
+}
+else
+    result.string(vars.get("$this.value"));
\ No newline at end of file
-- 
GitLab