Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADITO_Update_Upgrade
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository 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
ADITO_Update_Upgrade
Commits
fc610dac
Commit
fc610dac
authored
5 years ago
by
Johannes Goderbauer
Browse files
Options
Downloads
Patches
Plain Diff
some Keyword-functions: locale-param added
parent
aa12fbd1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/Keyword_lib/process.js
+12
-10
12 additions, 10 deletions
process/Keyword_lib/process.js
with
12 additions
and
10 deletions
process/Keyword_lib/process.js
+
12
−
10
View file @
fc610dac
...
...
@@ -34,7 +34,7 @@ KeywordUtils.getResolvedTitleSqlPart = function(pContainerName, pDbFieldName, pL
* <br/>if the key could not be found an empty string "" is returned
* @param {String} keywordContainer specifies the type of the keyword and therefore the list elements; e.g. "COUNTRY"
* @param {String} key id value of the keyword where the view-value shall be searched
* @param {String} [locale] Language-value for translations
* @param {String} [locale
=locale depending on current client/servercontext
] Language-value for translations
* @return {String} representation of the translated name of the keyword-key
* @example
* var histMedium;
...
...
@@ -153,16 +153,17 @@ KeywordUtils.getContainerNames = function()
* usefull for lists where the key is the name which is then a editable displayValue
*
* @param {String} pContainerName name of the keyword container for filtering
* @param {String} [pLocale=locale depending on current client/servercontext] Language-value for translations
*
* @return {String[]} translated titles as 1D-Array
*/
KeywordUtils
.
getEntryNamesByContainer
=
function
(
pContainerName
)
KeywordUtils
.
getEntryNamesByContainer
=
function
(
pContainerName
,
pLocale
)
{
var
sql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
AB_KEYWORD_ENTRY.CONTAINER
"
,
pContainerName
)
.
buildSql
(
"
select AB_KEYWORD_ENTRY.TITLE from AB_KEYWORD_ENTRY
"
,
null
,
"
order by AB_KEYWORD_ENTRY.SORTING asc, AB_KEYWORD_ENTRY.TITLE asc
"
)
var
list
=
db
.
array
(
db
.
COLUMN
,
sql
).
map
(
function
(
v
){
return
translate
.
text
(
v
);
return
pLocale
?
translate
.
text
(
v
,
pLocale
)
:
translate
.
text
(
v
);
});
return
list
;
};
...
...
@@ -173,19 +174,20 @@ KeywordUtils.getEntryNamesByContainer = function(pContainerName)
* usefull for lists where the key is the name which is then a editable displayValue
*
* @param {String} pContainerName name of the keyword container for filtering
* * @param {String} [pLocale=locale depending on current client/servercontext] Language-value for translations
*
* @return {String[]} translated
t
itle
s as 1D-Array
* @return {String[]}
2D-Array in the form of [[id1,
translated
T
itle
1], [idN, translatedTitleN]]
*/
KeywordUtils
.
getEntryNamesAndIdsByContainer
=
function
(
pContainerName
)
KeywordUtils
.
getEntryNamesAndIdsByContainer
=
function
(
pContainerName
,
pLocale
)
{
var
sql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
AB_KEYWORD_ENTRY.CONTAINER
"
,
pContainerName
)
.
buildSql
(
"
select AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID, AB_KEYWORD_ENTRY.TITLE from AB_KEYWORD_ENTRY
"
,
null
,
"
order by AB_KEYWORD_ENTRY.SORTING asc, AB_KEYWORD_ENTRY.TITLE asc
"
)
var
list
=
db
.
table
(
sql
)
;
for
(
var
i
=
0
;
i
<
list
.
length
;
i
=
i
+
1
)
list
[
i
][
1
]
=
translate
.
text
(
list
[
i
][
1
])
;
var
list
=
db
.
table
(
sql
)
.
map
(
function
(
elem
){
elem
[
1
]
=
pLocale
?
translate
.
text
(
elem
[
1
],
pLocale
)
:
translate
.
text
(
elem
[
1
]);
return
elem
;
});
return
list
;
};
...
...
@@ -295,7 +297,7 @@ LanguageKeywordUtils.getResolvedTitleSqlPart = function(pDbFieldName, pLocale)
* returns a specific name (translated) - this is normally the view-value of a language
*
* @param {String} key id value of the language where the view-value shall be searched
* @param {String} [locale] Language-value for translations
* @param {String} [locale
=locale depending on current client/servercontext
] Language-value for translations
*
* @return {String} representation of the translated name
*
...
...
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