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

Bulkmail editoer / preview cerrect display

parent 42db7bf5
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,6 @@
<title>Content</title>
<contentType>HTML</contentType>
<contentTypeProcess>%aditoprj%/entity/BulkMail_entity/entityfields/content/contentTypeProcess.js</contentTypeProcess>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/content/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/content/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/content/displayValueProcess.js</displayValueProcess>
......@@ -254,6 +253,13 @@
<contentType>HTML</contentType>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/preview/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>viewmode_preview</name>
<description></description>
<contentType>HTML</contentType>
<stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/viewmode_preview/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/viewmode_preview/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
......@@ -5,6 +5,6 @@ import("Document_lib");
import("system.vars");
import("DocumentTemplate_lib");
result.string(vars.get("$context.currentTemplateType") == DocumentTemplate.types.TXT && (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(vars.get("$context.currentTemplateType") == DocumentTemplate.types.TXT
? "LONG_TEXT"
: "HTML");
\ No newline at end of file
......@@ -10,12 +10,12 @@ if (vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW &&
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
// in view mode disable for eml
else if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW &&
(vars.get("$context.currentTemplateType") == DocumentTemplate.types.EML
// in view mode also disable for html to work around missing image-support for the html-editor
|| vars.get("$context.currentTemplateType") == DocumentTemplate.types.HTML))
// in view mode disable, show preview instead: directly after save (in edit view) the state is changed to OPERATINGSTATE_VIEW and this triggers the initionalisation of the html editor (if it is visible)
// For EML-files or other large files this is very bad, as the editor needs a very long time to initialize
else if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
else
{
result.string(neon.COMPONENTSTATE_EDITABLE);
......
......@@ -3,12 +3,15 @@ import("Document_lib");
import("system.result");
import("system.vars");
import("system.db");
import("system.util");
import("DocumentTemplate_lib");
import("Bulkmail_lib");
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$this.value") == null)
{
[content, type] = DocumentTemplateUtils.getTemplateContent(vars.get("$field.DOCUMENTTEMPLATE_ID"), new FileUpload(vars.get("$field.bindata")));
var template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID"), false, new FileUpload(vars.get("$field.bindata")))
var content = util.decodeBase64String(template.content);
var type = template.type;
vars.set("$context.currentTemplateType", type);
result.string(content);
}
......
import("Bulkmail_lib");
import("system.neon");
import("system.vars");
import("DocumentTemplate_lib");
var template = DocumentTemplate.loadTemplate(vars.get("$field.DOCUMENTTEMPLATE_ID"), undefined, false);
if (template.type)
var template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID"), false)
if (template.content)
neon.download(template.content, template.filename);
\ No newline at end of file
import("system.neon");
import("system.result");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
else
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
import("system.vars");
import("system.result");
result.string("VIEW" + vars.get("$field.content.displayValue"));
\ No newline at end of file
......@@ -36,8 +36,8 @@
<entityField>content</entityField>
</entityFieldLink>
<entityFieldLink>
<name>5ae4212f-4107-447e-af57-9ab60fb8075a</name>
<entityField>preview</entityField>
<name>3843d183-f2ed-4cc3-9202-e2414e0fb594</name>
<entityField>viewmode_preview</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
......
......@@ -139,7 +139,7 @@ DocumentTemplate.prototype.getAttachments = function ()
{
var attachmentIds = db.array(db.COLUMN, SqlCondition.begin()
.andPrepare("DOCUMENTTEMPLATELINK.DOCUMENTTEMPLATE_ID_PARENT", this.templateId)
.buildSql("select DOCUMENTTEMPLATE_ID_CHILD from DOCUMENTTEMPLATELINK"))
.buildSql("select DOCUMENTTEMPLATE_ID_CHILD from DOCUMENTTEMPLATELINK"));
this._attachmentCache = attachmentIds.map(function(pAttachmentId)
{
......
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