From 84abe1205027a0a9461cb06db9db7cc0dadd2190 Mon Sep 17 00:00:00 2001
From: Martin Groppe <m.groppe@adito.de>
Date: Fri, 30 Apr 2021 11:33:24 +0000
Subject: [PATCH] 1079751 optimierung serienmail

---
 entity/BulkMail_entity/BulkMail_entity.aod       |  1 +
 .../bulkmailtestrecipients/stateProcess.js       |  7 +++++++
 .../createactivities/valueProcess.js             |  2 +-
 .../entityfields/url/stateProcess.js             |  3 ++-
 neonView/BulkMailMain_view/BulkMailMain_view.aod | 16 ++++++++--------
 5 files changed, 19 insertions(+), 10 deletions(-)
 create mode 100644 entity/BulkMail_entity/entityfields/bulkmailtestrecipients/stateProcess.js

diff --git a/entity/BulkMail_entity/BulkMail_entity.aod b/entity/BulkMail_entity/BulkMail_entity.aod
index ea3b4e8985..c7e6b94645 100644
--- a/entity/BulkMail_entity/BulkMail_entity.aod
+++ b/entity/BulkMail_entity/BulkMail_entity.aod
@@ -352,6 +352,7 @@
     </entityConsumer>
     <entityConsumer>
       <name>BulkMailTestRecipients</name>
+      <stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/bulkmailtestrecipients/stateProcess.js</stateProcess>
       <dependency>
         <name>dependency</name>
         <entityName>BulkMailTestRecipient_entity</entityName>
diff --git a/entity/BulkMail_entity/entityfields/bulkmailtestrecipients/stateProcess.js b/entity/BulkMail_entity/entityfields/bulkmailtestrecipients/stateProcess.js
new file mode 100644
index 0000000000..0e2b38fa2a
--- /dev/null
+++ b/entity/BulkMail_entity/entityfields/bulkmailtestrecipients/stateProcess.js
@@ -0,0 +1,7 @@
+import("system.vars");
+import("Bulkmail_lib");
+import("system.result");
+import("system.neon");
+
+if (BulkMailUtils.isStatusSendingOrSent(vars.get("$field.STATUS")))
+    result.string(neon.COMPONENTSTATE_READONLY);
\ No newline at end of file
diff --git a/entity/BulkMail_entity/entityfields/createactivities/valueProcess.js b/entity/BulkMail_entity/entityfields/createactivities/valueProcess.js
index 72e22f0a52..a4bf6a6692 100644
--- a/entity/BulkMail_entity/entityfields/createactivities/valueProcess.js
+++ b/entity/BulkMail_entity/entityfields/createactivities/valueProcess.js
@@ -3,4 +3,4 @@ import("system.vars");
 import("system.result");
 
 if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
-    result.string("1");
\ No newline at end of file
+    result.string("0");
\ No newline at end of file
diff --git a/entity/Weblink_entity/entityfields/url/stateProcess.js b/entity/Weblink_entity/entityfields/url/stateProcess.js
index bf56cc956c..d20b8d2ca5 100644
--- a/entity/Weblink_entity/entityfields/url/stateProcess.js
+++ b/entity/Weblink_entity/entityfields/url/stateProcess.js
@@ -1,8 +1,9 @@
 import("system.neon");
 import("system.result");
 import("system.vars");
+import("KeywordRegistry_basic");
 
-if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW)
+if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW || vars.get("$field.LINKTYPE") == $KeywordRegistry.weblinkType$EMail())
     result.string(neon.COMPONENTSTATE_EDITABLE)
 else
     result.string(neon.COMPONENTSTATE_READONLY)
\ No newline at end of file
diff --git a/neonView/BulkMailMain_view/BulkMailMain_view.aod b/neonView/BulkMailMain_view/BulkMailMain_view.aod
index 82edef3461..dfe012e304 100644
--- a/neonView/BulkMailMain_view/BulkMailMain_view.aod
+++ b/neonView/BulkMailMain_view/BulkMailMain_view.aod
@@ -9,15 +9,20 @@
     </masterSlaveLayout>
   </layout>
   <children>
+    <neonViewReference>
+      <name>3222ace8-c6d6-4dab-ada1-1f50b983e7e7</name>
+      <entityField>#ENTITY</entityField>
+      <view>BulkMailContent_view</view>
+    </neonViewReference>
     <neonViewReference>
       <name>8be4ed02-1c54-41d0-9bba-3b785346a550</name>
       <entityField>Recipients</entityField>
       <view>BulkMailRecipientFilter_view</view>
     </neonViewReference>
     <neonViewReference>
-      <name>3222ace8-c6d6-4dab-ada1-1f50b983e7e7</name>
-      <entityField>#ENTITY</entityField>
-      <view>BulkMailContent_view</view>
+      <name>f78d044a-6246-49c0-a72c-03f54fc90fd2</name>
+      <entityField>BulkMailTestRecipients</entityField>
+      <view>BulkMailTestRecipientFilter_view</view>
     </neonViewReference>
     <neonViewReference>
       <name>9e1e1137-f0a8-45d5-8b91-6e36411be6f1</name>
@@ -29,11 +34,6 @@
       <entityField>MailLogs</entityField>
       <view>MailLogFilter_view</view>
     </neonViewReference>
-    <neonViewReference>
-      <name>f78d044a-6246-49c0-a72c-03f54fc90fd2</name>
-      <entityField>BulkMailTestRecipients</entityField>
-      <view>BulkMailTestRecipientFilter_view</view>
-    </neonViewReference>
     <neonViewReference>
       <name>bd3876a9-492e-4e2e-bcca-e86455475dca</name>
       <entityField>Clicks</entityField>
-- 
GitLab