Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2
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
1
Merge Requests
1
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-timesheet2
Commits
5c743908
Commit
5c743908
authored
Oct 29, 2007
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed error logging hours on potential projects in the sub_proj mode
parent
36a851be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
new.tcl
www/hours/new.tcl
+15
-14
No files found.
www/hours/new.tcl
View file @
5c743908
...
...
@@ -97,12 +97,16 @@ set log_hours_on_parent_with_children_p [parameter::get_from_package_key -packag
# - task: Each task has its own space - the user needs to be member of all tasks to log hours.
set
task_visibility_scope
[
parameter::get_from_package_key -package_key
"intranet-core"
-parameter TimesheetTaskVisibilityScope -default
"sub_project"
]
# What is a closed status?
set
closed_stati_select
"select * from im_sub_categories(
[
im_project_status_closed
]
)"
if
{
!$log_hours_on_potential_project_p
}
{
append closed_stati_select
" UNION select * from im_sub_categories(
[
im_project_status_potential
]
)"
}
# Determine all the members of the "closed" super-status
set
closed_stati
[
db_list closed_stati
$closed
_stati_select
]
set
closed_stati_list
[
join
$closed
_stati
","
]
# ---------------------------------------------------------
# Logic to check if the user is allowed to log hours
...
...
@@ -238,7 +242,7 @@ if {0 != $project_id} {
where h.user_id = :user_id
and h.day = to_date
(
:julian_date, 'J'
)
)
and p.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and p.project_status_id not in
(
$closed
_stati_list
)
"
}
...
...
@@ -254,15 +258,15 @@ switch $task_visibility_scope {
where r.object_id_two = :user_id
and r.object_id_one = main.project_id
and main.tree_sortkey = tree_ancestor_key
(
sub.tree_sortkey, 1
)
and main.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and sub.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and main.project_status_id not in
(
$closed
_stati_list
)
and sub.project_status_id not in
(
$closed
_stati_list
)
"
}
"
sub_project
" {
# sub_project: Each (sub-) project determines the visibility of its tasks.
# So we are looking for the "
lowest
" in the project hierarchy subproject
# that's just above its tasks and controls the visibility of the tasks.
# There are four conditions to
get the list of the "
controlling
" projects quick
ly:
# There are four conditions to
determine the list of the "
controlling
" projects efficient
ly:
# - the controlling_project is a project
# - the task directly below the ctrl_project is a task.
# - the current user is member of the controlling project
...
...
@@ -281,8 +285,8 @@ switch $task_visibility_scope {
task.parent_id = ctrl.project_id
and ctrl.project_type_id != 100
and task.project_type_id = 100
and ctrl.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and task.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and ctrl.project_status_id not in
(
$closed
_stati_list
)
and task.project_status_id not in
(
$closed
_stati_list
)
and r.object_id_one = ctrl.project_id
and r.object_id_two = :user_id
"
...
...
@@ -294,8 +298,8 @@ switch $task_visibility_scope {
(
$ctrl
_projects_sql
)
ctrl,
im_projects sub
where ctrl.project_id = main.project_id
and main.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and sub.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and main.project_status_id not in
(
$closed
_stati_list
)
and sub.project_status_id not in
(
$closed
_stati_list
)
and sub.tree_sortkey between
main.tree_sortkey and
tree_right
(
main.tree_sortkey
)
...
...
@@ -425,7 +429,7 @@ set open_projects_sql "
acs_rels r
where r.object_id_two = :user_id
and r.object_id_one = p.project_id
and p.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and p.project_status_id not in
(
$closed
_stati_list
)
"
array set open_projects_hash {}
db_foreach open_projects
$open
_projects_sql {
...
...
@@ -444,8 +448,8 @@ if {!$log_hours_on_parent_with_children_p} {
from im_projects parent,
im_projects child
where child.parent_id = parent.project_id
and parent.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and child.project_status_id not in
(
[
join
[
im_sub_categories
[
im_project_status_closed
]]
","
]
)
and parent.project_status_id not in
(
$closed
_stati_list
)
and child.project_status_id not in
(
$closed
_stati_list
)
"
array set has_children_hash {}
db_foreach has_children
$has
_children_sql {
...
...
@@ -464,9 +468,6 @@ if {!$log_hours_on_parent_with_children_p} {
# intermediate project.
# Determine all the members of the "
closed
" super-status
set closed_stati
[
db_list closed_stati
$closed
_stati_select
]
set results ""
set ctr 0
set nbsps "
 
;
 
;
 
;
 
;
 
;
 
;
"
...
...
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