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

#1065236 marketing automation workflow set adito url

parent ce6de6dc
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import("system.vars");
import("system.result");
var variables = {
documentTemplateId: vars.get("$field.DOCUMENTTEMPLATE_ID")
documentTemplateId: vars.get("$field.DOCUMENTTEMPLATE_ID"),
originUrl: vars.get("$sys.origin")
};
result.string(JSON.stringify(variables));
\ No newline at end of file
......@@ -959,6 +959,12 @@
<tooltip>Export fields of this table</tooltip>
<tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/tooltipProcess.js</tooltipProcess>
</entityActionField>
<entityActionField>
<name>startMarketingWorkflows</name>
<title>Start marketing workflow</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
</entityActionField>
</children>
</entityActionGroup>
<entityActionField>
......@@ -1422,18 +1428,6 @@
<fieldName>FilterProvider</fieldName>
</dependency>
</entityConsumer>
<entityActionGroup>
<name>workflowActions</name>
<title>Workflow</title>
<children>
<entityActionField>
<name>startMarketingWorkflows</name>
<title>Start marketing workflow</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/workflowactions/children/startmarketingworkflows/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
</entityActionField>
</children>
</entityActionGroup>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
......@@ -31,6 +31,7 @@
<name>KEY</name>
<title>Key</title>
<consumer>WorkflowDefinitions</consumer>
<mandatory v="true" />
<state>EDITABLE</state>
</entityField>
<entityActionField>
......@@ -88,6 +89,7 @@
<recordContainers>
<datalessRecordContainer>
<name>dataLess</name>
<alias>Data_alias</alias>
</datalessRecordContainer>
</recordContainers>
</entity>
......@@ -51,7 +51,6 @@
<name>Organisations</name>
<favoriteActionGroup1>filterViewActionGroup</favoriteActionGroup1>
<favoriteActionGroup2>DuplicateActions</favoriteActionGroup2>
<favoriteActionGroup3>workflowActions</favoriteActionGroup3>
<subtitleField>CUSTOMERCODE_DISPLAY_fieldGroup</subtitleField>
<entityField>#ENTITY</entityField>
<linkedColumns>
......@@ -101,7 +100,6 @@
<name>Treetable</name>
<favoriteActionGroup1>filterViewActionGroup</favoriteActionGroup1>
<favoriteActionGroup2>DuplicateActions</favoriteActionGroup2>
<favoriteActionGroup3>workflowActions</favoriteActionGroup3>
<entityField>#ENTITY</entityField>
<linkedColumns>
<element>NAME</element>
......
......@@ -40,7 +40,7 @@ FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter)
{
return new SqlBuilder()
.selectDistinct("CONTACT.CONTACTID")
.from("PERSON")
.from("ORGANISATION")
.join("CONTACT", newWhere("ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID").and("CONTACT.PERSON_ID is null"))
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
.leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = CONTACT.CONTACTID")
......
......@@ -14,15 +14,20 @@ var recipientContactId = variables.recipientContactId || variables.targetId;
var documentTemplateId = variables.documentTemplateId;
var senderName = variables.senderName;
var mailSubject = variables.mailSubject;
var aditoUrl = variables.originUrl;
var actionParams = Utils.clone(variables);
actionParams.processInstanceId = processInstanceId;
var linkPlaceholder = new Placeholder("workflowActionLink", Placeholder.types.CALLBACKFUNCTION, function ()
var additionalPlaceholders = [];
if (aditoUrl)
{
return WorkflowLinkActions.getActionLink("https://localhost:8443", actionParams.linkActionType, actionParams.redirectLink, actionParams);
});
additionalPlaceholders.push(linkPlaceholder = new Placeholder("workflowActionLink", Placeholder.types.CALLBACKFUNCTION, function ()
{
return WorkflowLinkActions.getActionLink(aditoUrl, actionParams.linkActionType, actionParams.redirectLink, actionParams);
}));
}
var email = Email.fromTemplate(documentTemplateId, recipientContactId, null, [linkPlaceholder]);
var email = Email.fromTemplate(documentTemplateId, recipientContactId, null, additionalPlaceholders);
email.subject = mailSubject;
email.toRecipients = [CommUtil.getStandardMail(recipientContactId)];
......
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