diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod index 5893b3f206c63ba01bfe16e794ee45a84b3fe4dd..7df6fd04c07f04481595d88d0c2ba15a1fed8045 100644 --- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod +++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod @@ -358,6 +358,8 @@ <title>Edit HTML file</title> <onActionProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/htmleditor/onActionProcess.js</onActionProcess> <iconId>NEON:PENCIL</iconId> + <state>INVISIBLE</state> + <stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/htmleditor/stateProcess.js</stateProcess> </entityActionField> </entityFields> <recordContainers> diff --git a/entity/DocumentTemplate_entity/entityfields/htmleditor/stateProcess.js b/entity/DocumentTemplate_entity/entityfields/htmleditor/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e067a0a7feba07297282b00a50d713362f868d02 --- /dev/null +++ b/entity/DocumentTemplate_entity/entityfields/htmleditor/stateProcess.js @@ -0,0 +1,10 @@ +import("KeywordRegistry_basic"); +import("system.result"); +import("system.vars"); +import("DocumentTemplate_lib"); +import("system.neon"); + +var template = DocumentTemplateUtils.getTemplate(vars.get("$field.DOCUMENTTEMPLATEID"), false) + +if(template.type == DocumentTemplate.types.HTML && vars.get("$field.KIND") == $KeywordRegistry.documentTemplateType$textModular()) + result.string(neon.COMPONENTSTATE_EDITABLE); diff --git a/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js b/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js index a3311749b10574b4ab7133c69b685d571d80f204..3f68f4ee7cb387c2ccc40c095cd595b6c4efd11a 100644 --- a/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js @@ -1,3 +1,4 @@ +import("system.logging"); import("Workflow_lib"); import("DocumentTemplate_lib"); import("system.vars"); @@ -10,4 +11,7 @@ var rowId = vars.get("$local.uid"); DocumentTemplateUtils.updateTemplateData(rowId, upload, rowdata["DOCUMENTTEMPLATE.KIND"], content, rowdata["DOCUMENTTEMPLATE.CLASSIFICATION"], rowdata["DOCUMENTTEMPLATE.NAME"]); +if(vars.get("$field.HtmlEdit") != null) + DocumentTemplateUtils.updateTemplateData(rowId, upload, rowdata["DOCUMENTTEMPLATE.KIND"], vars.get("$field.HtmlEdit"), rowdata["DOCUMENTTEMPLATE.CLASSIFICATION"], rowdata["DOCUMENTTEMPLATE.NAME"]) + WorkflowSignalSender.updated(); \ No newline at end of file