Skip to content
Snippets Groups Projects
Commit 757a42f1 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

fix state of content in document template

parent b9a00967
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,14 @@ import("system.neon");
if (vars.get("$field.Content") || !vars.get("$field.BINDATA"))
{
// Workaround: prevent removing images via html-editor -> use only preview-field if it's html
var type = DocumentTemplateUtils.getContentType(vars.get("$field.DOCUMENTTEMPLATEID"), new FileUpload(vars.get("$field.BINDATA")))
if (type == DocumentTemplate.types.HTML && !(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.BINDATA")))
if ((type != DocumentTemplate.types.TXT ||
// Workaround: prevent removing images via html-editor -> use only the preview-field if it's html and not the content field
// That's why type HTML -> invisible
type == DocumentTemplate.types.HTML) && !(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.BINDATA")))
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
else
result.string(neon.COMPONENTSTATE_EDITABLE);
}
......
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