##// END OF EJS Templates
issues reports improvements...
Jean-Philippe Lang -
r32:7473be407216
parent child
Show More
@@ -0,0 +1,47
1 <% if @statuses.empty? or rows.empty? %>
2 <p><i><%=l(:label_no_data)%></i></p>
3 <% else %>
4 <% col_width = 70 / (@statuses.length+3) %>
5 <table class="reportTableContent">
6 <tr>
7 <td width="25%"></td>
8 <% for status in @statuses %>
9 <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td>
10 <% end %>
11 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td>
12 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td>
13 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td>
14 </tr>
15
16 <% for row in rows %>
17 <tr class="<%= cycle("odd", "even") %>">
18 <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
19 :set_filter => 1,
20 "#{field_name}" => row.id %></td>
21 <% for status in @statuses %>
22 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }),
23 :controller => 'projects', :action => 'list_issues', :id => @project,
24 :set_filter => 1,
25 "status_id" => status.id,
26 "#{field_name}" => row.id %></td>
27 <% end %>
28 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }),
29 :controller => 'projects', :action => 'list_issues', :id => @project,
30 :set_filter => 1,
31 "#{field_name}" => row.id,
32 "status_id" => "O" %></td>
33 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 1 }),
34 :controller => 'projects', :action => 'list_issues', :id => @project,
35 :set_filter => 1,
36 "#{field_name}" => row.id,
37 "status_id" => "C" %></td>
38 <td align="center"><%= link_to (aggregate data, { field_name => row.id }),
39 :controller => 'projects', :action => 'list_issues', :id => @project,
40 :set_filter => 1,
41 "#{field_name}" => row.id,
42 "status_id" => "A" %></td>
43 <% end %>
44 </tr>
45 </table>
46 <% end
47 reset_cycle %> No newline at end of file
@@ -0,0 +1,7
1 <h2><%=l(:label_report_plural)%></h2>
2
3 <strong><%=@report_title%></strong>
4 <%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
5 <br />
6 <%= link_to l(:button_back), :action => 'issue_report' %>
7
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -21,9 +21,46 class ReportsController < ApplicationController
21
21
22 def issue_report
22 def issue_report
23 @statuses = IssueStatus.find_all
23 @statuses = IssueStatus.find_all
24 @trackers = Tracker.find_all
24
25 @issues_by_tracker =
25 case params[:detail]
26 ActiveRecord::Base.connection.select_all("select s.id as status_id,
26 when "tracker"
27 @field = "tracker_id"
28 @rows = Tracker.find_all
29 @data = issues_by_tracker
30 @report_title = l(:field_tracker)
31 render :template => "reports/issue_report_details"
32 when "priority"
33 @field = "priority_id"
34 @rows = Enumeration::get_values('IPRI')
35 @data = issues_by_priority
36 @report_title = l(:field_priority)
37 render :template => "reports/issue_report_details"
38 when "category"
39 @field = "category_id"
40 @rows = @project.issue_categories
41 @data = issues_by_category
42 @report_title = l(:field_category)
43 render :template => "reports/issue_report_details"
44 else
45 @trackers = Tracker.find(:all)
46 @priorities = Enumeration::get_values('IPRI')
47 @categories = @project.issue_categories
48 issues_by_tracker
49 issues_by_priority
50 issues_by_category
51 render :template => "reports/issue_report"
52 end
53 end
54
55 private
56 # Find project of id params[:id]
57 def find_project
58 @project = Project.find(params[:id])
59 end
60
61 def issues_by_tracker
62 @issues_by_tracker ||=
63 ActiveRecord::Base.connection.select_all("select s.id as status_id,
27 s.is_closed as closed,
64 s.is_closed as closed,
28 t.id as tracker_id,
65 t.id as tracker_id,
29 count(i.id) as total
66 count(i.id) as total
@@ -33,9 +70,11 class ReportsController < ApplicationController
33 i.status_id=s.id
70 i.status_id=s.id
34 and i.tracker_id=t.id
71 and i.tracker_id=t.id
35 and i.project_id=#{@project.id}
72 and i.project_id=#{@project.id}
36 group by s.id, s.is_closed, t.id")
73 group by s.id, s.is_closed, t.id")
37 @priorities = Enumeration::get_values('IPRI')
74 end
38 @issues_by_priority =
75
76 def issues_by_priority
77 @issues_by_priority ||=
39 ActiveRecord::Base.connection.select_all("select s.id as status_id,
78 ActiveRecord::Base.connection.select_all("select s.id as status_id,
40 s.is_closed as closed,
79 s.is_closed as closed,
41 p.id as priority_id,
80 p.id as priority_id,
@@ -46,9 +85,11 class ReportsController < ApplicationController
46 i.status_id=s.id
85 i.status_id=s.id
47 and i.priority_id=p.id
86 and i.priority_id=p.id
48 and i.project_id=#{@project.id}
87 and i.project_id=#{@project.id}
49 group by s.id, s.is_closed, p.id")
88 group by s.id, s.is_closed, p.id")
50 @categories = @project.issue_categories
89 end
51 @issues_by_category =
90
91 def issues_by_category
92 @issues_by_category ||=
52 ActiveRecord::Base.connection.select_all("select s.id as status_id,
93 ActiveRecord::Base.connection.select_all("select s.id as status_id,
53 s.is_closed as closed,
94 s.is_closed as closed,
54 c.id as category_id,
95 c.id as category_id,
@@ -59,13 +100,6 class ReportsController < ApplicationController
59 i.status_id=s.id
100 i.status_id=s.id
60 and i.category_id=c.id
101 and i.category_id=c.id
61 and i.project_id=#{@project.id}
102 and i.project_id=#{@project.id}
62 group by s.id, s.is_closed, c.id")
103 group by s.id, s.is_closed, c.id")
63 end
64
65
66 private
67 # Find project of id params[:id]
68 def find_project
69 @project = Project.find(params[:id])
70 end
104 end
71 end
105 end
@@ -1,16 +1,12
1 <% if @statuses.empty? or rows.empty? %>
1 <% if @statuses.empty? or rows.empty? %>
2 <p><i><%=l(:label_no_data)%></i></p>
2 <p><i><%=l(:label_no_data)%></i></p>
3 <% else %>
3 <% else %>
4 <% col_width = 70 / (@statuses.length+3) %>
4 <table class="reportTableContent">
5 <table border="0" cellspacing="1" cellpadding="2" width="100%">
6 <tr>
5 <tr>
7 <td width="25%"></td>
6 <td width="25%"></td>
8 <% for status in @statuses %>
7 <td align="center" width="25%"><%=l(:label_open_issues_plural)%></td>
9 <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td>
8 <td align="center" width="25%"><%=l(:label_closed_issues_plural)%></td>
10 <% end %>
9 <td align="center" width="25%"><%=l(:label_total)%></td>
11 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td>
12 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td>
13 <td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td>
14 </tr>
10 </tr>
15
11
16 <% for row in rows %>
12 <% for row in rows %>
@@ -18,13 +14,6
18 <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
14 <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
19 :set_filter => 1,
15 :set_filter => 1,
20 "#{field_name}" => row.id %></td>
16 "#{field_name}" => row.id %></td>
21 <% for status in @statuses %>
22 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }),
23 :controller => 'projects', :action => 'list_issues', :id => @project,
24 :set_filter => 1,
25 "status_id" => status.id,
26 "#{field_name}" => row.id %></td>
27 <% end %>
28 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }),
17 <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }),
29 :controller => 'projects', :action => 'list_issues', :id => @project,
18 :controller => 'projects', :action => 'list_issues', :id => @project,
30 :set_filter => 1,
19 :set_filter => 1,
@@ -1,14 +1,18
1 <h2><%=l(:label_report_plural)%></h2>
1 <h2><%=l(:label_report_plural)%></h2>
2
2
3 <strong><%=l(:field_tracker)%></strong>
3 <div class="splitcontentleft">
4 <strong><%=l(:field_tracker)%></strong>
4 <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
5 <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
5 <br />
6 <p align="right"><small><%= link_to l(:label_details), :detail => 'tracker' %></small>&nbsp;</p>
6
7
7 <strong><%=l(:field_priority)%></strong>
8 <strong><%=l(:field_priority)%></strong>
8 <%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
9 <%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
9 <br />
10 <p align="right"><small><%= link_to l(:label_details), :detail => 'priority' %></small>&nbsp;</p>
11 </div>
10
12
13 <div class="splitcontentright">
11 <strong><%=l(:field_category)%></strong>
14 <strong><%=l(:field_category)%></strong>
12 <%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
15 <%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
16 <p align="right"><small><%= link_to l(:label_details), :detail => 'category' %></small>&nbsp;</p>
17 </div>
13
18
14 &nbsp;
@@ -240,6 +240,7 label_none: Kein
240 label_next: Weiter
240 label_next: Weiter
241 label_previous: Zurück
241 label_previous: Zurück
242 label_used_by: Benutzt von
242 label_used_by: Benutzt von
243 #label_details: Details...
243
244
244 button_login: Einloggen
245 button_login: Einloggen
245 button_submit: Einreichen
246 button_submit: Einreichen
@@ -260,6 +261,7 button_download: Fernzuladen
260 button_list: Aufzulisten
261 button_list: Aufzulisten
261 button_view: Siehe
262 button_view: Siehe
262 button_move: Bewegen
263 button_move: Bewegen
264 #button_back: Back
263
265
264 text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll.
266 text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll.
265 text_regexp_info: eg. ^[A-Z0-9]+$
267 text_regexp_info: eg. ^[A-Z0-9]+$
@@ -240,6 +240,7 label_none: None
240 label_next: Next
240 label_next: Next
241 label_previous: Previous
241 label_previous: Previous
242 label_used_by: Used by
242 label_used_by: Used by
243 label_details: Details...
243
244
244 button_login: Login
245 button_login: Login
245 button_submit: Submit
246 button_submit: Submit
@@ -260,6 +261,7 button_download: Download
260 button_list: List
261 button_list: List
261 button_view: View
262 button_view: View
262 button_move: Move
263 button_move: Move
264 button_back: Back
263
265
264 text_select_mail_notifications: Select actions for which mail notifications should be sent.
266 text_select_mail_notifications: Select actions for which mail notifications should be sent.
265 text_regexp_info: eg. ^[A-Z0-9]+$
267 text_regexp_info: eg. ^[A-Z0-9]+$
@@ -240,6 +240,7 label_none: Ninguno
240 label_next: Próximo
240 label_next: Próximo
241 label_previous: Precedente
241 label_previous: Precedente
242 label_used_by: Utilizado por
242 label_used_by: Utilizado por
243 #label_details: Details...
243
244
244 button_login: Conexión
245 button_login: Conexión
245 button_submit: Someter
246 button_submit: Someter
@@ -260,6 +261,7 button_download: Telecargar
260 button_list: Listar
261 button_list: Listar
261 button_view: Ver
262 button_view: Ver
262 button_move: Mover
263 button_move: Mover
264 #button_back: Back
263
265
264 text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail.
266 text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail.
265 text_regexp_info: eg. ^[A-Z0-9]+$
267 text_regexp_info: eg. ^[A-Z0-9]+$
@@ -240,6 +240,7 label_none: Aucun
240 label_next: Suivant
240 label_next: Suivant
241 label_previous: Précédent
241 label_previous: Précédent
242 label_used_by: Utilisé par
242 label_used_by: Utilisé par
243 label_details: Détails...
243
244
244 button_login: Connexion
245 button_login: Connexion
245 button_submit: Soumettre
246 button_submit: Soumettre
@@ -260,6 +261,7 button_download: Télécharger
260 button_list: Lister
261 button_list: Lister
261 button_view: Voir
262 button_view: Voir
262 button_move: Déplacer
263 button_move: Déplacer
264 button_back: Retour
263
265
264 text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée.
266 text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée.
265 text_regexp_info: ex. ^[A-Z0-9]+$
267 text_regexp_info: ex. ^[A-Z0-9]+$
@@ -265,6 +265,16 tr.even {
265 background-color: #fff;
265 background-color: #fff;
266 }
266 }
267
267
268 table.reportTableContent {
269 border:1px solid #c0c0c0;
270 width:99%;
271 border-collapse: collapse;
272 }
273
274 table.reportTableContent td {
275 padding:2px;
276 }
277
268 hr { border:none; border-bottom: dotted 2px #c0c0c0; }
278 hr { border:none; border-bottom: dotted 2px #c0c0c0; }
269
279
270
280
General Comments 0
You need to be logged in to leave comments. Login now