Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-resource-management
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-resource-management
Commits
fa4854ef
Commit
fa4854ef
authored
Sep 04, 2017
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Optimized page a bit
parent
e57aaf79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
intranet-resource-management-procs-percentage.tcl
tcl/intranet-resource-management-procs-percentage.tcl
+27
-12
No files found.
tcl/intranet-resource-management-procs-percentage.tcl
View file @
fa4854ef
...
...
@@ -200,6 +200,8 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
# ------------------------------------------------------------
ns_log Notice
"percentage-report: Absences - Determine when the user is away"
# key: julian-uid, value: absence_type_id
# 458004-624 5000 2458001-624 5000 2458005-624 5000 2458002-624 5000 2458003-624 5000
#
array set absences_hash
[
im_resource_mgmt_resource_planning_percentage_absences
\
-report_start_date
$report
_start_date
\
...
...
@@ -308,7 +310,7 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
# Store properties into hashes for quick access later
set object_name_hash
(
$project
_id
)
$project
_name
set object_type_hash
(
$project
_id
)
"im_project"
set
pro
ject_parent_hash
(
$project
_id
)
$parent
_id
set
ob
ject_parent_hash
(
$project
_id
)
$parent
_id
set project_start_julian_hash
(
$project
_id
)
$child
_start_julian
set project_end_julian_hash
(
$project
_id
)
$child
_end_julian
set project_level_hash
(
$project
_id
)
$level
...
...
@@ -351,7 +353,7 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
order by cc.cost_center_code
"
db_foreach ccs
$cc
_sql
{
set
cc
_parent_hash
(
$cost
_center_id
)
$parent
_id
set
object
_parent_hash
(
$cost
_center_id
)
$parent
_id
set object_type_hash
(
$cost
_center_id
)
"im_cost_center"
set object_name_hash
(
$cost
_center_id
)
$cost
_center_name
set collapse_hash
(
$cost
_center_id
)
"o"
...
...
@@ -364,14 +366,14 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
set val
$object
_availability_hash
(
$parent
_cc_id
)
set val
[
expr
$val
+
$resources
_available_percent
]
set object_availability_hash
(
$parent
_cc_id
)
$val
set parent_cc_id
$
cc
_parent_hash
(
$parent
_cc_id
)
set parent_cc_id
$
object
_parent_hash
(
$parent
_cc_id
)
incr cnt
if
{
$cnt
> 20
}
{
ad_return_complaint 1
"Percentage Report:<br>Infinite loop in dept aggregation"
}
}
}
# Setup a fake
"Freelancers"
department below
"The Company"
set
cc
_parent_hash
(
$freelancers
_department
)
$default
_department
set
object
_parent_hash
(
$freelancers
_department
)
$default
_department
set object_type_hash
(
$freelancers
_department
)
"im_cost_center"
set object_name_hash
(
$freelancers
_department
)
[
lang::message::lookup
""
intranet-core.No_Department
"No Department"
]
set collapse_hash
(
$freelancers
_department
)
"o"
...
...
@@ -423,7 +425,7 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
set user_hash
(
$user
_id
)
$user
_id
set object_name_hash
(
$user
_id
)
$user
_name
set object_type_hash
(
$user
_id
)
"user"
set
user_departm
ent_hash
(
$user
_id
)
$department
_id
set
object_par
ent_hash
(
$user
_id
)
$department
_id
set object_availability_hash
(
$user
_id
)
$availability
set collapse_hash
(
$user
_id
)
"c"
}
...
...
@@ -481,20 +483,20 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
# Found a standard assignment:
$project
_id-$user_id: Calculate parent_list
set parent_list
[
list
$project
_id
]
set pid
$
pro
ject
_parent_hash
(
$project
_id
)
set pid
$
ob
ject
_parent_hash
(
$project
_id
)
while
{
""
ne
$pid
}
{
lappend parent_list
$pid
set pid
$
pro
ject
_parent_hash
(
$pid
)
set pid
$
ob
ject
_parent_hash
(
$pid
)
}
# Append the user assigned
lappend parent_list
$user
_id
# Append the user's cost center and it's parents
set cc_id
$
user
_departm
ent_hash
(
$user
_id
)
set cc_id
$
object
_par
ent_hash
(
$user
_id
)
while
{
""
ne
$cc
_id
}
{
lappend parent_list
$cc
_id
set cc_id
$
cc
_parent_hash
(
$cc
_id
)
set cc_id
$
object
_parent_hash
(
$cc
_id
)
}
set parent_list
[
lreverse
$parent
_list
]
lappend left_dimension
$parent
_list
...
...
@@ -507,10 +509,10 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
set parent_list
[
list
$user
_id
]
# Append the user's cost center and it's parents
set cc_id
$
user
_departm
ent_hash
(
$user
_id
)
set cc_id
$
object
_par
ent_hash
(
$user
_id
)
while
{
""
ne
$cc
_id
}
{
lappend parent_list
$cc
_id
set cc_id
$
cc
_parent_hash
(
$cc
_id
)
set cc_id
$
object
_parent_hash
(
$cc
_id
)
}
set parent_list
[
lreverse
$parent
_list
]
lappend left_dimension
$parent
_list
...
...
@@ -737,7 +739,7 @@ ad_proc -public im_resource_mgmt_resource_planning_percentage {
Availability of the user for project work"
]
# Check for users with an empty department - create an error message
if {
$company
_cost_center eq
$
user
_departm
ent_hash(
$object
_id)} {
if {
$company
_cost_center eq
$
object
_par
ent_hash(
$object
_id)} {
set availability_html "
<font color=red><b>$availability_html</b></font>
"
set availability_title
[
lang::message::lookup
""
intranet-resource-management.User_without_department
"Please check the department of this user."
]
}
...
...
@@ -1099,3 +1101,16 @@ ad_proc -public im_resource_management_collapse_left_dimension {
return
$result
}
ad_proc -public im_resource_mgmt_top_entry_to_julian
{
top_vars top_entry
}
{
Converts a entry of the top dimension to a julian date
}
{
ns_log Notice
"im_resource_mgmt_top_entry_to_julian: top_vars=
$top
_vars top_entry=
$top
_entry"
ad_return_complaint 1
"<pre>im_resource_mgmt_top_entry_to_julian: top_vars=
$top
_vars top_entry=
$top
_entry</pre>"
return 2457997
}
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