Skip to content
Snippets Groups Projects
Commit 9b6f2b3b authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon:
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1051275][Serienbrief kann nicht erzeugt werden]

parent d6713f3f
No related branches found
No related tags found
No related merge requests found
...@@ -14,5 +14,5 @@ var template = DocumentTemplate.fromUpload(bindata); ...@@ -14,5 +14,5 @@ var template = DocumentTemplate.fromUpload(bindata);
if (template.content) if (template.content)
{ {
SingleBinaryUtils.insert("SERIALLETTER", "DOCUMENT", letterId, template.content, template.filename, ""); SingleBinaryUtils.insert("SERIALLETTER", "SERIALLETTERFILE", letterId, template.content, template.filename, "");
} }
\ No newline at end of file
...@@ -431,12 +431,18 @@ SerialLetterUtils.buildSerialLetter = function (pSerialLetterId, pRecipientIds) ...@@ -431,12 +431,18 @@ SerialLetterUtils.buildSerialLetter = function (pSerialLetterId, pRecipientIds)
contactIdsSelect.and("LETTERRECIPIENT.LETTERRECIPIENTID", pRecipientIds, SqlBuilder.IN()); contactIdsSelect.and("LETTERRECIPIENT.LETTERRECIPIENTID", pRecipientIds, SqlBuilder.IN());
var contactIds = contactIdsSelect.table(); var contactIds = contactIdsSelect.table();
if(template != null){
return { return {
content : template.getSerialLetterByContactIds(contactIds), content : template.content,
filename : template.filename, filename : template.filename,
title : title title : title
}; };}
else{
return{
title : title
}
}
} }
/** /**
......
...@@ -256,7 +256,13 @@ DocumentTemplate.loadTemplate = function (pAssignmentRowId, pAssignmentTable, pR ...@@ -256,7 +256,13 @@ DocumentTemplate.loadTemplate = function (pAssignmentRowId, pAssignmentTable, pR
var template = DocumentTemplateUtils.getTemplate(templateId, pResolveSubtemplates); var template = DocumentTemplateUtils.getTemplate(templateId, pResolveSubtemplates);
if (template == null) if (template == null)
{ {
question.showMessage(translate.text("File from this template could not be found anymore. Please go to the template and upload a new file."), question.ERROR, translate.text("Error")); if(vars.getString("$sys.isserver") == "true")
throw new Error("loadTemplate: File from this template could not be found anymore. "
+ "Please go to the template and upload a new file. TemplateID: '" + templateId + "'")
else
question.showMessage(translate.text("File from this template could not be found anymore. "
+ "Please go to the template and upload a new file."), question.ERROR, translate.text("Error"));
return null; return null;
} }
} }
...@@ -269,7 +275,8 @@ DocumentTemplate.loadTemplate = function (pAssignmentRowId, pAssignmentTable, pR ...@@ -269,7 +275,8 @@ DocumentTemplate.loadTemplate = function (pAssignmentRowId, pAssignmentTable, pR
var mimeType = templateDocument[0][db.BINARY_MIMETYPE]; var mimeType = templateDocument[0][db.BINARY_MIMETYPE];
var type = DocumentTemplate.types.fromBinaryMetadata(templateDocument[0]); var type = DocumentTemplate.types.fromBinaryMetadata(templateDocument[0]);
if (pResolveSubtemplates == undefined) pResolveSubtemplates = true; if (pResolveSubtemplates == undefined)
pResolveSubtemplates = true;
return new DocumentTemplate(db.getBinaryContent(binaryId, alias), type, filename, pResolveSubtemplates, templateId, mimeType); return new DocumentTemplate(db.getBinaryContent(binaryId, alias), type, filename, pResolveSubtemplates, templateId, mimeType);
} }
......
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