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
Admin message
Gitlab Maintenance 28.03.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
basic
Commits
96557f28
Commit
96557f28
authored
5 years ago
by
S.Listl
Browse files
Options
Downloads
Patches
Plain Diff
libs documentation
parent
6df79b25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
process/Bulkmail_lib/process.js
+40
-2
40 additions, 2 deletions
process/Bulkmail_lib/process.js
process/DocumentTemplate_lib/process.js
+16
-1
16 additions, 1 deletion
process/DocumentTemplate_lib/process.js
process/Email_lib/process.js
+7
-5
7 additions, 5 deletions
process/Email_lib/process.js
with
63 additions
and
8 deletions
process/Bulkmail_lib/process.js
+
40
−
2
View file @
96557f28
...
...
@@ -143,7 +143,11 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pTestRecipients)
};
}
/**
* opens a context to select a bulk mail to add recipients to
*
* @param {String[]} pContactIds recipients that should be added
*/
BulkMailUtils
.
openAddRecipientView
=
function
(
pContactIds
)
{
var
params
=
{
...
...
@@ -216,6 +220,13 @@ BulkMailUtils.getBulkMailTemplate = function (pBulkMailId, pDocumentTemplateId)
return
template
;
}
/**
* checks if a contact is a recipient of a bulk mail
*
* @param {String} pBulkMailId bulkmail id
* @param {String} pContactId contact id
* @return {boolean} true, if the contact is a recipient
*/
BulkMailUtils
.
isRecipient
=
function
(
pBulkMailId
,
pContactId
)
{
return
db
.
cell
(
SqlCondition
.
begin
()
...
...
@@ -225,6 +236,11 @@ BulkMailUtils.isRecipient = function (pBulkMailId, pContactId)
)
!=
"
0
"
;
}
/**
* opens the BulkMail context in new mode
*
* @param {String[]} [pRecipients] recipients that should be added after creation
*/
BulkMailUtils
.
newBulkMail
=
function
(
pRecipients
)
{
var
params
=
{
...
...
@@ -233,6 +249,14 @@ BulkMailUtils.newBulkMail = function (pRecipients)
neon
.
openContext
(
"
BulkMail
"
,
"
BulkMailEdit_view
"
,
null
,
neon
.
OPERATINGSTATE_NEW
,
params
);
}
/**
* Filters the given contactIds if they can be added as new recipients.
* Checks if a contact is already a recipient or if there is a advertising ban.
*
* @param {String} pBulkMailId id of the bulk mail the contacts should be added to
* @param {String[]} pContactIds contacts to filter
* @return {String[]} contacts that can be added as recipients
*/
BulkMailUtils
.
filterNewRecipients
=
function
(
pBulkMailId
,
pContactIds
)
{
var
existsQuery
=
"
not exists(select BULKMAILRECIPIENTID from BULKMAILRECIPIENT where BULKMAILRECIPIENT.CONTACT_ID = CONTACT.CONTACTID and # = ?)
"
;
...
...
@@ -245,6 +269,9 @@ BulkMailUtils.filterNewRecipients = function (pBulkMailId, pContactIds)
return
db
.
array
(
db
.
COLUMN
,
query
);
}
/**
* opens the given bulk mail
*/
BulkMailUtils
.
openBulkMail
=
function
(
pBulkMailId
)
{
neon
.
openContext
(
"
BulkMail
"
,
"
BulkMailMain_view
"
,
[
pBulkMailId
],
neon
.
OPERATINGSTATE_VIEW
,
null
);
...
...
@@ -273,7 +300,11 @@ SerialLetterUtils.addRecipients = function (pSerialLetterId, pContactIds)
db
.
inserts
(
inserts
);
}
/**
* opens a context to select a serial letter to add recipients to
*
* @param {String[]} pContactIds recipients that should be added
*/
SerialLetterUtils
.
openAddRecipientView
=
function
(
pContactIds
)
{
var
params
=
{
...
...
@@ -297,6 +328,13 @@ SerialLetterUtils.buildSerialLetter = function (pSerialLetterId, pRecipientIds)
});
}
/**
* checks if a contact is a recipient of a serial letter
*
* @param {String} pSerialLetterId serial letter id
* @param {String} pContactId contact id
* @return {boolean} true, if the contact is a recipient
*/
SerialLetterUtils
.
isRecipient
=
function
(
pSerialLetterId
,
pContactId
)
{
return
db
.
cell
(
SqlCondition
.
begin
()
...
...
This diff is collapsed.
Click to expand it.
process/DocumentTemplate_lib/process.js
+
16
−
1
View file @
96557f28
...
...
@@ -29,6 +29,13 @@ import("Email_lib");
var
DocumentTemplate
=
(
function
()
{
/**
* constructor for DocumentTemplate
*
* @param {String} pTemplateContent content, as base64 string (except for DocumentTemplate.types.PLAIN, then it's a normal string)
* @param {String} pType type of the template, use the DocumentTemplate.types constants here
* @param {String} [pFilename] file name of the template
*/
function
DocumentTemplate
(
pTemplateContent
,
pType
,
pFilename
)
{
this
.
content
=
pTemplateContent
;
...
...
@@ -36,6 +43,9 @@ function DocumentTemplate (pTemplateContent, pType, pFilename)
this
.
filename
=
pFilename
;
}
/**
* @return {String} the text of the content
*/
DocumentTemplate
.
prototype
.
toString
=
function
()
{
if
(
this
.
type
==
DocumentTemplate
.
types
.
PLAIN
)
...
...
@@ -265,7 +275,7 @@ DocumentTemplate.prototype.getReplacedEmailsByContactIds = function (pContactIds
}
/**
* Provides functions for the DocumentTemplate object
.
* Provides functions for the DocumentTemplate object
that aren't accessible from outside
*/
function
TemplateHelper
()
{}
/**
...
...
@@ -505,6 +515,11 @@ TemplateHelper._getReplacedDOCX = function (pTemplate, pReplacements)
*/
function
LetterUtils
()
{}
/**
* opens a new letter
*
* @param {String} pContactId id of the contact to fetch the data from
*/
LetterUtils
.
openNewLetter
=
function
(
pContactId
)
{
var
params
=
{
...
...
This diff is collapsed.
Click to expand it.
process/Email_lib/process.js
+
7
−
5
View file @
96557f28
...
...
@@ -20,7 +20,6 @@ function EmailWritingUtils () {}
* @param {String} pSenderContactId contactId of the sender. the standard mailadress of the contact is used as sender-address
* @param {String} [pTemplateId] if a document-template shall be used, give the templateId here
* @param {String} [pRecipientContactId] contactId of the recipient, required to fill placeholders
*
* @return {Array} the eml document as array with [filename, base64]
*/
EmailWritingUtils
.
openMailTemplate
=
function
(
pToRecipients
,
pSenderContactId
,
pTemplateId
,
pRecipientContactId
)
...
...
@@ -59,7 +58,6 @@ EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress)
* @param {String} [pBody=null] mail body
* @param {Array} [pCcRecipients=[]] array of recipient cc addresses
* @param {Array} [pBccRecipients=[]] array of recipient bcc addresses
*
* @class
*/
function
Email
(
pToRecipients
,
pSender
,
pSubject
,
pBody
,
pCcRecipients
,
pBccRecipients
)
...
...
@@ -76,7 +74,10 @@ function Email (pToRecipients, pSender, pSubject, pBody, pCcRecipients, pBccReci
}
/**
* makes an Email object from a RFC mail (base64 encoded)
* makes an Email object from a RFC
*
* @param {String} pBase64RFC the RFC mail, base64 encoded
* @return {Email} a new Email object
*/
Email
.
fromRFC
=
function
(
pBase64RFC
)
{
...
...
@@ -186,7 +187,6 @@ Email.prototype.getRFCmail = function ()
//X-Uniform-Type-Identifier: com.apple.mail-draft
//this could be added later if needed
var
mailObj
=
mail
.
getCachedMail
(
mailId
);
return
mail
.
toRFC
(
mailObj
);
}
...
...
@@ -201,6 +201,8 @@ Email.prototype.openMail = function ()
/**
* ask for a download of the email
*
* @return {Array} array of [filename, EML (base64)]
*/
Email
.
prototype
.
downloadEML
=
function
()
{
...
...
@@ -211,7 +213,7 @@ Email.prototype.downloadEML = function ()
}
/**
* return
s a eml as
(base64 encoded)
*
@
return
{String} RFC mail
(base64 encoded)
*/
Email
.
prototype
.
getEML
=
function
()
{
...
...
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