Skip to content
Snippets Groups Projects
Commit c65c3c7e authored by Sascha Schmidt's avatar Sascha Schmidt
Browse files

[Projekt: xRM-ContactManagement][TicketNr.: 2000835][Organisation/Person:...

[Projekt: xRM-ContactManagement][TicketNr.: 2000835][Organisation/Person: Brief schreiben: Exception bei Nicht-odt-Datei]
parent c8e247d8
No related branches found
No related tags found
No related merge requests found
import("system.vars");
import("system.translate");
import("system.result");
import("DocumentTemplate_lib");
if (!vars.get("$field.bindata") && !vars.get("$field.DOCUMENT_TEMPLATE"))
var templateId = vars.get("$field.DOCUMENT_TEMPLATE");
var bindata = vars.get("$field.bindata");
var upload = new FileUpload(bindata);
var template;
if (upload.isFilled())
template = DocumentTemplate.fromUpload(upload);
else if (templateId)
template = DocumentTemplateUtils.getTemplate(templateId);
if (!bindata && !templateId)
{
result.string(translate.text("Please select a documenttemplate or upload a new file."))
}
else if (![DocumentTemplate.types.ODT, DocumentTemplate.types.DOCM, DocumentTemplate.types.DOCX].includes(template.type))
{
result.string(translate.text("Only .odt, .docx and .docm files are supported for letters."))
}
\ No newline at end of file
......@@ -25,6 +25,10 @@
<key>Base Template</key>
<value>Ursprungsvorlage</value>
</entry>
<entry>
<key>Only .odt, .docx and .docm files are supported for letters.</key>
<value>Für Briefe werden nur .odt, .docx und .docm Dateien unterstützt</value>
</entry>
<entry>
<key>Open in mosaico</key>
<value>In Mosaico öffnen</value>
......
......@@ -1017,12 +1017,12 @@ function PermissionUtil () {}
if(pRecordState != neon.OPERATINGSTATE_NEW && pObjectType)
{
var entity = ContextUtils.getEntity(pObjectType);
if (tools.hasPermission(tools.PERMISSION_VIEW, entity, null, pUser))
if (tools.hasPermission(tools.PERMISSION_VIEW, entity, null, pUser, null))
{
if (pObjectRowId)
{
try {
if (tools.hasPermission(tools.PERMISSION_READ, entity, null, pUser))
if (tools.hasPermission(tools.PERMISSION_READ, entity, null, pUser, [pObjectRowId]))
{
res = {
status: tools.PERMISSION_READ,
......
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