Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
2003a86b
Commit
2003a86b
authored
Apr 11, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added DynField readability permission check
parent
ffe97dfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
project-base-data.tcl
lib/project-base-data.tcl
+25
-19
No files found.
lib/project-base-data.tcl
View file @
2003a86b
...
...
@@ -121,29 +121,35 @@ set im_project_on_track_bb [im_project_on_track_bb $on_track_status_id]
# Add DynField Columns to the display
db_multirow -extend
{
attrib_var value
}
project_dynfield_attribs dynfield_attribs_sql
{}
{
# Check DynField permissions
set perm
[
util_memoize
[
list
db_string perm
"select im_object_permission_p(
$dynfield
_attribute_id,
$current
_user_id, 'read')"
]]
# ns_log Notice
"project-base-data: aa_id=
$acs
_attribute_id, dynfield_id=
$dynfield
_attribute_id, name=
$attribute
_name, perm=
$perm
"
if
{
"t"
ne
$perm
}
{
continue
}
# Skip empty values
set var
${attribute_name}
_deref
set value
[
expr
$
$var
]
if
{
""
eq
[
string
trim
$value
]}
{
continue
}
# Empty values will be skipped anyway
if
{
""
!=
[
string
trim
$value
]}
{
set attrib_var
[
lang::message::lookup
""
intranet-core.$attribute_name
$attribute
_pretty_name
]
set translate_p 0
switch
$acs
_datatype
{
boolean - string
{
set translate_p 1
}
}
switch
$widget
{
im_category_tree - checkbox - generic_sql - select
{
set translate_p 1
}
richtext - textarea - text - date
{
set translate_p 0
}
}
set value_l10n
$value
if
{
$translate
_p
}
{
# ToDo: Is lang::util::suggest_key the right way? Or should we just use blank substitution?
set value_l10n
[
lang::message::lookup
""
intranet-core.
[
lang::util::suggest_key
$value
]
$value
]
}
set value
$value
_l10n
set attrib_var
[
lang::message::lookup
""
intranet-core.$attribute_name
$attribute
_pretty_name
]
set translate_p 0
switch
$acs
_datatype
{
boolean - string
{
set translate_p 1
}
}
switch
$widget
{
im_category_tree - checkbox - generic_sql - select
{
set translate_p 1
}
richtext - textarea - text - date
{
set translate_p 0
}
}
set value_l10n
$value
if
{
$translate
_p
}
{
# ToDo: Is lang::util::suggest_key the right way? Or should we just use blank substitution?
set value_l10n
[
lang::message::lookup
""
intranet-core.
[
lang::util::suggest_key
$value
]
$value
]
}
set value
$value
_l10n
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment