Patch #18681 » RM_18681_issues_list_api_with_journals_relations_RM_V2.6.1.diff
plugins/redmine_smile/app/views/issues/index.api.rsb (copie de travail) | ||
---|---|---|
39 | 39 |
api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type, :delay => relation.delay) |
40 | 40 |
end |
41 | 41 |
end if include_in_api_response?('relations') |
42 | ||
43 | ||
44 |
api.array :journals do |
|
45 |
issue.journals.each do |journal| |
|
46 |
api.journal :id => journal.id do |
|
47 |
api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil? |
|
48 |
api.notes journal.notes |
|
49 |
api.created_on journal.created_on |
|
50 |
api.array :details do |
|
51 |
journal.visible_details.each do |detail| |
|
52 |
api.detail :property => detail.property, :name => detail.prop_key do |
|
53 |
api.old_value detail.old_value |
|
54 |
api.new_value detail.value |
|
55 |
end |
|
56 |
end |
|
57 |
end |
|
58 |
end |
|
59 |
end |
|
60 |
end if include_in_api_response?('journals') |
|
61 | ||
62 |
api.array :watchers do |
|
63 |
issue.watcher_users.each do |user| |
|
64 |
api.user :id => user.id, :name => user.name |
|
65 |
end |
|
66 |
end if include_in_api_response?('watchers') && User.current.allowed_to?(:view_issue_watchers, issue.project) |
|
42 | 67 |
end |
43 | 68 |
end |
44 | 69 |
end |