Skip to content

Commit b316bef

Browse files
committed
refs #34 supported issues list print
fixed separator
1 parent 14d2ef1 commit b316bef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/redmine_supply/hooks.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,23 @@ def redmine_gtt_print_issue_to_json(context)
4444
}
4545
attributes[:human_resource_items] = human_resource_items_value
4646
end
47+
48+
def redmine_gtt_print_issues_to_json(context)
49+
issues = context[:issues]
50+
json = context[:json]
51+
attributes = json[:attributes] ||= {}
52+
table = attributes[:datasource][0][:table]
53+
54+
table[:columns].push(
55+
"supply_items", "asset_resource_items", "human_resource_items")
56+
issues.each_with_index{|issue, idx|
57+
items_by_type = issue.resource_items_by_type
58+
table[:data][idx].push(
59+
IssueSupplyItemsPresenter.(issue.issue_supply_items).join(", "),
60+
ResourceItemsPresenter.(items_by_type['asset']).join(", "),
61+
ResourceItemsPresenter.(items_by_type['human']).join(", ")
62+
)
63+
}
64+
end
4765
end
4866
end

0 commit comments

Comments
 (0)