diff --git a/entity/CommRestriction_Entity/CommRestriction_Entity.aod b/entity/CommRestriction_Entity/CommRestriction_Entity.aod index b1604aa94b0cfb68fd202ff113e3586b76268cfa..c685eb6e0ca3b9b24ddb01a5f44edd9bc6ba3389 100644 --- a/entity/CommRestriction_Entity/CommRestriction_Entity.aod +++ b/entity/CommRestriction_Entity/CommRestriction_Entity.aod @@ -5,7 +5,6 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/CommRestriction_Entity/documentation.adoc</documentation> <contentTitleProcess>%aditoprj%/entity/CommRestriction_Entity/contentTitleProcess.js</contentTitleProcess> - <contentTitleProcess>%aditoprj%/entity/CommRestriction_Entity/contentTitleProcess.js</contentTitleProcess> <titlePlural>Advertising bans</titlePlural> <recordContainer>db</recordContainer> <entityFields> @@ -77,20 +76,6 @@ <entityProvider> <name>CommRestrictions</name> <documentation>%aditoprj%/entity/CommRestriction_Entity/entityfields/commrestrictions/documentation.adoc</documentation> - <dependencies> - <entityDependency> - <name>b50e33cd-e20f-4bdf-b0ee-2ecdab921ffd</name> - <entityName>Person_entity</entityName> - <fieldName>CommRestrictions</fieldName> - <isConsumer v="false" /> - </entityDependency> - <entityDependency> - <name>1108f15c-75e3-49a8-b1cd-03259bfbb8a0</name> - <entityName>Organisation_entity</entityName> - <fieldName>CommRestrictions</fieldName> - <isConsumer v="false" /> - </entityDependency> - </dependencies> </entityProvider> <entityParameter> <name>ContactId_param</name> diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index cf70abb5c6d02d2571374317250eb8e06b65d0ed..00cb66a88c220143ce86afe6bad350d0aba49dae 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -954,20 +954,6 @@ <name>OnlyOwnSupervised_param</name> <expose v="true" /> </entityParameter> - <entityConsumer> - <name>CommRestrictions</name> - <dependency> - <name>dependency</name> - <entityName>CommRestriction_Entity</entityName> - <fieldName>CommRestrictions</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContactId_param</name> - <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> <entityField> <name>COMMRESTRICTIONS_ACTIVE</name> <title>Commrestrictions</title> diff --git a/entity/Organisation_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js b/entity/Organisation_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js deleted file mode 100644 index 08da3b121c951607015025c5ed6ea3ea8de1a4cb..0000000000000000000000000000000000000000 --- a/entity/Organisation_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("system.vars"); - -result.string(vars.getString("$field.CONTACTID")); \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 308a22e1ef75d0cb10729aac9523990c8a024689..72bf02195b7bd9839a471c0e09b17c5fa499f25d 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -874,20 +874,6 @@ <expose v="true" /> <description>PARAMETER</description> </entityParameter> - <entityConsumer> - <name>CommRestrictions</name> - <dependency> - <name>dependency</name> - <entityName>CommRestriction_Entity</entityName> - <fieldName>CommRestrictions</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContactId_param</name> - <valueProcess>%aditoprj%/entity/Person_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> <entityConsumer> <name>DSGVOEntries</name> <stateProcess>%aditoprj%/entity/Person_entity/entityfields/dsgvoentries/stateProcess.js</stateProcess> diff --git a/entity/Person_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js b/entity/Person_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js deleted file mode 100644 index 375a85e730194ab84d2caa83bb173dd1131e8b10..0000000000000000000000000000000000000000 --- a/entity/Person_entity/entityfields/commrestrictions/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("system.vars"); - -result.string(vars.getString("$field.CONTACTID")); \ No newline at end of file diff --git a/neonContext/Organisation/Organisation.aod b/neonContext/Organisation/Organisation.aod index 4fdc9462f16d3a980bf04fd0b5cab855930c0cec..fccd99b2964f1c91e161f5579d611ee0a11f2785 100644 --- a/neonContext/Organisation/Organisation.aod +++ b/neonContext/Organisation/Organisation.aod @@ -49,7 +49,7 @@ </neonViewReference> <neonViewReference> <name>c72caf13-37cf-4af9-811d-832f43801369</name> - <view>OrganisationAttributeRestriction_view</view> + <view>OrganisationAttribute_view</view> </neonViewReference> <neonViewReference> <name>ade0ed85-260d-4da5-bf4c-f838cfdcc693</name> diff --git a/neonContext/Person/Person.aod b/neonContext/Person/Person.aod index 987e28778162fd6550e11343ec919e3c59b21f5a..1f9f01bbf1edc780afb0212eb43d1321f56fe138 100644 --- a/neonContext/Person/Person.aod +++ b/neonContext/Person/Person.aod @@ -49,7 +49,7 @@ </neonViewReference> <neonViewReference> <name>296af7da-1994-49a3-a26f-903f29609fae</name> - <view>PersonAttributeRestriction_view</view> + <view>PersonAttribute_view</view> </neonViewReference> <neonViewReference> <name>dd102d90-0af3-4956-95f5-0175c50de3f4</name> diff --git a/neonView/OrganisationAttributeRestriction_view/OrganisationAttributeRestriction_view.aod b/neonView/OrganisationAttribute_view/OrganisationAttribute_view.aod similarity index 71% rename from neonView/OrganisationAttributeRestriction_view/OrganisationAttributeRestriction_view.aod rename to neonView/OrganisationAttribute_view/OrganisationAttribute_view.aod index 946e4932d34ce254e98376daadff0d7bae98bd40..a067a31a6b563296a7663bd567aba9a5d64ddfa5 100644 --- a/neonView/OrganisationAttributeRestriction_view/OrganisationAttributeRestriction_view.aod +++ b/neonView/OrganisationAttribute_view/OrganisationAttribute_view.aod @@ -1,6 +1,6 @@ <?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> - <name>OrganisationAttributeRestriction_view</name> + <name>OrganisationAttribute_view</name> <title>Attributes</title> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> @@ -14,10 +14,5 @@ <entityField>AttributeTree</entityField> <view>AttributeRelationTree_view</view> </neonViewReference> - <neonViewReference> - <name>2c260627-f087-4240-8a6d-e7aa25bbe812</name> - <entityField>CommRestrictions</entityField> - <view>CommRestrictionDrawer_view</view> - </neonViewReference> </children> </neonView> diff --git a/neonView/OrganisationMain_view/OrganisationMain_view.aod b/neonView/OrganisationMain_view/OrganisationMain_view.aod index dff4f05bbf71c277cfcdc293033eff09a1494139..9cef248c5a7580e31e8529b4fffd149957d8bd28 100644 --- a/neonView/OrganisationMain_view/OrganisationMain_view.aod +++ b/neonView/OrganisationMain_view/OrganisationMain_view.aod @@ -53,7 +53,7 @@ <neonViewReference> <name>486b4999-ac17-4560-9ce0-0f20a0028d02</name> <entityField>#ENTITY</entityField> - <view>OrganisationAttributeRestriction_view</view> + <view>OrganisationAttribute_view</view> </neonViewReference> <neonViewReference> <name>c2b37e4d-3b5e-4e23-8b7c-6da02b27ffc0</name> diff --git a/neonView/PersonAttributeRestriction_view/PersonAttributeRestriction_view.aod b/neonView/PersonAttribute_view/PersonAttribute_view.aod similarity index 72% rename from neonView/PersonAttributeRestriction_view/PersonAttributeRestriction_view.aod rename to neonView/PersonAttribute_view/PersonAttribute_view.aod index 5202135ce5090b7acdd0b2be53d567ff3c881579..47eb14656cfdd90bc2dfd75730344ac1777d7210 100644 --- a/neonView/PersonAttributeRestriction_view/PersonAttributeRestriction_view.aod +++ b/neonView/PersonAttribute_view/PersonAttribute_view.aod @@ -1,6 +1,6 @@ <?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> - <name>PersonAttributeRestriction_view</name> + <name>PersonAttribute_view</name> <title>Attributes</title> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> @@ -14,10 +14,5 @@ <entityField>AttributeTree</entityField> <view>AttributeRelationTree_view</view> </neonViewReference> - <neonViewReference> - <name>38199f7b-af85-4576-a6ee-3add0e6761aa</name> - <entityField>CommRestrictions</entityField> - <view>CommRestrictionDrawer_view</view> - </neonViewReference> </children> </neonView> diff --git a/neonView/PersonMain_view/PersonMain_view.aod b/neonView/PersonMain_view/PersonMain_view.aod index d6983b3781d67841a8fa65e4ec8c11ff621d4290..cfbe086984a7e7845922ff9337abd661d217c05b 100644 --- a/neonView/PersonMain_view/PersonMain_view.aod +++ b/neonView/PersonMain_view/PersonMain_view.aod @@ -42,7 +42,7 @@ <neonViewReference> <name>0470a456-1132-4802-ba69-4a1b562b8f14</name> <entityField>#ENTITY</entityField> - <view>PersonAttributeRestriction_view</view> + <view>PersonAttribute_view</view> </neonViewReference> <neonViewReference> <name>19a5f9ed-228d-4352-9e82-e7aa690648e9</name> diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index 93e1b3884b09c9af857966d9de9cd3ba6daec47f..15cefff32f83b34d8b1af949a4daf4fef50db466 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -278,10 +278,13 @@ BulkMailUtils.removeCommRestrictionRecipients = function (pBulkMailId) { var recipientIds = newSelect("BULKMAILRECIPIENTID") .from("BULKMAILRECIPIENT") - .join("CONTACT", newWhere() - .and("BULKMAILRECIPIENT.CONTACT_ID = CONTACT.CONTACTID") - .and(ContactUtils.getCommRestrictionCondition($KeywordRegistry.communicationMediumCampaign$mail()))) + .join("CONTACT", "BULKMAILRECIPIENT.CONTACT_ID = CONTACT.CONTACTID") .where("BULKMAILRECIPIENT.BULKMAIL_ID", pBulkMailId) + .and(new CommunicationSettingsCondition() + .emails("BULKMAILRECIPIENT.EMAIL_ADDRESS") + .rejected() + .existSettings() + .buildCondition()) .arrayColumn(); newWhereIfSet("BULKMAILRECIPIENT.BULKMAILRECIPIENTID", recipientIds, SqlBuilder.IN()) @@ -416,7 +419,11 @@ BulkMailUtils.filterNewRecipients = function (pBulkMailId, pContactIds) .and("BULKMAILRECIPIENT.BULKMAIL_ID", pBulkMailId) , SqlBuilder.NOT_EXISTS()) // check if there's a commrestriction - .and(ContactUtils.getCommRestrictionCondition($KeywordRegistry.communicationMediumCampaign$mail(), true)) + .and(new CommunicationSettingsCondition() + .emails(CommUtil.getStandardSubSqlMail()) + .rejected() + .existNoSettings() + .buildCondition()) .arrayColumn(); } @@ -714,7 +721,11 @@ SerialLetterUtils.buildSerialLetter = function (pSerialLetterId, pRecipientIds) .from("LETTERRECIPIENT") .join("CONTACT", newWhere("LETTERRECIPIENT.CONTACT_ID = CONTACT.CONTACTID")) .where("LETTERRECIPIENT.SERIALLETTER_ID", pSerialLetterId) - .andIfSet(ContactUtils.getCommRestrictionCondition($KeywordRegistry.communicationMediumCampaign$letter(), true)); + .andIfSet(new CommunicationSettingsCondition() + .postalAddress("LETTERRECIPIENT.ADDRESS_ID") + .rejected() + .existNoSettings() + .buildCondition()); if (pRecipientIds && pRecipientIds.length > 0) contactIdsSelect.and("LETTERRECIPIENT.LETTERRECIPIENTID", pRecipientIds, SqlBuilder.IN()); @@ -839,6 +850,10 @@ SerialLetterUtils.filterNewRecipients = function (pSerialLetterId, pContactIds) .and("LETTERRECIPIENT.SERIALLETTER_ID", pSerialLetterId) , SqlBuilder.NOT_EXISTS()) // check if there's a commrestriction - .and(ContactUtils.getCommRestrictionCondition($KeywordRegistry.communicationMediumCampaign$mail(), true)) + .and(new CommunicationSettingsCondition() + .postalAddress("CONTACT.ADDRESS_ID") + .rejected() + .existNoSettings() + .buildCondition()) .arrayColumn(); } diff --git a/process/Contact_lib/process.js b/process/Contact_lib/process.js index 54602028f49ee43fe9e5d1bd0dddd6e47a97c9a6..261d7d63d48bc995c56d8eb58e42c0b2a962fd14 100644 --- a/process/Contact_lib/process.js +++ b/process/Contact_lib/process.js @@ -557,6 +557,8 @@ ContactUtils.getDefaultAddressId = function(pContactId) * @param {String|Number} [pStartDate=current date] date to check against the start date of the commrestriction * * @return {SqlBuilder} the condition + * + * @deprecated use CommunicationSettingsCondition */ ContactUtils.getCommRestrictionCondition = function (pMedium, pNoRestriction, pStartDate) {