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

#1065277 Newsletter workflow

parent 6e7eb77e
No related branches found
No related tags found
No related merge requests found
......@@ -7,5 +7,3 @@ neon.openContext("MSTTeamDocument", null, null, neon.OPERATINGSTATE_NEW, {
"AssignmentName_param" : vars.get("$param.AssignmentName_param"),
"AssignmentTable_param" : vars.get("$param.AssignmentTable_param")
});
import("Util_lib");
import("system.vars");
import("system.neon");
import("system.result");
import("Sql_lib");
var isArchived = newSelect("IS_ARCHIVED", "Data_alias")
var isArchived = Utils.toBoolean(newSelect("IS_ARCHIVED")
.from("MST_TEAM")
.where("MST_TEAM.MST_TEAMID", "$param.MSTTeamId_param")
.cell() == "1";
.whereIfSet("MST_TEAM.MST_TEAMID", "$param.MSTTeamId_param")
.cell(true));
result.string(isArchived ? neon.COMPONENTSTATE_DISABLED : neon.COMPONENTSTATE_EDITABLE);
\ No newline at end of file
......@@ -6,7 +6,6 @@ var variables = JSON.parse(vars.get("$local.value"));
var config = notification.createConfig()
.notificationType("WorkflowNotification")
.addUsersWithIds([variables.notificationUser || variables.USER_ID])
.initialState(notification.STATE_UNSEEN)
.caption(variables.notificationCaption || "")
.description(variables.notificationDescription || "");
......
......@@ -21,10 +21,8 @@ actionParams.processInstanceId = processInstanceId;
var additionalPlaceholders = [];
if (aditoUrl)
{
additionalPlaceholders.push(linkPlaceholder = new Placeholder("workflowActionLink", Placeholder.types.CALLBACKFUNCTION, function ()
{
return WorkflowLinkActions.getActionLink(aditoUrl, actionParams.linkActionType, actionParams.redirectLink, actionParams);
}));
var linkPlaceholder = WorkflowLinkActions.getActionLinkPlaceholder(actionParams.linkActionType, actionParams, actionParams.redirectLink, aditoUrl);
additionalPlaceholders.push(linkPlaceholder);
}
var email = Email.fromTemplate(documentTemplateId, recipientContactId, null, additionalPlaceholders);
......
......@@ -737,4 +737,15 @@ WorkflowLinkActions.parseAction = function (pEncodedAction)
return null;
}
};
}
WorkflowLinkActions.getActionLinkPlaceholder = function (pLinkActionType, pActionParams, pRedirectLink, pBaseUrl)
{
if (!pBaseUrl)
pBaseUrl = vars.get("$sys.origin");
return new Placeholder("workflowActionLink", Placeholder.types.CALLBACKFUNCTION, function ()
{
return WorkflowLinkActions.getActionLink(pBaseUrl, pLinkActionType, pRedirectLink, pActionParams);
});
}
\ No newline at end of file
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