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
7e8da889
Commit
7e8da889
authored
6 years ago
by
Johannes Hörmann
Browse files
Options
Downloads
Patches
Plain Diff
documentation
parent
af0e302f
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/Context_lib/process.js
+30
-10
30 additions, 10 deletions
process/Context_lib/process.js
with
30 additions
and
10 deletions
process/Context_lib/process.js
+
30
−
10
View file @
7e8da889
...
...
@@ -36,12 +36,17 @@ ContextUtils.getContextName = function(pContextId)
return
pContextId
;
}
/**
*
* @param {Boolean} [pFilter=false] filter only for contexts which have a mapping in ContextUtils._getSelectMap
*
* @return {String[][]} the contexts [[contextId, contextName, contextTitle], [... ], ...]
*/
ContextUtils
.
getContexts
=
function
(
pFilter
)
{
if
(
pFilter
==
undefined
)
pFilter
=
false
;
var
contexts
=
project
.
getDataModels
(
project
.
DATAMODEL_KIND_CONTEXT
);
if
(
pFilter
)
...
...
@@ -55,23 +60,38 @@ ContextUtils.getContexts = function(pFilter)
return
contexts
.
map
(
ContextUtils
.
_contextDataMapping
).
sort
(
function
(
pContext1
,
pContext2
)
{
// sort after ContextTitle
if
(
pContext1
[
2
]
>
pContext2
[
2
])
return
1
;
{
// sort after ContextTitle
if
(
pContext1
[
2
]
>
pContext2
[
2
])
return
1
;
if
(
pContext1
[
2
]
<
pContext2
[
2
])
return
-
1
;
if
(
pContext1
[
2
]
<
pContext2
[
2
])
return
-
1
;
return
0
;
});
return
0
;
});
}
/**
* get the data of a context
*
* @param {String} pContextId the id of the context
*
* @return {String[]} the contextdata [contextId, contextName, contextTitle]
*/
ContextUtils
.
getContext
=
function
(
pContextId
)
{
return
ContextUtils
.
_contextDataMapping
(
project
.
getDataModel
(
project
.
DATAMODEL_KIND_CONTEXT
,
pContextId
));
}
/**
* map the contextData from the system.project-lib to [contextId, contextName, contextTitle]
*
* @param {String[]} pContext the data of a context (e.g. from project.getDataModel())
*
* @return {String[]} the contextdata [contextId, contextName, contextTitle]
* @ignore
*/
ContextUtils
.
_contextDataMapping
=
function
(
pContext
)
{
var
contextName
=
ContextUtils
.
getContextName
(
pContext
[
0
]);
...
...
@@ -127,7 +147,7 @@ ContextUtils.getNameSql = function(pContextId, pRowId)
}
/**
* TODO:
Evtl ein anderer Weg ohne hard gecodedeten Selects.
* TODO:
!!!temporary function until you can get fields from another Entity!!!
*/
ContextUtils
.
getContextDataSql
=
function
(
pContextId
,
pRowId
)
{
...
...
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