Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-cost
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-cost
Commits
d79d7a6f
Commit
d79d7a6f
authored
Mar 27, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue after replacing category with sub-categories
parent
68b30c9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
intranet-cost-center-procs.tcl
tcl/intranet-cost-center-procs.tcl
+3
-11
No files found.
tcl/intranet-cost-center-procs.tcl
View file @
d79d7a6f
...
...
@@ -435,11 +435,7 @@ ad_proc -public im_cc_read_p {
if
{
0 ==
$user
_id
}
{
set user_id
[
ad_conn user_id
]
}
if
{
0 ==
$cost
_center_id
}
{
set cost_center_id
[
im_cost_center_company
]
}
if
{
0 !=
$cost
_type_id
}
{
set privilege
[
util_memoize
[
list
db_string priv
"
select read_privilege
from im_cost_types
where cost_type_id in (select * from im_sub_categories(
$cost
_type_id))
"
-default
""
]]
set privilege
[
util_memoize
[
list
db_string priv
"select read_privilege from im_cost_types where cost_type_id =
$cost
_type_id"
-default
""
]]
}
if
{
""
==
$privilege
}
{
set privilege
"fi_read_all"
}
...
...
@@ -471,11 +467,7 @@ ad_proc -public im_cc_write_p {
if
{
0 ==
$user
_id
}
{
set user_id
[
ad_conn user_id
]
}
if
{
0 ==
$cost
_center_id
}
{
set cost_center_id
[
im_cost_center_company
]
}
if
{
0 !=
$cost
_type_id
}
{
set privilege
[
util_memoize
[
list
db_string priv
"
select write_privilege
from im_cost_types
where cost_type_id in (select * from im_sub_categories(
$cost
_type_id))
"
-default
""
]]
set privilege
[
util_memoize
[
list
db_string priv
"select write_privilege from im_cost_types where cost_type_id =
$cost
_type_id"
-default
""
]]
}
if
{
""
==
$privilege
}
{
set privilege
"fi_write_all"
}
...
...
@@ -516,7 +508,7 @@ ad_proc -public im_cost_center_write_p_helper {
return
[
db_string cc_perms
"
select im_object_permission_p(:cost_center_id, :user_id, ct.write_privilege)
from im_cost_types ct
where ct.cost_type_id
in (select * from im_sub_categories(:cost_type_id))
where ct.cost_type_id
= :cost_type_id
"
-default
"f"
]
}
...
...
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