Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest
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-rest
Commits
e7b92f14
Commit
e7b92f14
authored
Aug 24, 2021
by
Project Open
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added baselines
parent
37843a54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
project-task-tree.json.tcl
www/data-source/project-task-tree.json.tcl
+59
-0
No files found.
www/data-source/project-task-tree.json.tcl
View file @
e7b92f14
...
...
@@ -124,6 +124,48 @@ db_foreach invoice $invoice_sql {
# ad_return_complaint 1 [array get invoice_hash
]
# --------------------------------------------
# Baselines:
#
# Baselines can be installed or not...
if
{[
im_table_exists im_baselines
]}
{
# Get the first active baseline
array set baseline_hash
{}
set baseline_id
[
db_string first_baseline
"select min(baseline_id) from im_baselines where baseline_project_id = :main_project_id"
-default 0
]
set baseline_var_map_list
{
start_date start end_date end
}
array set baseline_var_map
$baseline
_var_map_list
set baseline_vars
[
array
names baseline_var_map
]
array set baseline_hash
{}
set baseline_sql
"
select *
from im_audits a,
im_baselines b
where a.audit_baseline_id = b.baseline_id and
b.baseline_project_id = :main_project_id
order by b.baseline_id, audit_id
"
# ad_return_complaint 1
[
im_ad_hoc_query -format html
$baseline
_sql
]
db_foreach baselines
$baseline
_sql
{
# Create a hash with baseline id -> name
set baseline_hash
(
$baseline
_id
)
$baseline
_name
# Writing audit values into a hash.
set values
[
split
$audit
_value
"
\n
"
]
foreach value
$values
{
set value_parts
[
split
$value
"
\t
"
]
lassign
$value
_parts key val
if
{
$key
in
$baseline
_vars
}
{
set k
"
$baseline
_id-
$audit
_object_id-
$key
"
set baseline_value_hash
(
$k
)
$val
}
}
}
# ad_return_complaint 1
[
join
[
array
get baseline_value_hash
]
"<br>"
]
}
# --------------------------------------------
# Get the list of projects that should not be displayed
# Currently these are projects marked as "deleted".
...
...
@@ -308,6 +350,23 @@ ${indent}\tinvoices:\[[join $invoices ", "]\],
${indent}
\t
logged_hours:
$logged
_hours,
${indent}
\t
expanded:
$expanded
,
"
# Create Baseline structure: baselines
{
'bid1':
{
'start_date':
"..."
, 'end_date':
"..."
}
, 'bid2':
{
...
}}
set b_json_list
[
list
]
foreach baseline_id
[
lsort
-integer
[
array
names baseline_hash
]]
{
# ad_return_complaint 1
$baseline
_id
set json_list
[
list
]
foreach baseline_var
$baseline
_vars
{
set k
"
$baseline
_id-
$project
_id-
$baseline
_var"
if
{[
info
exists baseline_value_hash
(
$k
)]}
{
set val
$baseline
_value_hash
(
$k
)
lappend json_list
"'
$baseline
_var': '
$val
'"
}
}
set b_json
"'
$baseline
_id': {
[
join
$json
_list
", "
]
}"
lappend b_json_list
$b
_json
}
append task_json
"
${indent}
\t
baselines: {
[
join
$b
_json_list
", "
]
},
\n
"
foreach var
$valid
_vars
{
# Skip xml_* variables
(
only used by MS-Project
)
if
{[
regexp
{
^xml_
}
$var
match
]}
{
continue
}
...
...
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