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
59123325
Commit
59123325
authored
Nov 25, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Gustaf changes
parent
5769bdc8
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
59 additions
and
59 deletions
+59
-59
risk-project-component.adp
lib/risk-project-component.adp
+6
-6
risk-project-component.tcl
lib/risk-project-component.tcl
+11
-11
action.tcl
www/action.tcl
+1
-1
delete.tcl
www/delete.tcl
+5
-5
graph.tcl
www/graph.tcl
+3
-3
index.adp
www/index.adp
+6
-6
index.tcl
www/index.tcl
+1
-1
new-2.tcl
www/new-2.tcl
+4
-4
new-typeselect.adp
www/new-typeselect.adp
+3
-3
new-typeselect.tcl
www/new-typeselect.tcl
+1
-1
new.adp
www/new.adp
+4
-4
new.tcl
www/new.tcl
+4
-4
project-risks-report.tcl
www/project-risks-report.tcl
+3
-3
test.tcl
www/test.tcl
+1
-1
test2.tcl
www/test2.tcl
+1
-1
view.tcl
www/view.tcl
+5
-5
No files found.
lib/risk-project-component.adp
View file @
59123325
...
...
@@ -2,13 +2,13 @@
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign=
top
>
<td valign=
"top"
>
</td>
<td valign=
top
>
<td valign=
"top"
>
<table align=
right border=0 cellpadding=0 cellspacing=0
>
<tr valign=
bottom
>
<table align=
"right" border="0" cellpadding="0" cellspacing="0"
>
<tr valign=
"bottom"
>
<td>
<div style="float: left; position: relative; -moz-transform: rotate(270deg); -o-transform: rotate(270deg); -webkit-transform: rotate(270deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3);"><%= [lang::message::lookup "" intranet-riskmanagement.Impact Impact] %></div>
</td>
...
...
@@ -20,13 +20,13 @@
</tr>
<tr>
<td> </td>
<td align=
center
><%= [lang::message::lookup "" intranet-riskmanagement.Probability Probability] %></td>
<td align=
"center"
><%= [lang::message::lookup "" intranet-riskmanagement.Probability Probability] %></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=
2
>
<td colspan=
"2"
>
<div class="risk_table">
<form action="/intranet-riskmanagement/action" method=GET>
<%= [export_vars -form {return_url}] %>
...
...
lib/risk-project-component.tcl
View file @
59123325
...
...
@@ -36,7 +36,7 @@ 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
]
lappend impact_classifier_values
[
expr
{
1.0 *
$project
_budget *
$i
/ 100.0
}
]
}
}
...
...
@@ -55,7 +55,7 @@ ad_proc im_risk_chart_classify {
set result
""
for
{
set
i 0
}
{
$i
<=
[
llength
$classifier
]}
{
incr
i
}
{
set low
[
lindex
$classifier
$i
]
set high
[
lindex
$classifier
[
expr
$i
+1
]
]
set high
[
lindex
$classifier
$i
+1
]
if
{
$value
>=
$low
&&
$value
<=
$high
}
{
set result
$i
break
...
...
@@ -64,7 +64,7 @@ ad_proc im_risk_chart_classify {
if
{
""
==
$result
}
{
if
{
$value
>=
$high
}
{
set result
[
expr
[
llength
$classifier
]
-2
]
set result
[
expr
{[
llength
$classifier
]
-2
}
]
}
}
...
...
@@ -78,7 +78,7 @@ ad_proc im_risk_chart_bg_color {
}
{
Returns a suitable background color for x/y coordinates
}
{
set sum
[
expr
$x
+
$y
]
set sum
[
expr
{
$x
+
$y
}
]
switch
$sum
{
0
{
return
"#00FF00"
}
1
{
return
"#80FF80"
}
...
...
@@ -165,7 +165,7 @@ array set chart_ids_hash {}
db_foreach risks
$risk
_sql
{
# Format columns for the list view
set row_html
"<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
\n
"
set row_html
"<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
\n
"
foreach column_var
$column
_vars
{
append row_html
"
\t
<td valign=top><nobr>"
set cmd
"append row_html
$column
_var"
...
...
@@ -186,7 +186,7 @@ db_foreach risks $risk_sql {
# Chart Hash - Number of risks in the cell
set v 0
if
{[
info
exists chart_hash
(
$key
)]}
{
set v
$chart
_hash
(
$key
)
}
set v
[
expr
$v
+ 1
]
set v
[
expr
{
$v
+ 1
}
]
set chart_hash
(
$key
)
$v
# Chart risk_ids Hash - The IDs of the risks in the cell
...
...
@@ -200,18 +200,18 @@ db_foreach risks $risk_sql {
# Format the risk summary chart
set
risk_chart_header
"<td width=20></td>"
for
{
set
x 0
}
{
$x
<
[
expr
[
llength
$probab
_classifier
]
-1
]}
{
incr
x
}
{
set val
[
lindex
$probab
_classifier
[
expr
$x
+1
]
]
for
{
set
x 0
}
{
$x
<
[
expr
{[
llength
$probab
_classifier
]
-1
}
]}
{
incr
x
}
{
set val
[
lindex
$probab
_classifier
$x
+1
]
append risk_chart_header
"<td width=20 align=center>
$val
</td>
\n
"
}
set
risk_chart_header
"<tr>
$risk
_chart_header</tr>
\n
"
set
risk_chart_html
"<table id=risk_chart border=1 align=right style='border-collapse:separate'>
\n
"
for
{
set
y
[
expr
[
llength
$impact
_classifier
]
-2
]}
{
$y
>= 0
}
{
incr
y -1
}
{
for
{
set
y
[
expr
{[
llength
$impact
_classifier
]
-2
}
]}
{
$y
>= 0
}
{
incr
y -1
}
{
set risk_chart_line
""
set val
[
lindex
$impact
_classifier
[
expr
$y
+1
]
]
set val
[
lindex
$impact
_classifier
$y
+1
]
append risk_chart_line
"<tr>
\n
<td align=right width=
$cell
_width>
$val
</td>
\n
"
for
{
set
x 0
}
{
$x
<
[
expr
[
llength
$probab
_classifier
]
-1
]}
{
incr
x
}
{
for
{
set
x 0
}
{
$x
<
[
expr
{[
llength
$probab
_classifier
]
-1
}
]}
{
incr
x
}
{
set key
"
$y-$x
"
set v
""
if
{[
info
exists chart_hash
(
$key
)]}
{
set v
$chart
_hash
(
$key
)
}
...
...
www/action.tcl
View file @
59123325
...
...
@@ -23,7 +23,7 @@ ad_page_contract {
return_url
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
user_name
[
im_name_from_user_id
[
ad_conn user_id
]]
if
{
""
!=
$action
_id
}
{
set action
[
im_category_from_id -translate_p 0
$action
_id
]
}
...
...
www/delete.tcl
View file @
59123325
...
...
@@ -30,14 +30,14 @@ ad_page_contract {
{
project_id
""
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
if
{
!
[
im_permission
$user
_id
"add_risks"
]}
{
ad_return_complaint
"Insufficient Privileges"
"
<li>You don't have sufficient privileges to add/modify risks."
}
if
{
!
[
info
exists state
]
||
$state
==
""
}
{
if
{
!
[
info
exists state
]
||
$state
eq
""
}
{
set state
"pending"
}
...
...
@@ -51,13 +51,13 @@ switch $state {
}
"approved"
{
if
{
$risk
_id > 0
}
{
if
[
catch
{
if
{
[
catch
{
db_dml delete_risk
"DELETE from im_risks where risk_id = :risk_id"
}
errmsg
]
{
}
errmsg
]
}
{
ad_return_complaint
"Argument Error"
"<ul>
$errmsg
</ul>"
}
}
if
{
[
info
exists return_url
]
&&
!
[
empty_string_p
$return
_url
]
}
{
if
{
[
info
exists return_url
]
&&
$return
_url ne
""
}
{
ad_returnredirect
"
$return
_url"
}
else
{
ad_returnredirect
"/intranet/projects/view?project_id=
$project
_id"
...
...
www/graph.tcl
View file @
59123325
...
...
@@ -23,14 +23,14 @@ ad_page_contract {
project_id:integer
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
if
{
!
[
im_permission
$user
_id
"view_risks"
]}
{
ad_return_complaint
"Insufficient Privileges"
"
<li>You don't have sufficient privileges to see risks."
}
if
{[
info
exists project_id
]
&&
!
[
empty_string_p
$project
_id
]
&&
$project
_id > 0
}
{
if
{[
info
exists project_id
]
&&
$project
_id ne
""
&&
$project
_id > 0
}
{
set sql
"select r.*, n.project_name from im_risks r, (select project_name from im_projects where project_id = :project_id) n where project_id = :project_id"
set data
[
list
]
...
...
@@ -50,7 +50,7 @@ if {[info exists project_id] && ![empty_string_p $project_id] && $project_id > 0
if
{
[
llength
$data
]
< 1
}
{
set page_body
"<br><b>This project doesn't seem to have any risks.</b>
\n
"
}
else
{
set x_axis
[
list
0
[
expr
$max
_impact * 1.1
]
[
im_get_axis
$max
_impact 10
]
"€"
]
set x_axis
[
list
0
[
expr
{
$max
_impact * 1.1
}
]
[
im_get_axis
$max
_impact 10
]
"€"
]
set y_axis
[
list
0 101 10
"%"
]
set page_body
[
im_get_chart
$x
_axis
$y
_axis
$data
$settings
]
}
...
...
www/index.adp
View file @
59123325
<master>
<property name="
title">@page_title
@</property>
<property name="context">@context_bar@</property>
<property name="main_navbar_label">@main_navbar_label@</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</property>
<property name="show_context_help">@show_context_help_p;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context_bar
;literal
@</property>
<property name="main_navbar_label">@main_navbar_label
;literal
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<property name="left_navbar">@left_navbar_html;
literal
@</property>
<property name="show_context_help">@show_context_help_p;
literal
@</property>
<if @master_p@>
...
...
www/index.tcl
View file @
59123325
...
...
@@ -24,7 +24,7 @@ ad_page_contract {
set
return_url
[
im_url_with_query
]
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
set
page_title
[
lang::message::lookup
""
intranet-riskmanagement.Risks
"Risks"
]
set
context_bar
[
im_context_bar
$page
_title
]
set
main_navbar_label
"projects"
...
...
www/new-2.tcl
View file @
59123325
...
...
@@ -40,7 +40,7 @@ ad_page_contract {
return_url
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
if
{
!
[
im_permission
$user
_id
"add_risks"
]}
{
ad_return_complaint
"Insufficient Privileges"
"
...
...
@@ -67,7 +67,7 @@ if { $exception_count > 0 } {
if
{
$risk
_id > 0
}
{
if
[
catch
{
if
{
[
catch
{
db_dml update_risk
"UPDATE
im_risks SET
owner_id = :owner_id,
...
...
@@ -77,7 +77,7 @@ if {$risk_id > 0} {
title = :title,
description = :description WHERE
risk_id = :risk_id"
}
errmsg
]
{
}
errmsg
]
}
{
ad_return_complaint
"Argument Error"
"<ul>
$errmsg
</ul>"
return
...
...
@@ -94,7 +94,7 @@ if {$risk_id > 0} {
db_release_unused_handles
if
{
[
info
exists return_url
]
&&
!
[
empty_string_p
$return
_url
]
}
{
if
{
[
info
exists return_url
]
&&
$return
_url ne
""
}
{
ad_returnredirect
"
$return
_url"
}
else
{
ad_returnredirect
"/intranet/projects/view?project_id=
$project
_id"
...
...
www/new-typeselect.adp
View file @
59123325
<master>
<property name="
title">@page_title
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="main_navbar_label"></property>
<%= [im_box_header $page_title] %>
...
...
@@ -7,7 +7,7 @@
<form action='@return_url;noquote@' method=POST>
<%= [export_vars -form {return_url risk_id risk_nr risk_name}] %>
<table cellspacing=
2 cellpadding=2
>
<table cellspacing=
"2" cellpadding="2"
>
<if "" eq @risk_type_id@>
<tr class=rowodd>
...
...
@@ -24,7 +24,7 @@
<tr class=roweven>
<td></td>
<td><input type=
submit
value='<%= [lang::message::lookup "" intranet-core.Continue "Continue"] %>'></td>
<td><input type=
"submit"
value='<%= [lang::message::lookup "" intranet-core.Continue "Continue"] %>'></td>
</tr>
</table>
...
...
www/new-typeselect.tcl
View file @
59123325
...
...
@@ -21,7 +21,7 @@ ad_page_contract {
# No permissions necessary, that's handled by the object's new page
# Here we just select an object_type_id for the given object.
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
set
page_title
[
lang::message::lookup
""
intranet-riskmanagement.Please_Select_a_Risk_Type
"Please Select a Risk Type"
]
set
context_bar
[
im_context_bar
$page
_title
]
...
...
www/new.adp
View file @
59123325
<if @enable_master_p@><master></if>
<property name="
title">@page_title
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">riskmanagement</property>
<property name="focus">@focus;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT>
...
...
www/new.tcl
View file @
59123325
...
...
@@ -74,7 +74,7 @@ if {![info exists task]} {
# Default & Security
# ------------------------------------------------------------------
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
set
user_id
$current
_user_id
set
current_url
[
im_url_with_query
]
set
action_url
"/intranet-riskmanagement/new"
...
...
@@ -95,7 +95,7 @@ set edit_risk_status_p 1
# Page Title
set
page_title
[
lang::message::lookup
""
intranet-riskmanagement.New_Risk
"New Risk"
]
if
{
[
exists_and_not_null risk_id
]
}
{
if
{
([
info
exists risk_id
]
&&
$risk
_id ne
""
)
}
{
set page_title
[
db_string title
"select project_name from im_projects where project_id = :risk_id"
-default
""
]
}
if
{
""
==
$page
_title && 0 !=
$risk
_type_id
}
{
...
...
@@ -113,7 +113,7 @@ set context [list $page_title]
# We need the risk_type_id for page title, dynfields etc.
# Check if we can deduce the risk_type_id from risk_id
if
{
0 ==
$risk
_type_id ||
""
==
$risk
_type_id
}
{
if
{
[
exists_and_not_null risk_id
]
}
{
if
{
([
info
exists risk_id
]
&&
$risk
_id ne
""
)
}
{
set risk_type_id
[
db_string ttype_id
"select risk_type_id from im_risks where risk_id = :risk_id"
-default 0
]
}
}
...
...
@@ -129,7 +129,7 @@ if {![info exists form_mode]} { set form_mode "display" }
if
{
"edit"
==
$form
_mode
}
{
set show_components_p 0
}
set
risk_exists_p 0
if
{
[
exists_and_not_null risk_id
]
}
{
if
{
([
info
exists risk_id
]
&&
$risk
_id ne
""
)
}
{
# Check if the risk exists
set risk_exists_p
[
db_string risk_exists_p
"select count(*) from im_risks where risk_id = :risk_id"
]
...
...
www/project-risks-report.tcl
View file @
59123325
...
...
@@ -18,7 +18,7 @@ ad_page_contract {
# Security
#
set
menu_label
"reporting-project-risks"
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
set
read_p
[
db_string report_perms
"
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
...
...
@@ -28,7 +28,7 @@ set read_p [db_string report_perms "
# For testing - set manually
set
read_p
"t"
if
{
!
[
string
equal
"t"
$read
_p
]
}
{
if
{
"t"
ne
$read
_p
}
{
set message
"You don't have the necessary permissions to view this page"
ad_return_complaint 1
"<li>
$message
"
ad_script_abort
...
...
@@ -327,7 +327,7 @@ im_report_render_row \
set
counter 0
set
class
""
db_foreach sql
$report
_sql
{
set class
$rowclass
([
expr
$counter
% 2
])
set class
$rowclass
([
expr
{
$counter
% 2
}
])
set risk_value_pretty
[
im_report_format_number
$risk
_value
$output
_format
$number
_locale
]
set risk_impact_pretty
[
im_report_format_number
$risk
_impact
$output
_format
$number
_locale
]
...
...
www/test.tcl
View file @
59123325
...
...
@@ -23,7 +23,7 @@ ad_page_contract {
{
absence_id:integer 0
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
x_axis
[
list
0 1000 100
"kg"
]
set
y_axis
[
list
0 10000 1000
"Euro"
]
...
...
www/test2.tcl
View file @
59123325
...
...
@@ -22,7 +22,7 @@ ad_page_contract {
{
absence_id:integer 0
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_body
[
im_risk_project_component
$user
_id 3088
]
...
...
www/view.tcl
View file @
59123325
...
...
@@ -25,7 +25,7 @@ ad_page_contract {
{
return_url
""
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_title
"View Risk"
set
context_bar
[
im_context_bar
$page
_title
]
...
...
@@ -42,7 +42,7 @@ if {![im_permission $user_id "view_risks"]} {
# Get Risk Data
# ---------------------------------------------------------------
if
{[
info
exists risk_id
]
&&
!
[
empty_string_p
$risk
_id
]
&&
$risk
_id > 0
}
{
if
{[
info
exists risk_id
]
&&
$risk
_id ne
""
&&
$risk
_id > 0
}
{
if
{
!
[
db_0or1row risk_data
"select r.*, im_name_from_user_id(owner_id) as owner_name from im_risks r where r.risk_id = :risk_id"
]
}
{
ad_return_complaint
"Bad Risk"
"<li>We couldn't find the risk
\#
$risk
_id; Hmm... there must be something wrong with our page!"
return
...
...
@@ -52,7 +52,7 @@ if {[info exists risk_id] && ![empty_string_p $risk_id] && $risk_id > 0} {
set page_title
"Edit Risk"
set context_bar
[
im_context_bar
$page
_title
]
}
else
if
{
[
info
exists curr_project_id
]
&&
!
[
empty_string_p
$curr
_project_id
]
&&
$curr
_project_id > 0
}
{
}
else
if
{
[
info
exists curr_project_id
]
&&
$curr
_project_id ne
""
&&
$curr
_project_id > 0
}
{
# create a new risk
set owner_id
$user
_id
set project_id
$curr
_project_id
...
...
@@ -86,10 +86,10 @@ $html_hidden_info
<TD class=rowtitle align=middle colSpan=2>Risk</TD></TR>
<TR class=rowodd>
<TD>User</TD>
<TD><a href=
\"
/intranet/users/
view?
[
export_vars -url
{
owner_id
}]
\"
>
$owner
_name</a></TD></TR>
<TD><a href=
\"
/intranet/users/
[
export_vars -base view
{
owner_id
}]
\"
>
$owner
_name</a></TD></TR>
<TR class=roweven>
<TD>Project</TD>
<TD><a href=
\"
/intranet/projects/
view?
[
export_vars -url
{
project_id
}]
\"
>
$project
_name</a></TD></TR>
<TD><a href=
\"
/intranet/projects/
[
export_vars -base view
{
project_id
}]
\"
>
$project
_name</a></TD></TR>
<TR class=rowodd>
<TD>Title</TD>
<TD><input name=
\"
title
\"
type=
\"
text
\"
size=
\"
50
\"
value=
$title
></TD></TR>
...
...
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