Skip to content
Snippets Groups Projects
Commit 26f69235 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

merged origin/1075052_blacklisting into dev_xrm_marketing

parents b529fb03 8e92d47a
No related branches found
No related tags found
No related merge requests found
Showing
with 484 additions and 18 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">
<include relativeToChangelogFile="true" file="create_communicationBlacklist.xml"/>
<include relativeToChangelogFile="true" file="insert_blacklistTypeKeyword.xml"/>
</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">
<changeSet author="s.listl" id="9415eb4f-ea93-433c-8a69-1bdb77c6ec87">
<createTable tableName="COMMUNICATIONBLACKLIST">
<column name="COMMUNICATIONBLACKLISTID" type="CHAR(36)">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_COMMUNICATIONBLACKLISTID"/>
</column>
<column name="BLACKLIST_TYPE" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
<column name="BLACKLIST_FILTER" type="NCLOB"/>
<column name="REASON" type="NVARCHAR(500)"/>
<column name="START_DATE" type="DATETIME"/>
<column name="END_DATE" type="DATETIME"/>
<column name="DATE_NEW" type="DATETIME">
<constraints nullable="false"/>
</column>
<column name="USER_NEW" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
<column name="DATE_EDIT" type="DATETIME"/>
<column name="USER_EDIT" type="VARCHAR(50)"/>
</createTable>
</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">
<changeSet author="s.listl" id="89ba3828-288c-4af7-bf98-feccc01ce312">
<insert tableName="AB_KEYWORD_CATEGORY">
<column name="AB_KEYWORD_CATEGORYID" value="e980999c-0f8e-484b-852b-92d60c38c14f"/>
<column name="NAME" value="CommunicationBlacklistType"/>
<column name="SORTINGBY" valueNumeric="0"/>
<column name="SORTINGDIRECTION" value="ASC"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="a1c8d2c6-54c7-4e9d-9792-dd576ac6f43e"/>
<column name="AB_KEYWORD_CATEGORY_ID" value="e980999c-0f8e-484b-852b-92d60c38c14f"/>
<column name="KEYID" value="BLACKLIST_TYPE_EMAILRECIPIENT_FILTER"/>
<column name="TITLE" value="Recipient filter"/>
<column name="CONTAINER" value="CommunicationBlacklistType"/>
<column name="SORTING" valueNumeric="1"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="0"/>
</insert>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -7,4 +7,5 @@
<include relativeToChangelogFile="true" file="CommunicationSettings/changelog.xml"/>
<include relativeToChangelogFile="true" file="change_SalesprojectMemberRole.xml"/>
<include relativeToChangelogFile="true" file="Interest/changelog.xml"/>
<include relativeToChangelogFile="true" file="CommunicationBlacklist/changelog.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -19729,6 +19729,166 @@
</entityFieldDb>
</entityFields>
</entityDb>
<entityDb>
<name>COMMUNICATIONBLACKLIST</name>
<dbName></dbName>
<idColumn>COMMUNICATIONBLACKLISTID</idColumn>
<idGeneratorType v="0" />
<idGeneratorInterval v="1" />
<documentation></documentation>
<title></title>
<description></description>
<auditSyncConfig>
<name>auditSyncConfig</name>
<auditMode v="0" />
<syncActive v="false" />
<syncComplete v="true" />
<syncDirection v="1" />
<syncIds></syncIds>
</auditSyncConfig>
<entityFields>
<entityFieldDb>
<name>BLACKLIST_FILTER</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="-1" />
<size v="2147483647" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_EDIT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>END_DATE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>START_DATE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_NEW</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>USER_NEW</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="50" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>COMMUNICATIONBLACKLISTID</name>
<dbName></dbName>
<primaryKey v="true" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="true" />
<index v="true" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>REASON</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="500" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>USER_EDIT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="50" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>BLACKLIST_TYPE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<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>
</entityGroup>
</aliasDefDb>
......
......@@ -200,6 +200,10 @@
<name>Interest</name>
<kind v="10077" />
</entityNode>
<entityNode>
<name>CommunicationBlacklist</name>
<kind v="10077" />
</entityNode>
</childNodes>
</entityNode>
<entityNode>
......
......@@ -82,7 +82,6 @@
<entityField>
<name>EMAIL_ADDRESS</name>
<title>Email</title>
<consumer>EmailAdresses</consumer>
<textInputAllowed v="true" />
<valueProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/email_address/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/email_address/displayValueProcess.js</displayValueProcess>
......@@ -108,7 +107,7 @@
<state>READONLY</state>
</entityField>
<entityField>
<name>HASCOMMRESTRICTION</name>
<name>HASCOMMUNICATIONREJECTION</name>
<title>Advertising ban</title>
</entityField>
<entityActionGroup>
......@@ -176,6 +175,36 @@
</entityActionField>
</children>
</entityActionGroup>
<entityParameter>
<name>ExcludeCommunicationRejecting_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>ExcludedStatus_param</name>
<expose v="true" />
</entityParameter>
<entityProvider>
<name>RecipientsToBeMailed</name>
<children>
<entityParameter>
<name>ExcludedStatus_param</name>
<valueProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/recipientstobemailed/children/excludedstatus_param/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
<entityParameter>
<name>ExcludeCommunicationRejecting_param</name>
<valueProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/recipientstobemailed/children/excludecommunicationrejecting_param/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>IsTestMail_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>ExcludeBlacklisted_param</name>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -232,13 +261,10 @@
<name>CONTACT_ID.displayValue</name>
<expression>%aditoprj%/entity/BulkMailRecipient_entity/recordcontainers/db/recordfieldmappings/contact_id.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>HASCOMMRESTRICTION.value</name>
<expression>%aditoprj%/entity/BulkMailRecipient_entity/recordcontainers/db/recordfieldmappings/hascommrestriction.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>EMAIL_ADDRESS.value</name>
<recordfield>BULKMAILRECIPIENT.EMAIL_ADDRESS</recordfield>
<isFilterable v="true" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PROBLEM.value</name>
......@@ -252,6 +278,10 @@
<name>TEST_RECIPIENT.value</name>
<recordfield>BULKMAILRECIPIENT.TEST_RECIPIENT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>HASCOMMUNICATIONREJECTION.value</name>
<expression>%aditoprj%/entity/BulkMailRecipient_entity/recordcontainers/db/recordfieldmappings/hascommunicationrejection.value/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
......
......@@ -2,5 +2,5 @@ import("system.vars");
import("system.result");
import("system.neon");
if (vars.get("$field.HASCOMMRESTRICTION") == "true" || !vars.get("$field.EMAIL_ADDRESS"))
if (vars.get("$field.HASCOMMUNICATIONREJECTION") == "true" || !vars.get("$field.EMAIL_ADDRESS"))
result.string(neon.PRIORITY_HIGH_COLOR);
\ No newline at end of file
......@@ -4,7 +4,7 @@ import("Contact_lib");
var type = ContactUtils.getContactTypeByPersOrg(vars.get("$field.PERSON_ID"), vars.get("$field.ORGANISATION_ID"));
var icon;
if (vars.get("$field.HASCOMMRESTRICTION") == "true")
if (vars.get("$field.HASCOMMUNICATIONREJECTION") == "true")
icon = "VAADIN:BAN";
else if (type == 1)
icon = "VAADIN:BUILDING";
......
import("system.result");
result.string(true);
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.result");
result.string(JSON.stringify([
$KeywordRegistry.bulkMailRecipientStatus$sent()
]));
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.vars");
import("Util_lib");
import("system.db");
import("system.result");
import("Sql_lib");
import("MarketingCondition_lib");
result.string(newWhere("BULKMAILRECIPIENT.BULKMAIL_ID", "$param.BulkMailId_param").toString());
\ No newline at end of file
var excludeWithCommunicationRejection = Utils.toBoolean(vars.get("$param.ExcludeCommunicationRejecting_param"));
var excludeBlacklisted = Utils.toBoolean(vars.get("$param.ExcludeBlacklisted_param"));
var excludedStatus = Utils.parseJSON(vars.get("$param.ExcludedStatus_param"));
var isTestMail = Utils.toBoolean(vars.get("$param.IsTestMail_param"));
var condition = newWhere("BULKMAILRECIPIENT.BULKMAIL_ID", "$param.BulkMailId_param");
if (isTestMail)
{
condition.and("BULKMAILRECIPIENT.TEST_RECIPIENT", 1);
}
else
{
if (excludeWithCommunicationRejection)
{
condition.and(new CommunicationSettingsCondition()
.medium($KeywordRegistry.communicationMediumCampaign$mail(), "BULKMAILRECIPIENT.EMAIL_ADDRESS")
.rejected()
.buildNotExistsCondition());
}
if (excludeBlacklisted)
{
condition.and("not (" + CommunicationBlacklist.getMailRecipientBlacklist().buildCondition() + ")");
}
if (!Utils.isNullOrEmpty(excludedStatus))
{
condition.and("BULKMAILRECIPIENT.STATUS", excludedStatus, SqlBuilder.NOT_IN());
}
}
result.string(condition.toSource());
\ No newline at end of file
import("Sql_lib");
import("KeywordRegistry_basic");
import("Contact_lib");
import("system.db");
import("system.result");
var commRestrictionCond = ContactUtils.getCommRestrictionCondition($KeywordRegistry.communicationMediumCampaign$mail());
var sql = SqlBuilder.caseWhen(commRestrictionCond).thenString("true").elseString("false");
result.string(sql.toString());
import("system.vars");
import("Util_lib");
import("MarketingCondition_lib");
import("Sql_lib");
import("KeywordRegistry_basic");
import("Contact_lib");
import("system.db");
import("system.result");
var sql;
//if recipients with communication restriction are excluded by the where-condition, this can never be true
if (Utils.toBoolean(vars.get("$param.ExcludeCommunicationRejecting_param")))
{
sql = "'false'";
}
else
{
var communicationSettingsCondition = new CommunicationSettingsCondition()
.medium($KeywordRegistry.communicationMediumCampaign$mail(), "BULKMAILRECIPIENT.EMAIL_ADDRESS")
.rejected()
.buildNotExistsCondition();
sql = SqlBuilder.caseWhen(communicationSettingsCondition).thenString("true").elseString("false").toString();
}
result.string(sql);
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.18" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.18">
<name>CommunicationBlacklist_entity</name>
<title>Blacklist</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<onValidation>%aditoprj%/entity/CommunicationBlacklist_entity/onValidation.js</onValidation>
<iconId>VAADIN:BAN</iconId>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityField>
<name>COMMUNICATIONBLACKLISTID</name>
</entityField>
<entityField>
<name>START_DATE</name>
<title>Start date</title>
<contentType>DATE</contentType>
<resolution>DAY</resolution>
</entityField>
<entityField>
<name>END_DATE</name>
<title>End date</title>
<contentType>DATE</contentType>
<resolution>DAY</resolution>
</entityField>
<entityField>
<name>BLACKLIST_FILTER</name>
<title>Condition</title>
<contentType>FILTER_TREE</contentType>
<stateProcess>%aditoprj%/entity/CommunicationBlacklist_entity/entityfields/blacklist_filter/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/CommunicationBlacklist_entity/entityfields/blacklist_filter/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>REASON</name>
<title>Reason</title>
<contentType>LONG_TEXT</contentType>
<mandatory v="true" />
</entityField>
<entityField>
<name>BLACKLIST_TYPE</name>
<title>Type</title>
<consumer>BlacklistTypeKeyword</consumer>
<mandatory v="true" />
</entityField>
<entityConsumer>
<name>BlacklistTypeKeyword</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/CommunicationBlacklist_entity/entityfields/blacklisttypekeyword/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>BLACKLIST_FILTER.value</name>
<recordfield>COMMUNICATIONBLACKLIST.BLACKLIST_FILTER</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>BLACKLIST_TYPE.value</name>
<recordfield>COMMUNICATIONBLACKLIST.BLACKLIST_TYPE</recordfield>
<isFilterable v="true" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>COMMUNICATIONBLACKLISTID.value</name>
<recordfield>COMMUNICATIONBLACKLIST.COMMUNICATIONBLACKLISTID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>END_DATE.value</name>
<recordfield>COMMUNICATIONBLACKLIST.END_DATE</recordfield>
<isFilterable v="true" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>REASON.value</name>
<recordfield>COMMUNICATIONBLACKLIST.REASON</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>START_DATE.value</name>
<recordfield>COMMUNICATIONBLACKLIST.START_DATE</recordfield>
<isFilterable v="true" />
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
<name>007ad42a-0a7a-49a9-a71d-917ee3c94aa7</name>
<tableName>COMMUNICATIONBLACKLIST</tableName>
<primaryKey>COMMUNICATIONBLACKLISTID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
</dbRecordContainer>
</recordContainers>
</entity>
import("system.result");
import("KeywordRegistry_basic");
import("system.vars");
import("system.neon");
var state = neon.COMPONENTSTATE_INVISIBLE;
if (vars.get("$field.BLACKLIST_TYPE") == $KeywordRegistry.communicationBlacklistType$emailRecipientFilter())
{
state = neon.COMPONENTSTATE_EDITABLE;
}
result.string(state);
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
if (!vars.get("$this.value") && (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT))
{
var emptyFilter = {entity: "BulkMailRecipient_entity", filter: {type: "group", operator: "AND", childs: []}};
result.string(JSON.stringify(emptyFilter));
}
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.result");
result.string($KeywordRegistry.communicationBlacklistType());
\ No newline at end of file
import("system.translate");
import("Util_lib");
import("system.result");
import("KeywordRegistry_basic");
import("system.vars");
import("system.neon");
import("JditoFilter_lib");
if (vars.get("$field.BLACKLIST_TYPE") == $KeywordRegistry.communicationBlacklistType$emailRecipientFilter())
{
var filter = Utils.parseJSON(vars.get("$field.BLACKLIST_FILTER"));
filter = new FilterConditionGroup(filter);
if (filter.isEmpty())
result.string(translate.text("Filter can't be empty"));
}
\ No newline at end of file
......@@ -684,6 +684,12 @@
<fieldName>StatusKeyword</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>a4d04777-82dc-4384-a4a5-c6a4a71e7a65</name>
<entityName>CommunicationBlacklist_entity</entityName>
<fieldName>BlacklistTypeKeyword</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......
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