Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-riskmanagement
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-riskmanagement
Commits
a891f33e
Commit
a891f33e
authored
Mar 25, 2019
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Enabled support for programs
parent
9eb9ec4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
risk-project-component.tcl
lib/risk-project-component.tcl
+9
-18
No files found.
lib/risk-project-component.tcl
View file @
a891f33e
...
...
@@ -25,26 +25,11 @@ set return_url [im_url_with_query]
# Define constants for classifying risks
# ---------------------------------------------------------
set
project_budget
[
db_string budget
"
select project_budget
from im_projects
where project_id = :project_id
"
-default 0
]
# Classifiers for impact and probability.
# Each classified starts with 0 and ends at "ininite"
set
impact_classifier
[
list
0 5 10 20 30 100
]
set
probab_classifier
[
list
0 5 10 20 30 100
]
set
probab_classifier_values
$probab
_classifier
set
impact_classifier_values
{}
foreach
i
$impact
_classifier
{
catch
{
lappend impact_classifier_values
[
expr
{
1.0 *
$project
_budget *
$i
/ 100.0
}]
}
}
ad_proc im_risk_chart_classify
{
-value:required
...
...
@@ -160,7 +145,11 @@ foreach varname [info locals] {
set
criteria
{}
if
{[
info
exists project_id
]
&&
""
!=
$project
_id && 0 !=
$project
_id
}
{
lappend criteria
"r.risk_project_id = :project_id"
lappend criteria
"
(r.risk_project_id = :project_id OR
r.risk_project_id in (select pp.project_id from im_projects pp where pp.program_id = :project_id)
)
"
}
else
{
lappend criteria
"r.risk_project_id in (
select project_id
...
...
@@ -212,9 +201,11 @@ if {[llength $criteria] > 0} { set where_clause "and $where_clause" }
set
risk_sql
"
select o.*,
r.*,
round( least(100.0 * r.risk_impact / greatest(coalesce(p.project_budget,0.0), 0.01), 100)) as risk_impact_percent,
im_category_from_id(r.risk_type_id) as risk_type,
im_category_from_id(r.risk_status_id) as risk_status,
p.project_name as risk_project_name,
coalesce(p.project_budget, 0.0) as project_budget,
im_name_from_user_id(o.creation_user) as creation_user_name
from acs_objects o,
im_risks r
...
...
@@ -245,8 +236,8 @@ db_foreach risks $risk_sql -bind $form_vars {
append table_body_html
$row
_html
# Classify risks for the 3x3 risk overview
set impact_class
[
im_risk_chart_classify -value
$risk
_impact
-classifier
$impact
_classifier_values
]
set probab_class
[
im_risk_chart_classify -value
$risk
_probability_percent -classifier
$probab
_classifier
_values
]
set impact_class
[
im_risk_chart_classify -value
$risk
_impact
_percent -classifier
$impact
_classifier
]
set probab_class
[
im_risk_chart_classify -value
$risk
_probability_percent -classifier
$probab
_classifier
]
if
{
""
==
$impact
_class ||
""
==
$probab
_class
}
{
ad_return_complaint 1
"impact=
$impact
_class, prob=
$probab
_class"
}
...
...
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