##// END OF EJS Templates
Move ids in XML views....
Jean-Philippe Lang -
r3217:002f440bcd34
parent child
Show More
@@ -1,31 +1,32
1 xml.instruct!
1 xml.instruct!
2 xml.issues :type => 'array', :count => @issue_count do
2 xml.issues :type => 'array', :count => @issue_count do
3 @issues.each do |issue|
3 @issues.each do |issue|
4 xml.issue :id => issue.id do
4 xml.issue do
5 xml.id issue.id
5 xml.project(:id => issue.project_id, :name => issue.project.name) unless issue.project.nil?
6 xml.project(:id => issue.project_id, :name => issue.project.name) unless issue.project.nil?
6 xml.tracker(:id => issue.tracker_id, :name => issue.tracker.name) unless issue.tracker.nil?
7 xml.tracker(:id => issue.tracker_id, :name => issue.tracker.name) unless issue.tracker.nil?
7 xml.status(:id => issue.status_id, :name => issue.status.name) unless issue.status.nil?
8 xml.status(:id => issue.status_id, :name => issue.status.name) unless issue.status.nil?
8 xml.priority(:id => issue.priority_id, :name => issue.priority.name) unless issue.priority.nil?
9 xml.priority(:id => issue.priority_id, :name => issue.priority.name) unless issue.priority.nil?
9 xml.author(:id => issue.author_id, :name => issue.author.name) unless issue.author.nil?
10 xml.author(:id => issue.author_id, :name => issue.author.name) unless issue.author.nil?
10 xml.assigned_to(:id => issue.assigned_to_id, :name => issue.assigned_to.name) unless issue.assigned_to.nil?
11 xml.assigned_to(:id => issue.assigned_to_id, :name => issue.assigned_to.name) unless issue.assigned_to.nil?
11 xml.category(:id => issue.category_id, :name => issue.category.name) unless issue.category.nil?
12 xml.category(:id => issue.category_id, :name => issue.category.name) unless issue.category.nil?
12 xml.fixed_version(:id => issue.fixed_version_id, :name => issue.fixed_version.name) unless issue.fixed_version.nil?
13 xml.fixed_version(:id => issue.fixed_version_id, :name => issue.fixed_version.name) unless issue.fixed_version.nil?
13
14
14 xml.subject issue.subject
15 xml.subject issue.subject
15 xml.description issue.description
16 xml.description issue.description
16 xml.start_date issue.start_date
17 xml.start_date issue.start_date
17 xml.due_date issue.due_date
18 xml.due_date issue.due_date
18 xml.done_ratio issue.done_ratio
19 xml.done_ratio issue.done_ratio
19 xml.estimated_hours issue.estimated_hours
20 xml.estimated_hours issue.estimated_hours
20
21
21 xml.custom_fields do
22 xml.custom_fields do
22 issue.custom_field_values.each do |custom_value|
23 issue.custom_field_values.each do |custom_value|
23 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
24 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
24 end
25 end
25 end
26 end
26
27
27 xml.created_on issue.created_on
28 xml.created_on issue.created_on
28 xml.updated_on issue.updated_on
29 xml.updated_on issue.updated_on
29 end
30 end
30 end
31 end
31 end
32 end
@@ -1,54 +1,55
1 xml.instruct!
1 xml.instruct!
2 xml.issue :id => @issue.id do
2 xml.issue do
3 xml.id @issue.id
3 xml.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil?
4 xml.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil?
4 xml.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil?
5 xml.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil?
5 xml.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil?
6 xml.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil?
6 xml.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil?
7 xml.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil?
7 xml.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil?
8 xml.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil?
8 xml.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil?
9 xml.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil?
9 xml.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil?
10 xml.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil?
10 xml.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil?
11 xml.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil?
11
12
12 xml.subject @issue.subject
13 xml.subject @issue.subject
13 xml.description @issue.description
14 xml.description @issue.description
14 xml.start_date @issue.start_date
15 xml.start_date @issue.start_date
15 xml.due_date @issue.due_date
16 xml.due_date @issue.due_date
16 xml.done_ratio @issue.done_ratio
17 xml.done_ratio @issue.done_ratio
17 xml.estimated_hours @issue.estimated_hours
18 xml.estimated_hours @issue.estimated_hours
18 if User.current.allowed_to?(:view_time_entries, @project)
19 if User.current.allowed_to?(:view_time_entries, @project)
19 xml.spent_hours @issue.spent_hours
20 xml.spent_hours @issue.spent_hours
20 end
21 end
21
22
22 xml.custom_fields do
23 xml.custom_fields do
23 @issue.custom_field_values.each do |custom_value|
24 @issue.custom_field_values.each do |custom_value|
24 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
25 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
25 end
26 end
26 end unless @issue.custom_field_values.empty?
27 end unless @issue.custom_field_values.empty?
27
28
28 xml.created_on @issue.created_on
29 xml.created_on @issue.created_on
29 xml.updated_on @issue.updated_on
30 xml.updated_on @issue.updated_on
30
31
31 xml.changesets do
32 xml.changesets do
32 @issue.changesets.each do |changeset|
33 @issue.changesets.each do |changeset|
33 xml.changeset :revision => changeset.revision do
34 xml.changeset :revision => changeset.revision do
34 xml.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil?
35 xml.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil?
35 xml.comments changeset.comments
36 xml.comments changeset.comments
36 xml.committed_on changeset.committed_on
37 xml.committed_on changeset.committed_on
37 end
38 end
38 end
39 end
39 end if User.current.allowed_to?(:view_changesets, @project) && @issue.changesets.any?
40 end if User.current.allowed_to?(:view_changesets, @project) && @issue.changesets.any?
40
41
41 xml.journals do
42 xml.journals do
42 @issue.journals.each do |journal|
43 @issue.journals.each do |journal|
43 xml.journal :id => journal.id do
44 xml.journal :id => journal.id do
44 xml.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
45 xml.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
45 xml.notes journal.notes
46 xml.notes journal.notes
46 xml.details do
47 xml.details do
47 journal.details.each do |detail|
48 journal.details.each do |detail|
48 xml.detail :property => detail.property, :name => detail.prop_key, :old => detail.old_value, :new => detail.value
49 xml.detail :property => detail.property, :name => detail.prop_key, :old => detail.old_value, :new => detail.value
49 end
50 end
50 end
51 end
51 end
52 end
52 end
53 end
53 end unless @issue.journals.empty?
54 end unless @issue.journals.empty?
54 end
55 end
@@ -1,18 +1,19
1 xml.instruct!
1 xml.instruct!
2 xml.projects :type => 'array' do
2 xml.projects :type => 'array' do
3 @projects.each do |project|
3 @projects.each do |project|
4 xml.project :id => project.id do
4 xml.project do
5 xml.id project.id
5 xml.name project.name
6 xml.name project.name
6 xml.identifier project.identifier
7 xml.identifier project.identifier
7 xml.description project.description
8 xml.description project.description
8 xml.parent(:id => project.parent_id, :name => project.parent.name) unless project.parent.nil?
9 xml.parent(:id => project.parent_id, :name => project.parent.name) unless project.parent.nil?
9 xml.custom_fields do
10 xml.custom_fields do
10 project.custom_field_values.each do |custom_value|
11 project.custom_field_values.each do |custom_value|
11 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
12 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
12 end
13 end
13 end unless project.custom_field_values.empty?
14 end unless project.custom_field_values.empty?
14 xml.created_on project.created_on
15 xml.created_on project.created_on
15 xml.updated_on project.updated_on
16 xml.updated_on project.updated_on
16 end
17 end
17 end
18 end
18 end
19 end
@@ -1,16 +1,17
1 xml.instruct!
1 xml.instruct!
2 xml.project :id => @project.id do
2 xml.project do
3 xml.id @project.id
3 xml.name @project.name
4 xml.name @project.name
4 xml.identifier @project.identifier
5 xml.identifier @project.identifier
5 xml.description @project.description
6 xml.description @project.description
6 xml.homepage @project.homepage
7 xml.homepage @project.homepage
7
8
8 xml.custom_fields do
9 xml.custom_fields do
9 @project.custom_field_values.each do |custom_value|
10 @project.custom_field_values.each do |custom_value|
10 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
11 xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
11 end
12 end
12 end unless @project.custom_field_values.empty?
13 end unless @project.custom_field_values.empty?
13
14
14 xml.created_on @project.created_on
15 xml.created_on @project.created_on
15 xml.updated_on @project.updated_on
16 xml.updated_on @project.updated_on
16 end
17 end
General Comments 0
You need to be logged in to leave comments. Login now