Skip to content
Snippets Groups Projects
Commit 0ebc7366 authored by S.Listl's avatar S.Listl Committed by S.Listl
Browse files

Bulkmail bugfixing

parent 6cce7405
No related branches found
No related tags found
No related merge requests found
......@@ -315,9 +315,6 @@
<name>templateType</name>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/templatetype/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>templateData</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
......@@ -15,8 +15,5 @@ if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$field
var contactId = EmployeeUtils.getCurrentContactId();
var preview = template.getReplacedContentByContactId(contactId, false, true);
if (vars.get("$field.templateType") == DocumentTemplate.types.TXT)
result.string(text.text2html(preview, false));
else
result.string(preview);
result.string(preview);
}
\ No newline at end of file
......@@ -7,19 +7,21 @@ import("system.util");
import("DocumentTemplate_lib");
import("Bulkmail_lib");
/* Processes that can also set the value of this field:
* - bindata.onValueChange
* - DOCUMENTTEMPLATE_ID.onValueChange
*/
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$this.value") == null)
{
var template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID"), false, false, new FileUpload(vars.get("$field.bindata")));
if (template && template.type)
{
var content = util.decodeBase64String(template.content);
var type = template.type;
vars.set("$field.templateType", type);
result.string(content);
}
}
else if (!vars.get("$field.DOCUMENTTEMPLATE_ID") && vars.get("$this.value") == null)
{
result.string("");
vars.set("$field.templateType", "");
}
......@@ -2,5 +2,5 @@ import("system.vars");
import("system.neon");
import("system.result");
if (vars.get("$field.preview"))
if (vars.get("$field.contentPreview"))
result.string(neon.COMPONENTSTATE_READONLY)
\ No newline at end of file
import("system.result");
import("Bulkmail_lib");
import("system.neon");
import("system.vars");
/* Processes that can also set the value of this field:
* - bindata.onValueChange
* - DOCUMENTTEMPLATE_ID.onValueChange
*/
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET)
{
var template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID"), false, false, new FileUpload(vars.get("$field.bindata")));
result.string(template.type);
}
\ No newline at end of file
import("system.util");
import("Binary_lib");
import("system.neon");
import("Sql_lib");
......@@ -18,7 +19,9 @@ var bulkMailId = rowdata["BULKMAIL.BULKMAILID"];
var templateId = rowdata["BULKMAIL.DOCUMENTTEMPLATE_ID"];
var bulkMailName = rowdata["BULKMAIL.NAME"];
var template = DocumentTemplate.getSelectedTemplate(templateId, new FileUpload(bindata), content, DocumentTemplate.types.HTML);
var template = BulkMailUtils.getBulkMailTemplate(bulkMailId, templateId, false, false, new FileUpload(bindata));
if (content)
template.content = util.encodeBase64String(content);
if (template && template.content && BulkMailUtils.isValidTemplateType(template.type))
{
......
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