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

Merge branch 'marketing_2003982_small_changes' into '2021.2'

[Projekt: xRM-Marketing][TicketNr.: 2003298][[Bug] Serienmailempfänger:...

See merge request xrm/basic!1637
parents bb37c880 c471fad0
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ import("system.neon"); ...@@ -3,7 +3,7 @@ import("system.neon");
import("system.vars"); import("system.vars");
var contactId = vars.get("$local.value"); var contactId = vars.get("$local.value");
if(contactId != "") if(contactId != "" && vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW)
{ {
neon.setFieldValue("$field.EMAIL_ADDRESS",CommUtil.getStandardMail(contactId)); neon.setFieldValue("$field.EMAIL_ADDRESS",CommUtil.getStandardMail(contactId));
} }
\ No newline at end of file
...@@ -16,7 +16,3 @@ if (contactId) ...@@ -16,7 +16,3 @@ if (contactId)
.table(); .table();
result.object(emailAddresses); result.object(emailAddresses);
} }
else
{
result.object([])
}
...@@ -353,6 +353,12 @@ ...@@ -353,6 +353,12 @@
<entityName>Interest_entity</entityName> <entityName>Interest_entity</entityName>
<fieldName>#PROVIDER</fieldName> <fieldName>#PROVIDER</fieldName>
</dependency> </dependency>
<children>
<entityParameter>
<name>OnlyActive_param</name>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/interests/children/onlyactive_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer> </entityConsumer>
<entityField> <entityField>
<name>copyRecipients</name> <name>copyRecipients</name>
......
import("system.result");
result.string("true");
\ No newline at end of file
import("Bulkmail_lib");
import("system.vars"); import("system.vars");
import("system.neon"); import("system.neon");
import("system.result"); import("system.result");
if (vars.get("$field.MOSAICOTEMPLATE_ID") || vars.get("$field.DOCUMENTTEMPLATE_ID") || vars.get("$field.content")) if (vars.get("$field.MOSAICOTEMPLATE_ID") || vars.get("$field.DOCUMENTTEMPLATE_ID") || BulkMailUtils.isNotEmptyHtml(vars.get("$field.content")))
{ {
result.string( neon.COMPONENTSTATE_INVISIBLE); result.string( neon.COMPONENTSTATE_INVISIBLE);
} }
......
...@@ -1169,6 +1169,18 @@ BulkMailUtils.startBulkmailWorkFlow = function(pMailLogId, pLinkId) ...@@ -1169,6 +1169,18 @@ BulkMailUtils.startBulkmailWorkFlow = function(pMailLogId, pLinkId)
} }
} }
/* Checks if the Content is just the default empty html
*
* @param {String} pContent content
*
* @return {Boolean} true if content is not just empty html tag and not an empty string
**/
BulkMailUtils.isNotEmptyHtml = function(pContent)
{
return pContent !== "<html></html>" && pContent !== "";
}
function SerialLetterUtils () {} function SerialLetterUtils () {}
......
...@@ -49,7 +49,7 @@ function _findPerson(pFirstname, pLastname, pMailAddress) ...@@ -49,7 +49,7 @@ function _findPerson(pFirstname, pLastname, pMailAddress)
var contactId = newSelect("CONTACT.CONTACTID") var contactId = newSelect("CONTACT.CONTACTID")
.from("CONTACT") .from("CONTACT")
.join("PERSON","CONTACT.PERSON_ID = PERSON.PERSONID") .join("PERSON","CONTACT.PERSON_ID = PERSON.PERSONID")
.join("COMMUNICATION",newWhere("COMMUNICATION.OBJECT_ROWID = CONTACT.CONTACTID").and("COMMUNICATION.OBJECT_TYPE", "Contact")) .join("COMMUNICATION",newWhere("COMMUNICATION.OBJECT_ROWID = CONTACT.CONTACTID").and("COMMUNICATION.OBJECT_TYPE", "Person"))
.whereIfSet("PERSON.FIRSTNAME",pFirstname) .whereIfSet("PERSON.FIRSTNAME",pFirstname)
.andIfSet("PERSON.LASTNAME",pLastname) .andIfSet("PERSON.LASTNAME",pLastname)
.and("COMMUNICATION.MEDIUM_ID",$KeywordRegistry.communicationMedium$mail()) .and("COMMUNICATION.MEDIUM_ID",$KeywordRegistry.communicationMedium$mail())
...@@ -59,7 +59,7 @@ function _findPerson(pFirstname, pLastname, pMailAddress) ...@@ -59,7 +59,7 @@ function _findPerson(pFirstname, pLastname, pMailAddress)
if (!contactId){ if (!contactId){
contactId = newSelect("CONTACT.CONTACTID") contactId = newSelect("CONTACT.CONTACTID")
.from("CONTACT") .from("CONTACT")
.join("COMMUNICATION",newWhere("COMMUNICATION.OBJECT_ROWID = CONTACT.CONTACTID").and("COMMUNICATION.OBJECT_TYPE", "Contact")) .join("COMMUNICATION",newWhere("COMMUNICATION.OBJECT_ROWID = CONTACT.CONTACTID").and("COMMUNICATION.OBJECT_TYPE", "Person"))
.where("COMMUNICATION.MEDIUM_ID",$KeywordRegistry.communicationMedium$mail()) .where("COMMUNICATION.MEDIUM_ID",$KeywordRegistry.communicationMedium$mail())
.and("COMMUNICATION.ADDR",pMailAddress) .and("COMMUNICATION.ADDR",pMailAddress)
.and("CONTACT.PERSON_ID is not null") .and("CONTACT.PERSON_ID is not null")
...@@ -116,7 +116,7 @@ function _insertPerson(pFirstname, pLastname, pMailAddress, pSalutation) ...@@ -116,7 +116,7 @@ function _insertPerson(pFirstname, pLastname, pMailAddress, pSalutation)
"ISSTANDARD" : "1", "ISSTANDARD" : "1",
"USER_NEW": "register_rest", "USER_NEW": "register_rest",
"DATE_NEW": vars.get("$sys.date"), "DATE_NEW": vars.get("$sys.date"),
"OBJECT_TYPE" : "Contact" "OBJECT_TYPE" : "Person"
}); });
return contactId; return contactId;
......
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