diff --git a/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js b/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js index 69b7b7b8cb88c489754264203262574b6ff4e2be..37a8bfcce2e832169e1e3891508da61749cbfd5c 100644 --- a/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js +++ b/entity/Letter_entity/entityfields/downloadletterandcreateactivity/onActionProcess.js @@ -1,3 +1,4 @@ +import("Sql_lib"); import("system.translate"); import("Contact_lib"); import("ActivityTask_lib"); @@ -21,7 +22,10 @@ if (template) return Object.assign(new Placeholder(), placeholder); }); } - var content = template.setOptions({base64 : true}).getReplacedContentByContactId(contactId, additionalPlaceholders); + + var locale = newSelect("ISOLANGUAGE").from("CONTACT").where("CONTACT.CONTACTID", contactId).cell(); + + var content = template.setOptions({base64 : true}).getReplacedContentByContactId(contactId, additionalPlaceholders, locale); if (template.type) neon.download(content, template.filename); diff --git a/entity/Person_entity/entityfields/newemail/onActionProcess.js b/entity/Person_entity/entityfields/newemail/onActionProcess.js index c4ff5861b8aa9dc43e67f0d8975c65216188aab6..10ca61158282d7cf461aa41254b3143ea30a2b77 100644 --- a/entity/Person_entity/entityfields/newemail/onActionProcess.js +++ b/entity/Person_entity/entityfields/newemail/onActionProcess.js @@ -4,4 +4,4 @@ import("KeywordRegistry_basic"); EmailWritingUtils.openNewMail(vars.getString("$field.CONTACTID"), null, vars.get("$sys.currentcontextname"), null, null, null, null, null, - $KeywordRegistry.documentTemplateTypeCategory$single()); \ No newline at end of file + $KeywordRegistry.documentTemplateTypeCategory$single(), vars.get("$field.LANGUAGE")); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 7b6aee941f0b18cc3d840c7eed167824e967ab9b..ee4ee87895cbe1404698db7a74adb9cedb57d6bd 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -11132,6 +11132,18 @@ <entry> <key>dd/MM/yyyy HH:mm</key> </entry> + <entry> + <key>Only .odt, .docx and .docm files are supported for letters.</key> + </entry> + <entry> + <key>Create subordinate relationship</key> + </entry> + <entry> + <key>Datasets are exported</key> + </entry> + <entry> + <key>Affected rows</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 4bfa615b72f7c003d1e1a4eea5b8e75a1e6aafa6..efa9e5cb24382dbbbfe179c61c20d5c5fd593f77 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -65,6 +65,10 @@ <key>dd/MM/yyyy HH:mm</key> <value>dd.MM.yyyy HH:mm</value> </entry> + <entry> + <key>dd/MM/yyyy</key> + <value>dd.MM.yyyy</value> + </entry> <entry> <key>Do you really want to delete \"%0\"? If tickets still use this inbox, this might cause problems.</key> <value>Postkorb \"%0\" wirklich löschen? Wenn noch Tickets mit diesem Postkorb existieren, kann das zu Problemen führen.</value> @@ -3957,6 +3961,10 @@ <key>Progress</key> <value>Fortschritt</value> </entry> + <entry> + <key>MM/dd/yyyy</key> + <value>dd.MM.yyyy</value> + </entry> <entry> <key>United States of America</key> <value>Vereinigte Staaten von Amerika</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 99650096f79bb15197e3e728143e69bb1060b560..36a44220257ba024a5cb64bcb3e4f56210405989 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -11228,6 +11228,18 @@ <entry> <key>dd/MM/yyyy HH:mm</key> </entry> + <entry> + <key>Only .odt, .docx and .docm files are supported for letters.</key> + </entry> + <entry> + <key>Create subordinate relationship</key> + </entry> + <entry> + <key>Datasets are exported</key> + </entry> + <entry> + <key>Affected rows</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/process/DocumentTemplate_lib/process.js b/process/DocumentTemplate_lib/process.js index dc56b7840fff124e0c747c03a6eb21d5731626eb..7700b24877d7f879d04e344f177d856fc09b1b77 100644 --- a/process/DocumentTemplate_lib/process.js +++ b/process/DocumentTemplate_lib/process.js @@ -484,12 +484,13 @@ DocumentTemplate.prototype.getReplacedContent = function (pReplacements) * @param {String} pContactId contact id * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. + * @param {String} pLocale the Language for the translated title. * * @return {String} replaced content */ -DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, pAdditionalPlaceholders) +DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, pAdditionalPlaceholders, pLocale) { - var replacements = this.getReplacementsByContactIds([pContactId], pAdditionalPlaceholders)[pContactId]; + var replacements = this.getReplacementsByContactIds([pContactId], pAdditionalPlaceholders, undefined, pLocale)[pContactId]; var content = this.getReplacedContent(replacements); return content; @@ -501,12 +502,13 @@ DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, * @param {Array} pContactIds contact ids * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. + * @param {String} pLocale the Language for the translated title. * * @return {Object} replaced content for every contactId */ -DocumentTemplate.prototype.getReplacedContentByContactIds = function (pContactIds, pAdditionalPlaceholders) +DocumentTemplate.prototype.getReplacedContentByContactIds = function (pContactIds, pAdditionalPlaceholders, pLocale) { - var replacements = this.getReplacementsByContactIds(pContactIds, pAdditionalPlaceholders); + var replacements = this.getReplacementsByContactIds(pContactIds, pAdditionalPlaceholders, undefined, pLocale); var contents = {}; for (let contactId in replacements) { @@ -632,13 +634,14 @@ DocumentTemplate.prototype._replaceText = function (pText, pReplacements) * @param {String[]} pForcedPlaceholders these placeholders are always loaded * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. + * @param {String} pLocale the Language for the translated title. * @return {Object[]} all placeholders needed in this template * @private */ -DocumentTemplate.prototype._getRequiredPlaceholders = function (pForcedPlaceholders, pAdditionalPlaceholders) +DocumentTemplate.prototype._getRequiredPlaceholders = function (pForcedPlaceholders, pAdditionalPlaceholders, pLocale) { var content = this.toString(true); - var placeholders = PlaceholderUtils.getPlaceholders(); + var placeholders = PlaceholderUtils.getPlaceholders(pLocale); if (pAdditionalPlaceholders) placeholders = placeholders.concat(pAdditionalPlaceholders); @@ -668,21 +671,22 @@ DocumentTemplate.prototype._getRequiredPlaceholders = function (pForcedPlacehold * @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the * types FIXEDVALUE and CALLBACKFUNCTION if you want to calculate the replacement values yourself. * @param {boolean} pGetAllReplacements if true all Replacements get returned even if theyre not in the document. + * @param {String} pLocale the Language for the translated title. * * @return {Object} Object containing the data. The structure is like {contactId : {placeholderName : replacementValue, ...}, ...} */ -DocumentTemplate.prototype.getReplacementsByContactIds = function (pContactIds, pAdditionalPlaceholders, pGetAllReplacements) +DocumentTemplate.prototype.getReplacementsByContactIds = function (pContactIds, pAdditionalPlaceholders, pGetAllReplacements, pLocale) { var placeholders; if(pGetAllReplacements) { - placeholders = PlaceholderUtils.getPlaceholders(); + placeholders = PlaceholderUtils.getPlaceholders(pLocale); if (pAdditionalPlaceholders) placeholders = placeholders.concat(pAdditionalPlaceholders); } else { - placeholders = this._getRequiredPlaceholders(["{@firstname@}", "{@lastname@}"], pAdditionalPlaceholders); + placeholders = this._getRequiredPlaceholders(["{@firstname@}", "{@lastname@}"], pAdditionalPlaceholders, pLocale); } var contactPlaceholders = []; diff --git a/process/Email_lib/process.js b/process/Email_lib/process.js index ad691968acda47c82c047ea945c3502b3dd55e61..1988968dd95830ffe22b8f90287cb5c6b7528c28 100644 --- a/process/Email_lib/process.js +++ b/process/Email_lib/process.js @@ -99,7 +99,6 @@ EmailWritingUtils.openMailTemplate = function (pToRecipients, pSenderContactId, EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComingFrom, pAttachmentArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pUpdateStatements, pDocumentTemplateTypeClassification, pLanguage) { - logging.log(pLanguage); var params = { "ContactId_param" : pToContactId, "Attachments_param" : JSON.stringify(pAttachmentArray), diff --git a/process/Placeholder_lib/process.js b/process/Placeholder_lib/process.js index e96b202d0b755d65adbbc90123e4e5cf6867e129..a18b33393d8638ae119eee4c91e927641a19c625 100644 --- a/process/Placeholder_lib/process.js +++ b/process/Placeholder_lib/process.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.translate"); import("system.vars"); import("CustomPlaceholder_lib"); @@ -32,7 +33,7 @@ PlaceholderUtils.getPlaceholders = function (pLocale, pIsExportTemplateField) locale = pLocale; /***************************************************************************************************************/ //Definition of available basic Placeholders. For project specific Placeholders, use CustomPlaceholder_lib - + logging.log(locale) _addAddressFormat("address", "{street} {buildingno}", null, translate.text("Address", locale)); _addAddressFormat("zipCode", "{zip}", null , translate.text("Zip", locale)); _addAddressFormat("city", "{city}", null , translate.text("City", locale)); @@ -58,7 +59,7 @@ PlaceholderUtils.getPlaceholders = function (pLocale, pIsExportTemplateField) _addSqlPart("senderPhone", CommUtil.getStandardSubSqlPhone(), Placeholder.targets.SENDER, translate.text("Sender phone")); _addSqlPart("senderEmail", CommUtil.getStandardSubSqlMail(), Placeholder.targets.SENDER, translate.text("Sender email")); _addSqlPart("senderName", sqlUtil.concatWithSeparator(["SALUTATION", "TITLE", "FIRSTNAME", "LASTNAME"]), Placeholder.targets.SENDER, translate.text("Sender name")); - _addSqlPart("date", "'" + datetime.toDate(vars.get("sys.date"), translate.text("dd.MM.yyyy")) + "'", Placeholder.targets.SENDER, translate.text("Date")); + _addSqlPart("date", "'" + datetime.toDate(vars.get("sys.date"), translate.text("MM/dd/yyyy", locale), null, locale) + "'", Placeholder.targets.SENDER, translate.text("Date")); /***************************************************************************************************************/