From 2c66b3a1ff758b4474c88a2683a4a262b31f5b59 Mon Sep 17 00:00:00 2001
From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local>
Date: Thu, 8 Aug 2019 19:54:50 +0200
Subject: [PATCH] Task preset editor

---
 entity/Task_entity/Task_entity.aod            |  1 +
 .../editor_contact_id/valueProcess.js         |  7 ++
 .../requestor_contact_id/valueProcess.js      | 12 +--
 .../_____LANGUAGE_EXTRA.aod                   |  7 +-
 .../_____LANGUAGE_en/_____LANGUAGE_en.aod     |  3 +
 .../AppointmentFilter_view.aod                | 76 +++++++++----------
 6 files changed, 61 insertions(+), 45 deletions(-)
 create mode 100644 entity/Task_entity/entityfields/editor_contact_id/valueProcess.js

diff --git a/entity/Task_entity/Task_entity.aod b/entity/Task_entity/Task_entity.aod
index 2bcb31acca6..701cceee372 100644
--- a/entity/Task_entity/Task_entity.aod
+++ b/entity/Task_entity/Task_entity.aod
@@ -55,6 +55,7 @@
       <consumer>ContactEditors</consumer>
       <linkedContext>Person</linkedContext>
       <mandatory v="true" />
+      <valueProcess>%aditoprj%/entity/Task_entity/entityfields/editor_contact_id/valueProcess.js</valueProcess>
       <displayValueProcess>%aditoprj%/entity/Task_entity/entityfields/editor_contact_id/displayValueProcess.js</displayValueProcess>
     </entityField>
     <entityField>
diff --git a/entity/Task_entity/entityfields/editor_contact_id/valueProcess.js b/entity/Task_entity/entityfields/editor_contact_id/valueProcess.js
new file mode 100644
index 00000000000..4cc8f2bb8a1
--- /dev/null
+++ b/entity/Task_entity/entityfields/editor_contact_id/valueProcess.js
@@ -0,0 +1,7 @@
+import("system.result");
+import("system.neon");
+import("system.vars");
+import("Employee_lib");
+
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
+    result.string(EmployeeUtils.getCurrentContactId());
\ No newline at end of file
diff --git a/entity/Task_entity/entityfields/requestor_contact_id/valueProcess.js b/entity/Task_entity/entityfields/requestor_contact_id/valueProcess.js
index 1e62e7551cc..4cc8f2bb8a1 100644
--- a/entity/Task_entity/entityfields/requestor_contact_id/valueProcess.js
+++ b/entity/Task_entity/entityfields/requestor_contact_id/valueProcess.js
@@ -1,7 +1,7 @@
-import("system.result");
-import("system.neon");
-import("system.vars");
-import("Employee_lib");
-
-if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
+import("system.result");
+import("system.neon");
+import("system.vars");
+import("Employee_lib");
+
+if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
     result.string(EmployeeUtils.getCurrentContactId());
\ No newline at end of file
diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
index af4e16b2b95..72ae23aad87 100644
--- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
+++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
@@ -4893,6 +4893,9 @@
     <entry>
       <key>Download template</key>
     </entry>
+    <entry>
+      <key>Theme</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
   <sqlModels>
@@ -4914,7 +4917,9 @@ select SCORETYPE from CLASSIFICATIONTYPE
 union
 select distinct CLASSIFICATIONGROUP from CLASSIFICATIONTYPE
 union
-select AB_ATTRIBUTE.ATTRIBUTE_NAME from AB_ATTRIBUTE</element>
+select AB_ATTRIBUTE.ATTRIBUTE_NAME from AB_ATTRIBUTE
+union
+select AB_KEYWORD_ATTRIBUTE.NAME from AB_KEYWORD_ATTRIBUTE</element>
       </statements>
     </languageSql>
   </sqlModels>
diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
index 14013a81b4c..c40d64c9586 100644
--- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
+++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
@@ -4943,6 +4943,9 @@
     <entry>
       <key>Download template</key>
     </entry>
+    <entry>
+      <key>Theme</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
 </language>
diff --git a/neonView/AppointmentFilter_view/AppointmentFilter_view.aod b/neonView/AppointmentFilter_view/AppointmentFilter_view.aod
index 5556dfaab05..25b8a93be92 100644
--- a/neonView/AppointmentFilter_view/AppointmentFilter_view.aod
+++ b/neonView/AppointmentFilter_view/AppointmentFilter_view.aod
@@ -1,38 +1,38 @@
-<?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.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2">
-  <name>AppointmentFilter_view</name>
-  <title>Linked Appointments</title>
-  <majorModelMode>DISTRIBUTED</majorModelMode>
-  <filterable v="false" />
-  <layout>
-    <drawerLayout>
-      <name>layout</name>
-      <layoutCaption>Linked Appointments</layoutCaption>
-    </drawerLayout>
-  </layout>
-  <children>
-    <tableViewTemplate>
-      <name>Table</name>
-      <hideActions v="true" />
-      <entityField>#ENTITY</entityField>
-      <columns>
-        <neonTableColumn>
-          <name>dfc5cdb0-6ff6-4089-b0e7-6ebcab5061e6</name>
-          <entityField>SUMMARY</entityField>
-        </neonTableColumn>
-        <neonTableColumn>
-          <name>65d462d0-e685-4493-bb73-c32c7ffe393b</name>
-          <entityField>BEGIN</entityField>
-        </neonTableColumn>
-        <neonTableColumn>
-          <name>ba6f5f7a-7ae4-41cb-940b-c115561c0a71</name>
-          <entityField>END</entityField>
-        </neonTableColumn>
-        <neonTableColumn>
-          <name>0a591a05-1efe-4e33-9a59-363a5e423802</name>
-          <entityField>LOCATION</entityField>
-        </neonTableColumn>
-      </columns>
-    </tableViewTemplate>
-  </children>
-</neonView>
+<?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.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2">
+  <name>AppointmentFilter_view</name>
+  <title>Linked Appointments</title>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <filterable v="false" />
+  <layout>
+    <drawerLayout>
+      <name>layout</name>
+      <layoutCaption>Linked Appointments</layoutCaption>
+    </drawerLayout>
+  </layout>
+  <children>
+    <tableViewTemplate>
+      <name>Table</name>
+      <hideActions v="true" />
+      <entityField>#ENTITY</entityField>
+      <columns>
+        <neonTableColumn>
+          <name>dfc5cdb0-6ff6-4089-b0e7-6ebcab5061e6</name>
+          <entityField>SUMMARY</entityField>
+        </neonTableColumn>
+        <neonTableColumn>
+          <name>65d462d0-e685-4493-bb73-c32c7ffe393b</name>
+          <entityField>BEGIN</entityField>
+        </neonTableColumn>
+        <neonTableColumn>
+          <name>ba6f5f7a-7ae4-41cb-940b-c115561c0a71</name>
+          <entityField>END</entityField>
+        </neonTableColumn>
+        <neonTableColumn>
+          <name>0a591a05-1efe-4e33-9a59-363a5e423802</name>
+          <entityField>LOCATION</entityField>
+        </neonTableColumn>
+      </columns>
+    </tableViewTemplate>
+  </children>
+</neonView>
-- 
GitLab