Skip to content
Snippets Groups Projects
Commit 34695734 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch 'service_2001255_documentTemplate' into '2021.2.0'

Service 2001255 document template

See merge request xrm/basic!1367
parents a3c423ff 1e71ff2a
No related branches found
No related tags found
No related merge requests found
Showing
with 201 additions and 200 deletions
......@@ -2,7 +2,6 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="m.groppe" id="DOC3035c-2df9-4d5a-8b6f-272e1ba676cb">
<addColumn tableName="DOCUMENTTEMPLATE">
<column name="TEMPLATECONTENT" type="NCLOB"/>
<column name="ALL_TICKET_CATEGORIES" type="TINYINT"/>
</addColumn>
</changeSet>
......
......@@ -8836,20 +8836,6 @@
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>TEMPLATECONTENT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="-1" />
<size v="2147483647" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
</entityFields>
</entityDb>
<entityDb>
......
......@@ -296,13 +296,6 @@
<name>DOCUMENTTEMPLATE_OBJECTTYPE</name>
<valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplate_objecttype/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CONTENTHTML</name>
<title>Text</title>
<contentType>HTML</contentType>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/contenthtml/stateProcess.js</stateProcess>
</entityField>
<entityParameter>
<name>ClasifcationMail_param</name>
<expose v="true" />
......@@ -414,12 +407,6 @@
<name>REPLACEMENTNAME.value</name>
<recordfield>DOCUMENTTEMPLATE.REPLACEMENTNAME</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CONTENTHTML.value</name>
<recordfield>DOCUMENTTEMPLATE.TEMPLATECONTENT</recordfield>
<isFilterable v="true" />
<isLookupFilter v="true" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>KIND.displayValue</name>
<expression>%aditoprj%/entity/DocumentTemplate_entity/recordcontainers/db/recordfieldmappings/kind.displayvalue/expression.js</expression>
......
......@@ -9,7 +9,5 @@ if((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.r
[content, type] = DocumentTemplateUtils.getTemplateContent(vars.get("$field.DOCUMENTTEMPLATEID"), new FileUpload(vars.get("$local.value")));
vars.set("$context.currentTemplateType", type);
vars.set("$field.Content", content);
vars.set("$field.CONTENTHTML", content);
}
vars.set("$field.Content", content);
}
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.vars");
import("system.neon");
import("system.result");
if( (vars.get("$field.KIND") == $KeywordRegistry.documentTemplateType$mail()) || (vars.get("$field.KIND") == $KeywordRegistry.documentTemplateType$signature()) || (vars.get("$field.KIND") == $KeywordRegistry.documentTemplateType$replymail()) )
{
result.string(neon.COMPONENTSTATE_EDITABLE);
} else
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
import("ServiceEmail_lib");
import("system.translate");
import("Employee_lib");
import("Sql_lib");
import("system.db");
import("DocumentTemplate_lib");
import("system.vars");
import("system.util");
import("system.vars");
import("DocumentTemplate_lib");
var dokumentTemplateId = vars.get("$local.value");
var documentTemplateContent = newSelect("TEMPLATECONTENT")
.from("DOCUMENTTEMPLATE")
.where("DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID", dokumentTemplateId)
.cell();
var documentTemplateContent = DocumentTemplateUtils.getTemplate(vars.get("$local.value"),false)
///REPLACE CONTENT WITH PLACEHOLDERS
let contactId = vars.get("$param.ContactId_param");
......
......@@ -256,6 +256,13 @@
</entityParameter>
</children>
</entityConsumer>
<entityActionField>
<name>openAdminView</name>
<title>Open admin view</title>
<onActionProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/openadminview/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CURLY_BRACKETS</iconId>
<stateProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/openadminview/stateProcess.js</stateProcess>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("DocumentTemplate_lib");
import("system.logging");
import("system.vars");
import("Context_lib");
AdminViewUtils.open("TICKETTEMPLATEID", [
["TEMPLATE_ID", vars.get("$field.TEMPLATE_ID")],
["DOCUMENTTEMPLATE_ID", vars.get("$field.DOCUMENTTEMPLATE_ID")],
["INBOX_ID", vars.get("$field.INBOX_ID")]
]);
\ No newline at end of file
import("Context_lib");
import("system.result");
result.string(AdminViewUtils.getActionState());
\ No newline at end of file
......@@ -119,8 +119,8 @@
<isEditable v="true" />
<fields>
<entityFieldLink>
<name>c81cbd96-666f-48fb-bdaa-fc69d4d125bf</name>
<entityField>CONTENTHTML</entityField>
<name>58c79c6f-0ff0-47e1-9152-41e2363240cc</name>
<entityField>Preview</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
......
......@@ -227,7 +227,7 @@ function getBodyHistoryForAllActivities(pTicketID, pTaskID, pKind, pTo, pSender,
/**
* @description Gets the signature as a string
*
* @param {String} pSignagureID the ID of the signature to add
* @param {String} pSignatureID the ID of the signature to add
*
* @return string the signature
*/
......@@ -238,10 +238,7 @@ function getSignatureContent(pSignatureID)
.where("MAILSIGNATURE.MAILSIGNATUREID", pSignatureID)
.cell();
let documentContent = newSelect("TEMPLATECONTENT")
.from("DOCUMENTTEMPLATE")
.where("DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID", dokumentTemplateId)
.cell();
let documentContent = DocumentTemplateUtils.getTemplate(dokumentTemplateId,false)
let contactId = EmployeeUtils.getCurrentContactId();
......
import("DocumentTemplate_lib");
import("system.logging");
import("system.eMath");
import("system.db");
......@@ -104,18 +105,23 @@ TicketTemplateUtils.ticketTemplateColumnMapping = function(pColumn)
/**
* checks whether the Template has an individual answer mail activitated
*
* @param {String} pTemplateId the id of the template for the ticket
*
* returns the answer mail document template if true
*
* @param {String} pTemplateId the id of the template for the ticket
*/
TicketTemplateUtils.checkIndividualAnswer = function (pTemplateId)
{
var sql = newSelect("DOCUMENTTEMPLATE.TEMPLATECONTENT")
var documentTemplateId = newSelect("TICKETTEMPLATE.DOCUMENTTEMPLATE_ID")
.from("TICKETTEMPLATE")
.join("DOCUMENTTEMPLATE","TICKETTEMPLATE.DOCUMENTTEMPLATE_ID = DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID")
.whereIfSet("TICKETTEMPLATE.TICKETTEMPLATEID",pTemplateId)
.and("TICKETTEMPLATE.INDIVIDUAL_ANSWER", $KeywordRegistry.ticketTemplateIndivAnswer$active())
.cell()
return sql;
if (documentTemplateId)
{
var documentTemplateContent = DocumentTemplateUtils.getTemplate(documentTemplateId,false)
}
return documentTemplateContent;
}
\ No newline at end of file
This diff is collapsed.
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