Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
83ea9f4f
Commit
83ea9f4f
authored
4 years ago
by
S.Listl
Browse files
Options
Downloads
Patches
Plain Diff
1054585 DocumentTemplate_lib comments
parent
839b6c2b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/Offer_entity/entityfields/offerreportdispatch/children/dispatchofferreport/onActionProcess.js
+1
-1
1 addition, 1 deletion
...tdispatch/children/dispatchofferreport/onActionProcess.js
process/DocumentTemplate_lib/process.js
+14
-2
14 additions, 2 deletions
process/DocumentTemplate_lib/process.js
with
15 additions
and
3 deletions
entity/Offer_entity/entityfields/offerreportdispatch/children/dispatchofferreport/onActionProcess.js
+
1
−
1
View file @
83ea9f4f
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
process/DocumentTemplate_lib/process.js
+
14
−
2
View file @
83ea9f4f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment