From 38ed5ab50c843f39a7862347017d43efb5d7efed Mon Sep 17 00:00:00 2001
From: Sebastian Pongratz <s.pongratz@adito.de>
Date: Tue, 11 May 2021 07:43:08 +0000
Subject: [PATCH] =?UTF-8?q?[Projekt:=20xRM-ContactManagement][TicketNr.:?=
 =?UTF-8?q?=201080009][Status=20"F=C3=BCr=20L=C3=B6schung=20vorgesehen"=20?=
 =?UTF-8?q?bleibt=20bestehen,=20so=20lange=20ein=20L=C3=B6schkennzeichen?=
 =?UTF-8?q?=20vorhanden=20ist.]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../basic/mailbridge/mailbridgeUser.xml       | 75 +++++++++++++++++++
 .liquibase/_____SYSTEMALIAS/changelog.xml     |  1 +
 .../Organisation_entity.aod                   |  2 +-
 .../QuickEntry_entity/QuickEntry_entity.aod   |  2 +-
 process/Email_lib/process.js                  |  2 +-
 5 files changed, 79 insertions(+), 3 deletions(-)
 create mode 100644 .liquibase/_____SYSTEMALIAS/basic/mailbridge/mailbridgeUser.xml

diff --git a/.liquibase/_____SYSTEMALIAS/basic/mailbridge/mailbridgeUser.xml b/.liquibase/_____SYSTEMALIAS/basic/mailbridge/mailbridgeUser.xml
new file mode 100644
index 00000000000..a247f5de218
--- /dev/null
+++ b/.liquibase/_____SYSTEMALIAS/basic/mailbridge/mailbridgeUser.xml
@@ -0,0 +1,75 @@
+<?xml version="1.1" encoding="UTF-8" standalone="no"?>
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
+    <changeSet author="s.pongratz" id="b8ccd980-c120-4938-99bc-deb728c6b6c3">
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="1e1771ef-4435-4b02-9e58-026d07eb3dcd"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:03:38.877"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:09:41.313"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="BASIC"/>
+            <column name="PROPKEY" value="lastModified"/>
+            <column name="PROPVAL" value="1619780981313"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="25c3d371-8c2e-4f13-b315-9be499ca3e65"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:03:38.877"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:03:38.877"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="BASIC"/>
+            <column name="PROPKEY" value="name"/>
+            <column name="PROPVAL" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="b8d4548a-9528-4db9-a122-429b1df4968e"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:03:38.877"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:09:34.112"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="BASIC"/>
+            <column name="PROPKEY" value="title"/>
+            <column name="PROPVAL" value="mailbridge"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="f634e205-4130-4e9e-8736-28fe41959de6"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:09:21.362"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:09:21.362"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="BASIC"/>
+            <column name="PROPKEY" value="email"/>
+            <column name="PROPVAL" value="mailbridge@domain.local"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="33cc359d-6d02-454b-8fe3-15ef692a37a1"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:09:21.369"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:09:21.369"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="BASIC"/>
+            <column name="PROPKEY" value="isActive"/>
+            <column name="PROPVAL" value="true"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="0a9f5363-2d0e-4591-95bd-62beeb952925"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:09:41.315"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:09:41.315"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="ROLE"/>
+            <column name="PROPKEY" value="roleNames"/>
+            <column name="PROPVAL" value="INTERNAL_TECHNICAL"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+        <insert tableName="ASYS_USERS">
+            <column name="ID" value="e65c5d62-bfb7-4b67-b7cc-65fe06fb7c81"/>
+            <column name="DATE_NEW" valueDate="2021-04-30T13:09:11.757"/>
+            <column name="DATE_EDIT" valueDate="2021-04-30T13:09:11.757"/>
+            <column name="NAME" value="_____USER_b9baa774-7239-4844-88f4-cddb2cdb3257"/>
+            <column name="GROUPID" value="BASIC"/>
+            <column name="PROPKEY" value="calendarID"/>
+            <column name="PROPVAL" value="mailbridge@domain.local"/>
+            <column name="PROPVAL_CLOB"/>
+        </insert>
+    </changeSet>
+</databaseChangeLog>
\ No newline at end of file
diff --git a/.liquibase/_____SYSTEMALIAS/changelog.xml b/.liquibase/_____SYSTEMALIAS/changelog.xml
index 0cff9f38ee8..b7d047b86d8 100644
--- a/.liquibase/_____SYSTEMALIAS/changelog.xml
+++ b/.liquibase/_____SYSTEMALIAS/changelog.xml
@@ -1,6 +1,7 @@
 <?xml version="1.1" encoding="UTF-8" standalone="no"?>
 <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
     <include relativeToChangelogFile="true" file="basic/init/init.xml"/>
+    <include relativeToChangelogFile="true" file="basic/mailbridge/mailbridgeUser.xml"/>
 
     <include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>
     
diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod
index d851c8dec53..b934a8ff164 100644
--- a/entity/Organisation_entity/Organisation_entity.aod
+++ b/entity/Organisation_entity/Organisation_entity.aod
@@ -51,7 +51,7 @@
     <entityField>
       <name>NAME</name>
       <title>Name</title>
-      <contentType>LONG_TEXT</contentType>
+      <contentType>TEXT</contentType>
       <mandatory v="true" />
     </entityField>
     <entityField>
diff --git a/entity/QuickEntry_entity/QuickEntry_entity.aod b/entity/QuickEntry_entity/QuickEntry_entity.aod
index 943a7dd66a1..e91984345d5 100644
--- a/entity/QuickEntry_entity/QuickEntry_entity.aod
+++ b/entity/QuickEntry_entity/QuickEntry_entity.aod
@@ -17,7 +17,7 @@
     <entityField>
       <name>ORGANISATION_NAME</name>
       <title>Company</title>
-      <contentType>LONG_TEXT</contentType>
+      <contentType>TEXT</contentType>
       <mandatoryProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/organisation_name/mandatoryProcess.js</mandatoryProcess>
     </entityField>
     <entityConsumer>
diff --git a/process/Email_lib/process.js b/process/Email_lib/process.js
index 93e6008b16e..1c2acdb21f9 100644
--- a/process/Email_lib/process.js
+++ b/process/Email_lib/process.js
@@ -117,7 +117,7 @@ EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComing
 
 EmailWritingUtils.getMailbridgeAddress = function ()
 {
-    return "mailbridge@domain.local"; //TODO: not hardcoded
+    return tools.getUser("mailbridge", tools.PROFILE_DEFAULT)[tools.PARAMS][tools.EMAIL];
 }
 
 /**
-- 
GitLab