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
1c634a14
Commit
1c634a14
authored
Nov 16, 2017
by
cosine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added "invoices" field to JSON task tree
parent
bc879801
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
project-task-tree.json.tcl
www/data-source/project-task-tree.json.tcl
+30
-2
No files found.
www/data-source/project-task-tree.json.tcl
View file @
1c634a14
...
...
@@ -61,7 +61,7 @@ db_foreach task_dependencies $task_dependencies_sql {
set
assignee_sql
"
select r.*,
bom.*,
to_char(coalesce(bom.percentage,0), '990.0'
) as percent_pretty,
coalesce(bom.percentage,0
) as percent_pretty,
im_name_from_user_id(r.object_id_two) as user_name,
im_email_from_user_id(r.object_id_two) as user_email,
im_initials_from_user_id(r.object_id_two) as user_initials
...
...
@@ -83,6 +83,32 @@ db_foreach assignee $assignee_sql {
set assignee_hash
(
$object
_id_one
)
$assignees
}
# --------------------------------------------
# Invoices: Collect before main loop
#
set
invoice_sql
"
select p.project_id as child_project_id,
c.*,
c.effective_date::date as effective_date_date
from im_projects main_p,
im_projects p,
acs_rels r,
im_costs c
where main_p.project_id = :main_project_id and
p.tree_sortkey between main_p.tree_sortkey and tree_right(main_p.tree_sortkey) and
r.object_id_one = p.project_id and
r.object_id_two = c.cost_id
order by c.cost_id
"
db_foreach invoice
$invoice
_sql
{
set invoices
[
list
]
if
{[
info
exists invoice_hash
(
$child
_project_id
)]}
{
set invoices
$invoice
_hash
(
$child
_project_id
)
}
lappend invoices
"{id:
$cost
_id, effective_date: '
$effective
_date_date', cost_name:'
[
im_quotejson
$cost
_name
]
', cost_type_id:
$cost
_type_id, cost_type:'
[
im_category_from_id
$cost
_type_id
]
'}"
set invoice_hash
(
$child
_project_id
)
$invoices
}
# ad_return_complaint 1 [array get invoice_hash
]
# --------------------------------------------
# Get the list of projects that should not be displayed
# Currently these are projects marked as "deleted".
...
...
@@ -218,13 +244,14 @@ template::multirow foreach task_multirow {
set predecessor_tasks
[
list
]
set assignees
[
list
]
set invoices
[
list
]
if
{[
info
exists predecessor_hash
(
$project
_id
)]}
{
set predecessor_tasks
$predecessor
_hash
(
$project
_id
)
}
if
{[
info
exists assignee_hash
(
$project
_id
)]}
{
set assignees
$assignee
_hash
(
$project
_id
)
}
if
{[
info
exists invoice_hash
(
$project
_id
)]}
{
set invoices
$invoice
_hash
(
$project
_id
)
}
set quoted_char_map
{
"
\n
"
"
\\
n"
"
\r
"
"
\\
r"
"
\"
"
"
\\\"
"
"
\\
"
"
\\\\
"
}
set quoted_project_name
[
string
map
$quoted
_char_map
$project
_name
]
set type
""
switch
$project
_type_id
{
100
{
set type
"task"
}
...
...
@@ -246,6 +273,7 @@ ${indent}\ttext:\"$quoted_project_name\",
${indent}
\t
iconCls:
\"
icon-
$type
\"
,
${indent}
\t
predecessors:
\[
[
join
$predecessor
_tasks
", "
]
\]
,
${indent}
\t
assignees:
\[
[
join
$assignees
", "
]
\]
,
${indent}
\t
invoices:
\[
[
join
$invoices
", "
]
\]
,
${indent}
\t
expanded:
$expanded
,
"
foreach var
$valid
_vars
{
...
...
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