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
a9b1421c
Commit
a9b1421c
authored
4 years ago
by
Sebastian Listl
Browse files
Options
Downloads
Patches
Plain Diff
ContextUtils.getContexts blacklist logic changed
parent
fd008fea
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
process/Context_lib/process.js
+28
-20
28 additions, 20 deletions
process/Context_lib/process.js
process/Util_lib/process.js
+1
-1
1 addition, 1 deletion
process/Util_lib/process.js
with
29 additions
and
21 deletions
process/Context_lib/process.js
+
28
−
20
View file @
a9b1421c
...
...
@@ -269,28 +269,36 @@ ContextUtils.loadContent = function(pEntity, pUid, pFields, pExcludeIDs, pProvid
*/
ContextUtils
.
getContexts
=
function
(
pBlacklist
,
pInvertBlacklist
)
{
if
(
pInvertBlacklist
==
undefined
)
pInvertBlacklist
=
false
;
var
contexts
=
project
.
getDataModels
(
project
.
DATAMODEL_KIND_CONTEXT
);
var
contextsStandardList
=
[
"
Organisation
"
,
"
Person
"
,
"
PrivatePerson
"
,
"
Activity
"
,
"
Salesproject
"
,
"
Contract
"
,
"
Offer
"
,
"
Order
"
,
"
Product
"
,
"
Task
"
,
"
Campaign
"
,
"
CampaignStep
"
,
"
SupportTicket
"
,
"
Leadimport
"
];
contexts
=
contexts
.
filter
(
function
(
pContext
)
{
if
(
contextsStandardList
.
indexOf
(
pContext
[
0
])
>
-
1
)
return
true
;
return
false
;
});
if
(
pBlacklist
)
var
whitelist
;
if
(
pInvertBlacklist
&&
pBlacklist
)
whitelist
=
new
Set
(
pBlacklist
);
else
{
contexts
=
contexts
.
filter
(
function
(
pContext
)
{
if
(
pBlacklist
&&
pBlacklist
.
indexOf
(
pContext
[
0
])
>
-
1
!=
pInvertBlacklist
)
return
false
;
return
true
;
});
whitelist
=
new
Set
()
.
add
(
"
Organisation
"
)
.
add
(
"
Person
"
)
.
add
(
"
PrivatePerson
"
)
.
add
(
"
Activity
"
)
.
add
(
"
Salesproject
"
)
.
add
(
"
Contract
"
)
.
add
(
"
Offer
"
)
.
add
(
"
Order
"
)
.
add
(
"
Product
"
)
.
add
(
"
Task
"
)
.
add
(
"
Campaign
"
)
.
add
(
"
CampaignStep
"
)
.
add
(
"
SupportTicket
"
)
.
add
(
"
Leadimport
"
);
if
(
pBlacklist
)
pBlacklist
.
forEach
(
whitelist
[
"
delete
"
],
whitelist
);
}
var
contexts
=
project
.
getDataModels
(
project
.
DATAMODEL_KIND_CONTEXT
);
contexts
=
contexts
.
filter
(
function
(
context
)
{
return
whitelist
.
has
(
context
[
0
]);
});
return
contexts
.
map
(
ContextUtils
.
_contextDataMapping
).
sort
(
function
(
pContext1
,
pContext2
)
{
...
...
This diff is collapsed.
Click to expand it.
process/Util_lib/process.js
+
1
−
1
View file @
a9b1421c
...
...
@@ -411,7 +411,7 @@ Utils.objectValues = function (pObject)
*/
Utils
.
buildFilterObj
=
function
(
pFilterObj
,
pFieldName
,
pOperator
,
pContentType
,
pValue
,
pKey
,
pParentOperator
)
{
//TODO: maybe something like this should be inside the JditoFilter_lib, but more fluent
if
(
pParentOperator
&&
pParentOperator
!=
"
AND
"
&&
pParentOperator
!=
"
OR
"
)
throw
new
Error
(
translate
.
text
(
"
Illegal Parent Operator in buildFilterObj-Function:
"
+
pParentOperator
));
...
...
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