Skip to content
Snippets Groups Projects
Commit 83ea9f4f authored by S.Listl's avatar S.Listl
Browse files

1054585 DocumentTemplate_lib comments

parent 839b6c2b
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ offerReport.filename = translate.text("Offer No.") + vars.get("$field.#CONTENTTI
attachmentArray[0] = offerReport;
var additionalPlaceholders = [
new Placeholder("offerCode", Placeholder.types.FIXEDVALUE, vars.get("$field.OFFERCODE"))
new Placeholder("offerCode", Placeholder.types.FIXEDVALUE, vars.get("$field.FullOfferCode"))
];
EmailWritingUtils.sendReportAsMail(contactId, attachmentArray, "Offer", notificationMsg, emailFilename, additionalPlaceholders);
......
......@@ -91,6 +91,9 @@ DocumentTemplate.prototype.setOptions = function (pOptions)
return this;
}
/**
* resolves sub-template placeholders
*/
DocumentTemplate.prototype._resolveSubtemplates = function ()
{
// currently we support only txt and html as others would need special caution.
......@@ -435,6 +438,12 @@ DocumentTemplate.prototype.getReplacedContent = function (pReplacements)
/**
* replaces the placeholders with data from one contact and returns the result
*
* @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.
*
* @return {String} replaced content
*/
DocumentTemplate.prototype.getReplacedContentByContactId = function (pContactId, pAdditionalPlaceholders)
{
......@@ -558,6 +567,9 @@ DocumentTemplate.prototype.getReplacedEmailsByContactIds = function (pContactIds
return emailObjects;
}
/**
* replaces placeholders in the given string
*/
DocumentTemplate.prototype._replaceText = function (pText, pReplacements)
{
var placeholderRegExp = this.options.placeholderRegExp || PlaceholderUtils.getRegexpMatchAll();
......@@ -578,7 +590,7 @@ 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.
* @return {Object[]} all placeholders needed in this template or null, if
* @return {Object[]} all placeholders needed in this template
* @private
*/
DocumentTemplate.prototype._getRequiredPlaceholders = function (pForcedPlaceholders, pAdditionalPlaceholders)
......@@ -608,7 +620,7 @@ DocumentTemplate.prototype._getRequiredPlaceholders = function (pForcedPlacehold
}
/**
* Builds an object with the placeholder data for multiple contacts
* Builds an object with the placeholder replacement data for multiple contacts
*
* @param {Array} pContactIds contact ids
* @param {Placeholder[]} pAdditionalPlaceholders Additional placeholders that should be used. You can use placeholders with the
......
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