Skip to content
Snippets Groups Projects
Commit 37a46707 authored by S.Listl's avatar S.Listl
Browse files

Bulkmail upload bugfix

parent 153782ec
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,6 @@ import("Document_lib");
import("system.vars");
import("DocumentTemplate_lib");
result.string(vars.get("$context.currentTemplateType") == DocumentTemplate.types.TXT
result.string(vars.exists("$context.currentTemplateType") && vars.get("$context.currentTemplateType") == DocumentTemplate.types.TXT
? "LONG_TEXT"
: "HTML");
\ No newline at end of file
......@@ -8,7 +8,7 @@ import("system.neon");
import("DocumentTemplate_lib");
// if this was done for every row, like in a lookup, the performance would be very bad
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET)
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$field.content"))
{
var template = new DocumentTemplate(util.encodeBase64String(vars.get("$field.content")), vars.get("$context.currentTemplateType"), undefined, true)
......
......@@ -4,7 +4,7 @@ import("system.neon");
import("DocumentTemplate_lib");
// in edit mode
if (vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW &&
if (vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW && vars.exists("$context.currentTemplateType") &&
(vars.get("$context.currentTemplateType") == DocumentTemplate.types.EML
|| vars.get("$context.currentTemplateType") == DocumentTemplate.types.HTML)) // TODO: invisible for html as there are problems with images which are removed by the html-editor
{
......
......@@ -12,7 +12,7 @@ if (!vars.get("$this.value") && vars.get("$sys.recordstate") == neon.OPERATINGST
var filename = DocumentUtil.getFilenameFromUpload(upload);
result.string(filename.split(".")[0]);
}
else
else if (vars.get("$field.DOCUMENTTEMPLATE_ID"))
{
var conf = entities.createConfigForLoadingRows();
conf.entity("DocumentTemplate_entity")
......
......@@ -20,7 +20,7 @@ var bulkMailName = rowdata["BULKMAIL.NAME"];
var template = DocumentTemplate.getSelectedTemplate(templateId, new FileUpload(bindata), content, DocumentTemplate.types.HTML);
if (template && template.content)
if (template && template.content && BulkMailUtils.isValidTemplateType(template.type))
{
if (!template.filename)
template.filename = bulkMailName + ".html";
......
......@@ -20,7 +20,7 @@ var bulkMailName = rowdata["BULKMAIL.NAME"];
var template = DocumentTemplate.getSelectedTemplate(templateId, new FileUpload(bindata), content, DocumentTemplate.types.HTML);
if (template && template.content)
if (template && template.content && BulkMailUtils.isValidTemplateType(template.type))
{
if (!template.filename)
template.filename = bulkMailName + ".html";
......
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