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
ca00e1f0
Commit
ca00e1f0
authored
Feb 05, 2017
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Integrated upgrade scripts
parent
7eb5ad53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
0 deletions
+86
-0
intranet-riskmanagement-create.sql
sql/postgresql/intranet-riskmanagement-create.sql
+86
-0
No files found.
sql/postgresql/intranet-riskmanagement-create.sql
View file @
ca00e1f0
...
@@ -117,6 +117,57 @@ create unique index im_risks_project_un on im_risks(risk_project_id, risk_name);
...
@@ -117,6 +117,57 @@ create unique index im_risks_project_un on im_risks(risk_project_id, risk_name);
SELECT
im_dynfield_attribute_new
(
'im_risk'
,
'risk_probability_percent'
,
'Probability (%)'
,
'numeric'
,
'float'
,
'f'
);
SELECT
im_dynfield_attribute_new
(
'im_risk'
,
'risk_probability_percent'
,
'Probability (%)'
,
'numeric'
,
'float'
,
'f'
);
SELECT
im_dynfield_attribute_new
(
'im_risk'
,
'risk_impact'
,
'Impact (default currency)'
,
'numeric'
,
'float'
,
'f'
);
SELECT
im_dynfield_attribute_new
(
'im_risk'
,
'risk_impact'
,
'Impact (default currency)'
,
'numeric'
,
'float'
,
'f'
);
create
or
replace
function
inline_0
()
returns
integer
as
$
body
$
declare
risk_type_row
RECORD
;
attribute_id_row
RECORD
;
exists_p
integer
;
BEGIN
FOR
risk_type_row
IN
select
risk_type_id
from
im_risk_types
LOOP
RAISE
NOTICE
'risk_type=%'
,
risk_type_row
.
risk_type_id
;
FOR
attribute_id_row
IN
select
attribute_id
from
im_dynfield_attributes
where
acs_attribute_id
in
(
select
attribute_id
from
acs_attributes
where
object_type
=
'im_risk'
and
attribute_name
in
(
'risk_impact'
,
'risk_probability_percent'
)
)
LOOP
select
count
(
*
)
into
exists_p
from
im_dynfield_type_attribute_map
where
attribute_id
=
attribute_id_row
.
attribute_id
and
object_type_id
=
risk_type_row
.
risk_type_id
;
IF
0
=
exists_p
THEN
RAISE
NOTICE
'INSERT: attribute_id=%'
,
attribute_id_row
.
attribute_id
;
insert
into
im_dynfield_type_attribute_map
(
attribute_id
,
object_type_id
,
display_mode
)
values
(
attribute_id_row
.
attribute_id
,
risk_type_row
.
risk_type_id
,
'edit'
);
ELSE
RAISE
NOTICE
'UPDATE: attribute_id=%'
,
attribute_id_row
.
attribute_id
;
update
im_dynfield_type_attribute_map
set
display_mode
=
'edit'
where
attribute_id
=
attribute_id_row
.
attribute_id
and
object_type_id
=
risk_type_row
.
risk_type_id
;
END
IF
;
END
LOOP
;
END
LOOP
;
return
0
;
end
;
$
body
$
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
-----------------------------------------------------------
-----------------------------------------------------------
-- PL/SQL functions to Create and Delete risks and to get
-- PL/SQL functions to Create and Delete risks and to get
-- the name of a specific risk.
-- the name of a specific risk.
...
@@ -318,3 +369,38 @@ insert into im_view_columns (column_id, view_id, sort_order, column_name, column
...
@@ -318,3 +369,38 @@ insert into im_view_columns (column_id, view_id, sort_order, column_name, column
insert
into
im_view_columns
(
column_id
,
view_id
,
sort_order
,
column_name
,
column_render_tcl
)
values
insert
into
im_view_columns
(
column_id
,
view_id
,
sort_order
,
column_name
,
column_render_tcl
)
values
(
21080
,
210
,
80
,
'Percent'
,
'$risk_probability_percent'
);
(
21080
,
210
,
80
,
'Percent'
,
'$risk_probability_percent'
);
create
or
replace
function
inline_0
()
returns
integer
as
$
body
$
declare
v_menu
integer
;
v_main_menu
integer
;
v_employees
integer
;
BEGIN
select
group_id
into
v_employees
from
groups
where
group_name
=
'Employees'
;
select
menu_id
into
v_main_menu
from
im_menus
where
label
=
'reporting-other'
;
v_menu
:
=
im_menu__new
(
null
,
-- p_menu_id
'im_menu'
,
-- object_type
now
(),
-- creation_date
null
,
-- creation_user
null
,
-- creation_ip
null
,
-- context_id
'intranet-riskmanagement'
,
-- package_name
'reporting-project-risks'
,
-- label
'Project Risks'
,
-- name
'/intranet-riskmanagement/project-risks-report'
,
-- url
2400
,
-- sort_order
v_main_menu
,
-- parent_menu_id
null
-- p_visible_tcl
);
PERFORM
acs_permission__grant_permission
(
v_menu
,
v_employees
,
'read'
);
return
0
;
end
;
$
body
$
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
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