From fb28739ce2d8846a39104a04f114fb035c1e90ea Mon Sep 17 00:00:00 2001
From: "d.buechler" <d.buechler@adito.de>
Date: Tue, 23 Apr 2019 11:16:57 +0200
Subject: [PATCH] =?UTF-8?q?Standard-Kampagnenschritt=20Added/Hinzugef?=
 =?UTF-8?q?=C3=BCgt=20wird=20nun=20automatisch=20beim=20Erstellen=20einer?=
 =?UTF-8?q?=20Kampagne=20angelegt=20Chart=20bei=20Serienaktion=20hinzuf?=
 =?UTF-8?q?=C3=BCgen=20entfernt,=20stattdessen=20werden=20nun=20per=20Scor?=
 =?UTF-8?q?ecard=20Infos=20zu=20Teilnehmern=20angezeigt.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../create_campaignParticipantLog.xml         |  2 +-
 aliasDefinition/Data_alias/Data_alias.aod     | 28 +++++++-------
 .../newcampaignparticipant/stateProcess.js    |  2 +-
 .../CampaignAddParticipants_entity.aod        | 12 +++++-
 .../entityfields/campaign_id/onValueChange.js |  3 ++
 .../campaignstepid_param/valueProcess.js      |  3 --
 .../campaignstep_id/onValueChange.js          |  3 --
 .../displayValueProcess.js                    |  5 +++
 .../displayValueProcess.js                    |  5 +++
 .../recordcontainers/jdito/onInsert.js        | 19 +++++-----
 .../recordcontainers/jdito/onUpdate.js        | 38 -------------------
 .../onActionProcess.js                        |  4 +-
 .../CampaignStep_entity.aod                   |  2 +
 .../entityfields/campaign_id/valueProcess.js  |  4 +-
 .../children/campaignid_param/valueProcess.js |  2 +-
 entity/Campaign_entity/Campaign_entity.aod    |  2 +
 .../recordcontainers/db/onDBInsert.js         | 35 +++++++++++++++++
 entity/Person_entity/Person_entity.aod        |  3 --
 .../addtocampaignfromtable/onActionProcess.js |  3 +-
 .../_____LANGUAGE_EXTRA.aod                   |  9 +++++
 .../_____LANGUAGE_de/_____LANGUAGE_de.aod     |  8 ++++
 .../_____LANGUAGE_en/_____LANGUAGE_en.aod     |  9 +++++
 .../CampaignAddParticipants.aod               |  4 ++
 .../CampaignAddParticipantsEdit_view.aod      | 27 ++++++++-----
 .../CampaignParticipantFilter_view.aod        |  4 +-
 .../campaignParticipantMessage_view.aod       | 23 +++++++++++
 process/Campaign_lib/process.js               | 16 +++++++-
 27 files changed, 183 insertions(+), 92 deletions(-)
 delete mode 100644 entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js
 create mode 100644 entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/displayValueProcess.js
 create mode 100644 entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js
 delete mode 100644 entity/CampaignAddParticipants_entity/recordcontainers/jdito/onUpdate.js
 create mode 100644 entity/Campaign_entity/recordcontainers/db/onDBInsert.js
 create mode 100644 neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod

diff --git a/.liquibase/Data_alias/basic/2019.2/CampaignManagement/create_campaignParticipantLog.xml b/.liquibase/Data_alias/basic/2019.2/CampaignManagement/create_campaignParticipantLog.xml
index 9efbc598fb6..9aecc0e95b2 100644
--- a/.liquibase/Data_alias/basic/2019.2/CampaignManagement/create_campaignParticipantLog.xml
+++ b/.liquibase/Data_alias/basic/2019.2/CampaignManagement/create_campaignParticipantLog.xml
@@ -5,7 +5,7 @@
             <column name="CAMPAIGNPARTICIPANTLOGID" type="CHAR(36)">
                 <constraints primaryKey="true" primaryKeyName="PK_CAMPAIGNPARTICIPANTLOG_CAMPAIGNPARTICIPANTLOGID"/>
             </column>
-            <column name="CONTACT_ID" type="CHAR(36)">
+            <column name="CAMPAIGNPARTICIPANT_ID" type="CHAR(36)">
                 <constraints nullable="false"/>
             </column>
             <column name="CAMPAIGN_ID" type="CHAR(36)">
diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod
index b541a636045..72714b6c2dc 100644
--- a/aliasDefinition/Data_alias/Data_alias.aod
+++ b/aliasDefinition/Data_alias/Data_alias.aod
@@ -6523,20 +6523,6 @@
                 <title></title>
                 <description></description>
               </entityFieldDb>
-              <entityFieldDb>
-                <name>CONTACT_ID</name>
-                <dbName></dbName>
-                <primaryKey v="false" />
-                <columnType v="1" />
-                <size v="36" />
-                <scale v="0" />
-                <notNull v="true" />
-                <isUnique v="false" />
-                <index v="false" />
-                <documentation></documentation>
-                <title></title>
-                <description></description>
-              </entityFieldDb>
               <entityFieldDb>
                 <name>DATE_NEW</name>
                 <dbName></dbName>
@@ -6607,6 +6593,20 @@
                 <title></title>
                 <description></description>
               </entityFieldDb>
+              <entityFieldDb>
+                <name>CAMPAIGNPARTICIPANT_ID</name>
+                <dbName></dbName>
+                <primaryKey v="false" />
+                <columnType v="1" />
+                <size v="36" />
+                <scale v="0" />
+                <notNull v="true" />
+                <isUnique v="false" />
+                <index v="false" />
+                <documentation></documentation>
+                <title></title>
+                <description></description>
+              </entityFieldDb>
             </entityFields>
           </entityDb>
         </entities>
diff --git a/entity/360Degree_entity/entityfields/newmodule/children/newcampaignparticipant/stateProcess.js b/entity/360Degree_entity/entityfields/newmodule/children/newcampaignparticipant/stateProcess.js
index 2b00a9a7e37..da6fd5283ab 100644
--- a/entity/360Degree_entity/entityfields/newmodule/children/newcampaignparticipant/stateProcess.js
+++ b/entity/360Degree_entity/entityfields/newmodule/children/newcampaignparticipant/stateProcess.js
@@ -6,7 +6,7 @@ var contextList = JSON.parse(vars.getString("$param.ObjectType_param"));
 var found = false;
 contextList.forEach(function (context) 
 {
-    if(context == "CampaignParticipant")
+    if(context == "Campaign")
         found = true;        
 });
 if(found)
diff --git a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod
index 69a4b13e4fa..cd1b0c0648c 100644
--- a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod
+++ b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod
@@ -34,7 +34,6 @@
       <state>EDITABLE</state>
       <valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/valueProcess.js</valueProcess>
       <displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js</displayValueProcess>
-      <onValueChange>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js</onValueChange>
     </entityField>
     <entityField>
       <name>campaignParticipantMessage</name>
@@ -111,6 +110,16 @@
         </entityParameter>
       </children>
     </entityConsumer>
+    <entityField>
+      <name>campaignStepCurrentParticipantCount</name>
+      <title>Current participants</title>
+      <displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/displayValueProcess.js</displayValueProcess>
+    </entityField>
+    <entityField>
+      <name>campaignStepMaxParticipantCount</name>
+      <title>Max participants</title>
+      <displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js</displayValueProcess>
+    </entityField>
   </entityFields>
   <recordContainers>
     <jDitoRecordContainer>
@@ -118,7 +127,6 @@
       <jDitoRecordAlias>Data_alias</jDitoRecordAlias>
       <contentProcess>%aditoprj%/entity/CampaignAddParticipants_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
       <onInsert>%aditoprj%/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js</onInsert>
-      <onUpdate>%aditoprj%/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onUpdate.js</onUpdate>
       <recordFields>
         <element>UID.value</element>
       </recordFields>
diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js b/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js
index e69de29bb2d..2646a9a9ec3 100644
--- a/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js
+++ b/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js
@@ -0,0 +1,3 @@
+import("system.neon");
+
+//neon.setFieldValue("CAMPAIGNSTEP_ID", "")
\ No newline at end of file
diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignanalyses/children/campaignstepid_param/valueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignanalyses/children/campaignstepid_param/valueProcess.js
index 2dc31c4f5fe..1ad18e3c6c3 100644
--- a/entity/CampaignAddParticipants_entity/entityfields/campaignanalyses/children/campaignstepid_param/valueProcess.js
+++ b/entity/CampaignAddParticipants_entity/entityfields/campaignanalyses/children/campaignstepid_param/valueProcess.js
@@ -1,7 +1,4 @@
-import("system.logging");
 import("system.vars");
 import("system.result");
 
-logging.log("hui: " + vars.get("$field.CAMPAIGNSTEP_ID"));
-
 result.string(vars.get("$field.CAMPAIGNSTEP_ID"));
\ No newline at end of file
diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js
deleted file mode 100644
index 7ac67dbef30..00000000000
--- a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import("system.neon");
-
-neon.refreshAll();
\ No newline at end of file
diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/displayValueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/displayValueProcess.js
new file mode 100644
index 00000000000..d001f813402
--- /dev/null
+++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/displayValueProcess.js
@@ -0,0 +1,5 @@
+import("system.result");
+import("system.vars");
+import("Campaign_lib");
+
+result.string(CampaignUtils.getParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID")));
\ No newline at end of file
diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js
new file mode 100644
index 00000000000..cc8e454b27d
--- /dev/null
+++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js
@@ -0,0 +1,5 @@
+import("system.result");
+import("system.vars");
+import("Campaign_lib");
+
+result.string(CampaignUtils.getMaxParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID")));
\ No newline at end of file
diff --git a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js b/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js
index 4d9ef8e565b..0455f5402f4 100644
--- a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js
+++ b/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js
@@ -21,10 +21,10 @@ var cols = [];
 
 if(isUpdate == "true")
 {
-    cols = [   "CAMPAIGNSTEP_ID",
-                    "USER_EDIT",
-                    "DATE_EDIT"
-                ];
+    cols = [ "CAMPAIGNSTEP_ID",
+              "USER_EDIT",
+              "DATE_EDIT"
+            ];
 }
 else
 {
@@ -38,9 +38,10 @@ else
 }
 
 var statementArray = [];
-
+logging.log("isUpdate -> " + isUpdate);
 for (participant in participants)
 {
+    var campaignParticipantLogId = util.getNewUUID();
     if(isUpdate == "true")
     {
         let updatedValues = [newCampaignStepId,
@@ -48,11 +49,11 @@ for (participant in participants)
                         vars.get("$sys.date")];
         
         let condition = "CAMPAIGNPARTICIPANTID = '" + participants[participant] + "'";
-        
-        // new Array(campaignId, newCampaignStepId, participants[participant], campaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"));
-        var valsCampaignParticipantLog = new Array(campaignId, newCampaignStepId, "contactid", participants[participant], vars.get("$sys.user"), vars.get("$sys.date"));
+        logging.log("condition -> " + condition);
+        let valsCampaignParticipantLog = new Array(participants[participant], campaignId, newCampaignStepId, campaignParticipantLogId, vars.get("$sys.user"), vars.get("$sys.date"));
         
         statementArray.push(["CAMPAIGNPARTICIPANT", cols, null, updatedValues, condition]);
+        statementArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]);
     }
     else
     {
@@ -66,7 +67,7 @@ for (participant in participants)
         , vars.get("$sys.date")
         ];
 
-        var valsCampaignParticipantLog = new Array(campaignId, newCampaignStepId, participants[participant], campaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"));
+        let valsCampaignParticipantLog = new Array(campaignParticipantId, campaignId, newCampaignStepId, campaignParticipantLogId, vars.get("$sys.user"), vars.get("$sys.date"));
 
         statementArray.push(["CAMPAIGNPARTICIPANT", cols, null, valsCampaignParticipant]);
         statementArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]);
diff --git a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onUpdate.js b/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onUpdate.js
deleted file mode 100644
index 0ac5d73051b..00000000000
--- a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onUpdate.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import("Campaign_lib");
-import("system.vars");
-import("system.db");
-import("system.logging");
-
-logging.log("CampaignAddParticipants_entity_onUpdate");
-
-
-var campaignId     = vars.getString("$field.CAMPAIGN_ID");
-var campaignStepId = vars.getString("$field.CAMPAIGNSTEP_ID");
-var participants   = JSON.parse(vars.getString("$param.campaignParticipants_param"));
-
-var colNamesCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnNames();
-var colTypesCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnTypes();
-let colsUpdate = [   "CAMPAIGNSTEP_ID",
-                    "USER_EDIT",
-                    "DATE_EDIT"
-                ];
-let colTypesUpdate = db.getColumnTypes("CAMPAIGNPARTICIPANT", colsUpdate);
-
-
-var dataArray = [];
-
-for (participant in participants)
-{
-    //var campaignParticipantId = 
-    //var valsCampaignParticipantLog = new Array(campaignId, campaignStepId, participants[participant], , vars.get("$sys.user"), vars.get("$sys.date"));
-    let updatedValues = [campaignStepId,
-                        vars.get("$sys.user"),
-                        vars.get("$sys.date")];
-    
-    let condition = "CAMPAIGNSTEP_ID = '" + campaignStepId + "' and CONTACT_ID = '" + participants[participant] + "'";
-    
-    dataArray.push(["CAMPAIGNPARTICIPANT", colsUpdate, colTypesUpdate, updatedValues, condition]);
-    //dataArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, colTypesCampaignParticipantLog, valsCampaignParticipantLog]);
-}
-logging.log("dataArray" + JSON.stringify(dataArray));
-db.updates(dataArray);
\ No newline at end of file
diff --git a/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/setsteptoparticipantselection/onActionProcess.js b/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/setsteptoparticipantselection/onActionProcess.js
index 4a050a91642..4e09ec798a2 100644
--- a/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/setsteptoparticipantselection/onActionProcess.js
+++ b/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/setsteptoparticipantselection/onActionProcess.js
@@ -2,11 +2,13 @@ import("system.logging");
 import("system.vars");
 import("system.neon");
 import("Campaign_lib");
-
+logging.log("inOnAction -> ");
+    logging.log("sys selection -> " + vars.get("$sys.selection"));
 if(vars.exists("$sys.selection")) //selektierte IDs als Array
 {
     logging.log("campaignid -> " + vars.get("$field.CAMPAIGN_ID"));
     logging.log("campaignstepid -> " + vars.get("$field.CAMPAIGNSTEP_ID"));
     logging.log("contact id -> " + vars.get("$field.CONTACT_ID"));
+    logging.log("sys selection -> " + vars.get("$sys.selection"));
     CampaignUtils.openSetCampaignStepView(vars.get("$sys.selection"), vars.get("$field.CAMPAIGN_ID"), vars.get("$field.CAMPAIGNSTEP_ID"));
 }
\ No newline at end of file
diff --git a/entity/CampaignStep_entity/CampaignStep_entity.aod b/entity/CampaignStep_entity/CampaignStep_entity.aod
index afc75ece587..5e95b151c57 100644
--- a/entity/CampaignStep_entity/CampaignStep_entity.aod
+++ b/entity/CampaignStep_entity/CampaignStep_entity.aod
@@ -137,12 +137,14 @@
     <entityField>
       <name>MAXPARTICIPANTS</name>
       <title>Max participants</title>
+      <contentType>NUMBER</contentType>
       <mandatory v="true" />
     </entityField>
     <entityConsumer>
       <name>CampaignParticipantsConsumer</name>
       <title>Participants</title>
       <fieldType>DEPENDENCY_OUT</fieldType>
+      <selectionMode>MULTI</selectionMode>
       <dependency>
         <name>dependency</name>
         <entityName>CampaignParticipant_entity</entityName>
diff --git a/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js b/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js
index 0a46eaaae9f..9e7628a2cbd 100644
--- a/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js
+++ b/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js
@@ -1,6 +1,8 @@
+import("system.neon");
 import("system.logging");
 import("system.result");
 import("system.vars");
 
-if(vars.exists("$param.campaignId_param") && vars.get("$param.campaignId_param"))
+//For creation of new Step in CampaignMainView
+if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.campaignId_param") && vars.get("$param.campaignId_param"))
     result.string(vars.get("$param.campaignId_param"));
\ No newline at end of file
diff --git a/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignid_param/valueProcess.js b/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignid_param/valueProcess.js
index 4865a661b40..9dd7e44f4ea 100644
--- a/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignid_param/valueProcess.js
+++ b/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignid_param/valueProcess.js
@@ -1,4 +1,4 @@
 import("system.result");
 import("system.vars");
 
-result.string(vars.get("$param.campaignId_param"));
\ No newline at end of file
+result.string(vars.get("$field.CAMPAIGN_ID"));
\ No newline at end of file
diff --git a/entity/Campaign_entity/Campaign_entity.aod b/entity/Campaign_entity/Campaign_entity.aod
index 6f1e7690087..79b2552edc4 100644
--- a/entity/Campaign_entity/Campaign_entity.aod
+++ b/entity/Campaign_entity/Campaign_entity.aod
@@ -138,6 +138,7 @@
       <name>CampaignParticipants</name>
       <title>Participants</title>
       <fieldType>DEPENDENCY_OUT</fieldType>
+      <selectionMode>MULTI</selectionMode>
       <dependency>
         <name>dependency</name>
         <entityName>CampaignParticipant_entity</entityName>
@@ -173,6 +174,7 @@
     <dbRecordContainer>
       <name>db</name>
       <alias>Data_alias</alias>
+      <onDBInsert>%aditoprj%/entity/Campaign_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
       <linkInformation>
         <linkInformation>
           <name>f3893829-3af2-4e55-ae85-c3a24411a8b8</name>
diff --git a/entity/Campaign_entity/recordcontainers/db/onDBInsert.js b/entity/Campaign_entity/recordcontainers/db/onDBInsert.js
new file mode 100644
index 00000000000..671b8177755
--- /dev/null
+++ b/entity/Campaign_entity/recordcontainers/db/onDBInsert.js
@@ -0,0 +1,35 @@
+import("Employee_lib");
+import("system.translate");
+import("KeywordRegistry_basic");
+import("system.util");
+import("system.vars");
+import("system.logging");
+import("system.db");
+import("system.datetime");
+
+var threeWeeks = datetime.ONE_WEEK * 3;
+var inThreeWeeks = datetime.date() + threeWeeks;
+
+var campaignId = vars.get("$field.CAMPAIGNID");
+var campaignStepId = util.getNewUUID();
+var campaignStepName = translate.text("Added");
+
+var dateNew = vars.get("$sys.date");
+var userNew = vars.get("$sys.user");
+
+var dateStart = dateNew;
+var dateEnd = inThreeWeeks;
+
+var description = "";
+var maxParticipants = 100;
+var state = $KeywordRegistry.campaignStepState$open();
+var sorting = 0;
+var employeeContactId = vars.get("$field.EMPLOYEE_CONTACT_ID");
+
+
+var columns = ["CAMPAIGN_ID", "CAMPAIGNSTEPID", "NAME", "DATE_NEW", "USER_NEW", 
+    "DATE_START", "DATE_END", "DESCRIPTION", "MAXPARTICIPANTS", "STATE", "SORTING", "EMPLOYEE_CONTACT_ID"];
+var values = [campaignId, campaignStepId, campaignStepName, dateNew, userNew,
+    dateStart, dateEnd, description, maxParticipants, state, sorting, employeeContactId];
+
+db.insertData("CAMPAIGNSTEP", columns, null, values);
\ No newline at end of file
diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod
index bd40b44a11b..c231e6327e4 100644
--- a/entity/Person_entity/Person_entity.aod
+++ b/entity/Person_entity/Person_entity.aod
@@ -203,9 +203,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
         <fieldName>WithPersonIdFilter</fieldName>
       </dependency>
       <children>
-        <entityParameter>
-          <name>WithPrivate_param</name>
-        </entityParameter>
         <entityParameter>
           <name>ExcludeOrganisationsByPersonId</name>
           <valueProcess>%aditoprj%/entity/Person_entity/entityfields/organisations/children/excludeorganisationsbypersonid/valueProcess.js</valueProcess>
diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/onActionProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/onActionProcess.js
index 104558a4d9b..4272aa62116 100644
--- a/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/onActionProcess.js
+++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/onActionProcess.js
@@ -1,9 +1,8 @@
 import("system.vars");
 import("system.logging");
-import("system.logging");
 import("system.neon");
 import("Campaign_lib");
-
+    logging.log("sys selection -> " + vars.get("$sys.selection"));
 if(vars.exists("$sys.selection")) //selektierte IDs als Array
 {
     CampaignUtils.addParticipants(vars.getString("$sys.selection"));
diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
index 79fd40e3aa9..80500ad7d4e 100644
--- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
+++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
@@ -2964,6 +2964,15 @@
     <entry>
       <key>Steps</key>
     </entry>
+    <entry>
+      <key>CampaignStep</key>
+    </entry>
+    <entry>
+      <key>Added</key>
+    </entry>
+    <entry>
+      <key>Current participants</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
   <sqlModels>
diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
index 36435df4c6e..cf3c88bfb26 100644
--- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
+++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
@@ -3798,6 +3798,14 @@
     <entry>
       <key>protected</key>
     </entry>
+    <entry>
+      <key>Added</key>
+      <value>Hinzugefügt</value>
+    </entry>
+    <entry>
+      <key>Current participants</key>
+      <value>Aktuelle Teilenhmer</value>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
 </language>
diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
index 10a969da395..1372b43c6b7 100644
--- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
+++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
@@ -2995,6 +2995,15 @@
     <entry>
       <key>Steps</key>
     </entry>
+    <entry>
+      <key>CampaignStep</key>
+    </entry>
+    <entry>
+      <key>Added</key>
+    </entry>
+    <entry>
+      <key>Current participants</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
 </language>
diff --git a/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod b/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod
index 816f72e8f47..28d85596318 100644
--- a/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod
+++ b/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod
@@ -9,5 +9,9 @@
       <name>c4f11246-9c24-4c1c-8e53-96acabf04bab</name>
       <view>CampaignAddParticipantsEdit_view</view>
     </neonViewReference>
+    <neonViewReference>
+      <name>87d572bd-f2ce-4283-8db0-a7d9f9441fa0</name>
+      <view>campaignParticipantMessage_view</view>
+    </neonViewReference>
   </references>
 </neonContext>
diff --git a/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod b/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod
index fd5c2ec2f37..21e641b9fe9 100644
--- a/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod
+++ b/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod
@@ -4,9 +4,11 @@
   <majorModelMode>DISTRIBUTED</majorModelMode>
   <isSmall v="true" />
   <layout>
-    <boxLayout>
+    <headerFooterLayout>
       <name>layout</name>
-    </boxLayout>
+      <header>campaignDetail</header>
+      <footer>SelectedCampaignInfosScore</footer>
+    </headerFooterLayout>
   </layout>
   <children>
     <genericViewTemplate>
@@ -22,16 +24,21 @@
           <name>b9016725-1345-4526-88eb-2b05fb4089c8</name>
           <entityField>CAMPAIGNSTEP_ID</entityField>
         </entityFieldLink>
+      </fields>
+    </genericViewTemplate>
+    <scoreCardViewTemplate>
+      <name>SelectedCampaignInfosScore</name>
+      <entityField>#ENTITY</entityField>
+      <fields>
         <entityFieldLink>
-          <name>7ed79b46-ebb3-4a63-911b-ed7d4051af25</name>
-          <entityField>campaignParticipantMessage</entityField>
+          <name>5fb2164c-9433-480a-9d55-726a2b05a549</name>
+          <entityField>campaignStepCurrentParticipantCount</entityField>
+        </entityFieldLink>
+        <entityFieldLink>
+          <name>d0820091-352f-431f-8d7a-71cb5b576853</name>
+          <entityField>campaignStepMaxParticipantCount</entityField>
         </entityFieldLink>
       </fields>
-    </genericViewTemplate>
-    <neonViewReference>
-      <name>cbae33c2-7eec-47ab-810e-9ac59b1ec575</name>
-      <entityField>CampaignAnalyses</entityField>
-      <view>CampaignStepCurrentMaxParticipants_view</view>
-    </neonViewReference>
+    </scoreCardViewTemplate>
   </children>
 </neonView>
diff --git a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod
index 2146216bedd..cb62a6a0561 100644
--- a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod
+++ b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod
@@ -4,6 +4,7 @@
   <title></title>
   <description></description>
   <majorModelMode>DISTRIBUTED</majorModelMode>
+  <filterable v="false" />
   <layout>
     <boxLayout>
       <name>layout</name>
@@ -12,7 +13,8 @@
   <children>
     <tableViewTemplate>
       <name>ParticipantsTable</name>
-      <favoriteActionGroup2>FilterViewActionGroup</favoriteActionGroup2>
+      <favoriteActionGroup1>FilterViewActionGroup</favoriteActionGroup1>
+      <favoriteActionGroup2></favoriteActionGroup2>
       <entityField>#ENTITY</entityField>
       <columns>
         <neonTableColumn>
diff --git a/neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod b/neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod
new file mode 100644
index 00000000000..2ed214ff37c
--- /dev/null
+++ b/neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
+  <name>campaignParticipantMessage_view</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <layout>
+    <noneLayout>
+      <name>layout</name>
+    </noneLayout>
+  </layout>
+  <children>
+    <genericViewTemplate>
+      <name>Message_view</name>
+      <hideLabels v="true" />
+      <entityField>#ENTITY</entityField>
+      <fields>
+        <entityFieldLink>
+          <name>bc1db862-a448-47f6-b534-2ce28dc993a8</name>
+          <entityField>campaignParticipantMessage</entityField>
+        </entityFieldLink>
+      </fields>
+    </genericViewTemplate>
+  </children>
+</neonView>
diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js
index 56850c02747..40cdf86ca7f 100644
--- a/process/Campaign_lib/process.js
+++ b/process/Campaign_lib/process.js
@@ -70,6 +70,18 @@ CampaignUtils.getParticipantCountForStep = function(pCampaignStepId)
     return _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignStepId, defaultValue);
 }
 
+/**
+ * todo
+ */
+CampaignUtils.getMaxParticipantCountForStep = function(pCampaignStepId)
+{
+    let selectQuery = "select MAXPARTICIPANTS from CAMPAIGNSTEP";
+    let conditionField = "CAMPAIGNSTEP.CAMPAIGNSTEPID";
+    let defaultValue = 0;
+    
+    return _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignStepId, defaultValue);
+}
+
 /**
  * todo
  */
@@ -102,7 +114,7 @@ CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId
  */
 CampaignUtils.getParticipantLogInsertColumnNames = function()
 {
-    return new Array("CAMPAIGN_ID", "CAMPAIGNSTEP_ID", "CONTACT_ID", "CAMPAIGNPARTICIPANTLOGID", "USER_NEW", "DATE_NEW");
+    return new Array("CAMPAIGNPARTICIPANT_ID", "CAMPAIGN_ID", "CAMPAIGNSTEP_ID", "CAMPAIGNPARTICIPANTLOGID", "USER_NEW", "DATE_NEW");
 }
 
 /**
@@ -151,7 +163,7 @@ _CampaignUtils._openAddParticipantContext = function(pContext, pRowIds, pEntityP
     params["isUpdate_param"] = false;
     
     logging.log("pRowsIds" + pRowIds);
-    neon.openContext(pContext, pView, null, neon.OPERATINGSTATE_NEW, params);
+    neon.openContext(pContext, null, null, neon.OPERATINGSTATE_NEW, params);
 }
 
 /**
-- 
GitLab