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 11.04.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
basic
Commits
6692d687
Commit
6692d687
authored
3 years ago
by
v.broens
Browse files
Options
Downloads
Patches
Plain Diff
zwischenspeicher
parent
dcfc01e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/mailbridge_service/process.js
+15
-50
15 additions, 50 deletions
process/mailbridge_service/process.js
with
15 additions
and
50 deletions
process/mailbridge_service/process.js
+
15
−
50
View file @
6692d687
...
...
@@ -129,7 +129,7 @@ TicketMailbridgeUtils.getInboxInformationAllRecipients = function(pRecipients, p
.
whereIfSet
(
"
inbox.inboxid
"
,
inboxObj
[
"
inboxID
"
][
0
])
.
table
();
inboxObj
[
"
attributeFilterArray
"
]
=
newSelect
(
"
ATTRIBUTE_FILTERID, RTRIM(COMPONENT), SEARCHTERM
, COMPARISON_METHOD, THRESHOLD
"
)
inboxObj
[
"
attributeFilterArray
"
]
=
newSelect
(
"
ATTRIBUTE_FILTERID, RTRIM(COMPONENT), SEARCHTERM
"
)
.
from
(
"
ATTRIBUTE_FILTER
"
)
.
join
(
"
INBOXFILTERGROUP
"
,
"
INBOXFILTERGROUP.INBOXFILTERGROUPID = ATTRIBUTE_FILTER.INBOXFILTERGROUP_ID
"
)
.
join
(
"
INBOXFILTERGROUP_RELATION
"
,
"
INBOXFILTERGROUP_RELATION.INBOXFILTERGROUP_ID = INBOXFILTERGROUP.INBOXFILTERGROUPID
"
)
...
...
@@ -663,18 +663,19 @@ TicketMailbridgeUtils.createTicket = function(pMailObject, pFilterResult, pInbox
// sending Automatic Answeremail
if
(
answerMail
!=
""
&&
answerMail
!=
undefined
&&
answerMailActive
!=
""
&&
answerMailActive
==
true
)
{
logging
.
log
(
answerMail
);
var
eml
=
new
Email
();
eml
.
sender
=
mailRec
||
inboxUser
;
eml
.
subject
=
ticketSub
+
"
[
"
+
ticketCode
+
"
]
"
;
eml
.
body
=
DocumentTemplateUtils
.
getTemplate
(
answerMail
)
+
"
\n
"
+
DocumentTemplateUtils
.
getTemplate
(
signature
)
;
eml
.
body
=
DocumentTemplateUtils
.
getTemplate
(
answerMail
,
false
)
+
"
\n
"
+
DocumentTemplateUtils
.
getTemplate
(
signature
,
false
)
;
eml
.
toRecipients
=
[
persFrom
];
logging
.
log
(
JSON
.
stringify
(
DocumentTemplateUtils
.
getTemplate
(
answerMail
)));
// overwrite eml.body with individual answer, if individual answer template is set for the selected ticket template
var
indiAns
=
TicketTemplateUtils
.
checkIndividualAnswer
(
ticketTemplateId
[
0
]);
if
(
indiAns
!=
""
&&
indiAns
!=
undefined
)
{
eml
.
body
=
DocumentTemplateUtils
.
getTemplate
(
indiAns
)
+
"
\n
"
+
DocumentTemplateUtils
.
getTemplate
(
signature
);
eml
.
body
=
DocumentTemplateUtils
.
getTemplate
(
indiAns
,
false
)
+
"
\n
"
+
DocumentTemplateUtils
.
getTemplate
(
signature
,
false
);
}
// overwrite eml.sender with answer mail address, if answer mail address is set for the selected inbox
...
...
@@ -789,51 +790,23 @@ TicketMailbridgeUtils.setTicketCodeRegex = function(pRegexString){
TicketMailbridgeUtils
.
useAttributeFilter
=
function
(
pInboxObj
,
pTicketID
,
pMailObject
)
{
var
attributeFilters
=
pInboxObj
[
"
attributeFilterArray
"
];
var
fixAttributeFilters
=
[];
var
probabiltityAttributeFilters
=
[];
var
matchedAttributeFilterIds
=
[];
var
attributesToInsert
=
[];
var
attributeIds
=
[];
var
inserts
=
[];
var
IDX_COMP_METHOD
=
3
;
var
IDX_MAX_COUNT
=
0
;
var
IDX_EXISTING_ATTRS
=
1
;
var
IDX_ATTRIBUTEID
=
0
;
var
attributeCountObj
=
{};
var
logMessageFix
=
""
;
var
logMessageProbability
=
""
;
// Divide fixed and probability attribute filer
attributeFilters
.
forEach
(
function
(
attributeFilter
){
if
(
attributeFilter
[
IDX_COMP_METHOD
]
==
$KeywordRegistry
.
attributeFilterComparisonMethod
$fix
())
{
fixAttributeFilters
.
push
(
attributeFilter
);
}
else
{
probabiltityAttributeFilters
.
push
(
attributeFilter
);
}
});
// searches for the appropriate fix attribute filter ids
if
(
fixAttributeFilters
.
length
>
0
)
if
(
attributeFilters
.
length
>
0
)
{
var
resultCheckFixAttrFilters
=
TicketMailbridgeUtils
.
checkAttributeFilters
(
fixAttributeFilters
,
pMailObject
,
$KeywordRegistry
.
attributeFilterComparisonMethod
$fix
());
matchedAttributeFilterIds
=
resultCheckFixAttrFilters
[
0
];
logMessageFix
=
resultCheckFixAttrFilters
[
1
];
}
// searches for the appropriate probability attribute filter ids
if
(
probabiltityAttributeFilters
.
length
>
0
)
{
var
resultCheckProbabilityAttrFilters
=
TicketMailbridgeUtils
.
checkAttributeFilters
(
fixAttributeFilters
,
pMailObject
,
$KeywordRegistry
.
attributeFilterComparisonMethod
$probability
());
matchedAttributeFilterIds
.
concat
(
resultCheckProbabilityAttrFilters
[
0
]);
logMessageProbability
=
resultCheckProbabilityAttrFilters
[
1
];
// searches for the appropriate fix attribute filter ids
var
resultCheckFixAttrFilters
=
TicketMailbridgeUtils
.
checkAttributeFilters
(
attributeFilters
,
pMailObject
);
matchedAttributeFilterIds
=
resultCheckFixAttrFilters
[
0
];
var
logMessage
=
resultCheckFixAttrFilters
[
1
];
}
var
logMessage
=
logMessageFix
+
"
\n
"
+
logMessageProbability
if
(
matchedAttributeFilterIds
.
length
>
0
)
if
(
matchedAttributeFilterIds
.
length
>
0
)
{
// Fetches the stored attributes of the matching attribute filter
attributesToInsert
=
newSelect
(
"
distinct AB_ATTRIBUTE_ID, CHAR_VALUE, ID_VALUE, DATE_VALUE, NUMBER_VALUE, INT_VALUE
"
)
...
...
@@ -907,17 +880,16 @@ TicketMailbridgeUtils.useAttributeFilter = function(pInboxObj, pTicketID, pMailO
/*
* checks for possible attribute filters and returns the matching attributefilter IDs and a log message
*
* @param p
Fix
AttributeFilters {Array} the detected attribute filters
* @param pAttributeFilters {Array}
the detected attribute filters
* @param pMailObject {Object} the inbox object created in funktion TicketMailbridgeUtils.getInboxInformation()
* @param pKind {String} the kind of serch
*
* @return {Array} structure: [[attributeFilterId], logMessage]
*/
TicketMailbridgeUtils
.
checkAttributeFilters
=
function
(
p
Fix
AttributeFilters
,
pMailObject
,
pKind
)
TicketMailbridgeUtils
.
checkAttributeFilters
=
function
(
pAttributeFilters
,
pMailObject
)
{
var
filterResult
;
p
Fix
AttributeFilters
.
forEach
(
function
([
attributeFilterId
,
component
,
searchterm
,
coparisonMethod
,
threshold
]){
pAttributeFilters
.
forEach
(
function
([
attributeFilterId
,
component
,
searchterm
]){
var
textToSearch
;
searchterm
=
searchterm
||
""
;
...
...
@@ -938,14 +910,7 @@ TicketMailbridgeUtils.checkAttributeFilters = function(pFixAttributeFilters, pMa
break
;
}
textToSearch
=
textToSearch
||
""
;
if
(
pKind
==
$KeywordRegistry
.
attributeFilterComparisonMethod
$fix
())
{
filterResult
=
TicketMailbridgeUtils
.
checkFixAttributeFilters
(
searchterm
,
attributeFilterId
,
textToSearch
,
component
);
}
else
if
(
pKind
==
$KeywordRegistry
.
attributeFilterComparisonMethod
$probability
())
{
filterResult
=
TicketMailbridgeUtils
.
checkProbabilityAttributeFilters
(
searchterm
,
attributeFilterId
,
textToSearch
,
component
);
}
filterResult
=
TicketMailbridgeUtils
.
checkFixAttributeFilters
(
searchterm
,
attributeFilterId
,
textToSearch
,
component
);
});
return
filterResult
;
...
...
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