Skip to content
Snippets Groups Projects
Commit fa5456a2 authored by Martin Groppe's avatar Martin Groppe
Browse files

merged 1075114_geplanter_versand into dev_xrm_marketing

parents 9f36dad7 c5e8e405
No related branches found
No related tags found
No related merge requests found
Showing
with 150 additions and 4 deletions
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="m.groppe" id="3a4158da-b715-49c7-9f53-850990382b2c">
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="a7d5d212-f99f-4200-8872-b24e7de2cc37"/>
<column name="KEYID" value="BULKMAILPLANNED"/>
<column name="TITLE" value="Planned"/>
<column name="CONTAINER" value="BulkMailStatus"/>
<column name="AB_KEYWORD_CATEGORY_ID" value="76fc02b9-a1b6-4c76-bdd5-a52d0e1ef286"/>
<column name="SORTING" valueNumeric="4"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="1"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="1f257472-bf37-4c66-972d-8bbb5ffcd883"/>
<column name="KEYID" value="BULKMAILMISSED"/>
<column name="TITLE" value="Missed"/>
<column name="CONTAINER" value="BulkMailStatus"/>
<column name="AB_KEYWORD_CATEGORY_ID" value="76fc02b9-a1b6-4c76-bdd5-a52d0e1ef286"/>
<column name="SORTING" valueNumeric="5"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="1"/>
</insert>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?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">
<changeSet author="m.groppe" id="96816f54-3067-470d-b698-dc7ad7685d84">
<addColumn tableName="BULKMAIL">
<column name="DATE_TO_SEND" type="DATETIME"/>
</addColumn>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="AlterBulkmail.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -5,4 +5,6 @@
<include relativeToChangelogFile="true" file="alter_CompetitionExpandReasonSize.xml"/>
<include relativeToChangelogFile="true" file="Checklists/changelog.xml"/>
<include relativeToChangelogFile="true" file="LinkManagement/changelog.xml"/>
<include relativeToChangelogFile="true" file="Event/changelog.xml"/>
<include relativeToChangelogFile="true" file="Bulkmail/changelog.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -10483,8 +10483,8 @@
<name>CREATEACTIVITIES</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="5" />
<size v="5" />
<columnType v="-6" />
<size v="3" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
......@@ -10525,8 +10525,22 @@
<name>USE_TEMPLATE_ATTACHMENTS</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="5" />
<size v="5" />
<columnType v="-6" />
<size v="3" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_TO_SEND</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
......
......@@ -323,6 +323,14 @@
<iconId>VAADIN:CURLY_BRACKETS</iconId>
<stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/openadminview/stateProcess.js</stateProcess>
</entityActionField>
<entityField>
<name>DATE_TO_SEND</name>
<title>Send Date</title>
<contentType>DATE</contentType>
<resolution>MINUTE</resolution>
<stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/date_to_send/stateProcess.js</stateProcess>
<onValidation>%aditoprj%/entity/BulkMail_entity/entityfields/date_to_send/onValidation.js</onValidation>
</entityField>
<entityConsumer>
<name>MailLogs</name>
<dependency>
......@@ -418,6 +426,10 @@
<name>USE_TEMPLATE_ATTACHMENTS.value</name>
<recordfield>BULKMAIL.USE_TEMPLATE_ATTACHMENTS</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_TO_SEND.value</name>
<recordfield>BULKMAIL.DATE_TO_SEND</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
......
import("system.result");
import("system.vars");
import("KeywordRegistry_basic");
if (vars.get("$field.STATUS") == $KeywordRegistry.bulkMailStatus$planned() && vars.get("$sys.date") > vars.get("local.value"))
result.string("Send date already passed.");
else result.string("");
\ No newline at end of file
import("system.result");
import("system.vars");
import("KeywordRegistry_basic");
import("system.neon");
var status = vars.get("$field.STATUS");
var fieldState = neon.COMPONENTSTATE_INVISIBLE;
if (status == $KeywordRegistry.bulkMailStatus$planned() ){
fieldState = neon.COMPONENTSTATE_EDITABLE
}
if (status == $KeywordRegistry.bulkMailStatus$missed()){
fieldState = neon.COMPONENTSTATE_READONLY;
}
result.string(fieldState);
\ No newline at end of file
......@@ -35,6 +35,10 @@
<name>28c1e091-0fea-4324-8fb8-1893388354b7</name>
<entityField>STATUS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>d588824d-1c21-483f-98eb-900f3e9722bd</name>
<entityField>DATE_TO_SEND</entityField>
</entityFieldLink>
<entityFieldLink>
<name>edbeea4d-019f-4661-b0d7-c07468e747cc</name>
<entityField>DOCUMENTTEMPLATE_ID</entityField>
......
......@@ -90,6 +90,11 @@
<name>geo.maptiler.apikey</name>
<description>An API Key for using Maptiler functions. For example for the MapViewTemplate.</description>
</customStringProperty>
<customIntegerProperty>
<name>bulkmail.dateToSendPassedAfter</name>
<description>Number of hours after which a planned Bulkmail no longer gets send</description>
<property v="24" />
</customIntegerProperty>
</customConfigProperties>
<customProperties>
<customBooleanProperty>
......
......@@ -225,6 +225,8 @@ $KeywordRegistry.bulkMailStatus = function(){return "BulkMailStatus";};
$KeywordRegistry.bulkMailStatus$notSent = function(){return "BULKMAILNOTSENT";};
$KeywordRegistry.bulkMailStatus$beingSent = function(){return "BULKMAILBEINGSENT";};
$KeywordRegistry.bulkMailStatus$sent = function(){return "BULKMAILSENT";};
$KeywordRegistry.bulkMailStatus$planned = function(){return "BULKMAILPLANNED";};
$KeywordRegistry.bulkMailStatus$missed = function(){return "BULKMAILMISSED";};
$KeywordRegistry.serialLetterStatus = function(){return "SerialLetterStatus";};
$KeywordRegistry.serialLetterStatus$notSent = function(){return "SERIALLETTERNOTSENT";};
......
......@@ -4,6 +4,7 @@
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/sendBulkMail_serverProcess/documentation.adoc</documentation>
<process>%aditoprj%/process/sendBulkMail_serverProcess/process.js</process>
<alias>Data_alias</alias>
<variants>
<element>EXECUTABLE</element>
<element>LIBRARY</element>
......
import("system.logging");
import("Bulkmail_lib");
import("system.project");
import("system.datetime");
import("Sql_lib");
import("KeywordRegistry_basic");
import("system.eMath");
import("system.SQLTYPES");
var dateToSendPassedAfter = project.getInstanceConfigValue("bulkmail.dateToSendPassedAfter" , 24);
//send all Bulkmails which are currently planned and not already missed.
var bulkMailData = newSelect("BULKMAIL.BULKMAILID")
.from("BULKMAIL")
.where("BULKMAIL.STATUS",$KeywordRegistry.bulkMailStatus$planned())
.and("BULKMAIL.DATE_TO_SEND", datetime.date(), SqlBuilder.LESS_OR_EQUAL())
.and("BULKMAIL.DATE_TO_SEND",eMath.subInt(datetime.date(), eMath.mulInt(dateToSendPassedAfter, datetime.ONE_HOUR)), SqlBuilder.GREATER())
.arrayColumn();
logging.log(JSON.stringify(bulkMailData));
for (let i = 0; i < bulkMailData.length; i++){
newWhere("BULKMAIL.BULKMAILID", bulkMailData[i])
.updateFields({"STATUS" : $KeywordRegistry.bulkMailStatus$beingSent()});
BulkMailUtils.sendBulkMailOnServer(bulkMailData[i],null,null);
}
//set all missed bulkmails to status missed
newWhere("BULKMAIL.STATUS",$KeywordRegistry.bulkMailStatus$planned())
.and("BULKMAIL.DATE_TO_SEND",eMath.subInt(datetime.date(), eMath.mulInt(dateToSendPassedAfter, datetime.ONE_HOUR)), SqlBuilder.LESS_OR_EQUAL())
.updateFields({"STATUS" : $KeywordRegistry.bulkMailStatus$missed()});
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.2">
<name>sendPlannedBulkmails_serverProcess</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/sendPlannedBulkmails_serverProcess/process.js</process>
<alias>Data_alias</alias>
<variants>
<element>EXECUTABLE</element>
</variants>
</process>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment