From: Jean-Philippe Lang Date: Sat, 21 Oct 2006 12:57:19 +0000 (+0000) Subject: issues reports improvements X-Git-Tag: 0.4.0~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7473be407216246dbf0da705dc6c7b104b4c5a7e;p=redmine.git issues reports improvements git-svn-id: http://redmine.rubyforge.org/svn/trunk@34 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/redmine/app/controllers/reports_controller.rb b/redmine/app/controllers/reports_controller.rb index 938d3b469..6e5726329 100644 --- a/redmine/app/controllers/reports_controller.rb +++ b/redmine/app/controllers/reports_controller.rb @@ -21,9 +21,46 @@ class ReportsController < ApplicationController def issue_report @statuses = IssueStatus.find_all - @trackers = Tracker.find_all - @issues_by_tracker = - ActiveRecord::Base.connection.select_all("select s.id as status_id, + + case params[:detail] + when "tracker" + @field = "tracker_id" + @rows = Tracker.find_all + @data = issues_by_tracker + @report_title = l(:field_tracker) + render :template => "reports/issue_report_details" + when "priority" + @field = "priority_id" + @rows = Enumeration::get_values('IPRI') + @data = issues_by_priority + @report_title = l(:field_priority) + render :template => "reports/issue_report_details" + when "category" + @field = "category_id" + @rows = @project.issue_categories + @data = issues_by_category + @report_title = l(:field_category) + render :template => "reports/issue_report_details" + else + @trackers = Tracker.find(:all) + @priorities = Enumeration::get_values('IPRI') + @categories = @project.issue_categories + issues_by_tracker + issues_by_priority + issues_by_category + render :template => "reports/issue_report" + end + end + +private + # Find project of id params[:id] + def find_project + @project = Project.find(params[:id]) + end + + def issues_by_tracker + @issues_by_tracker ||= + ActiveRecord::Base.connection.select_all("select s.id as status_id, s.is_closed as closed, t.id as tracker_id, count(i.id) as total @@ -33,9 +70,11 @@ class ReportsController < ApplicationController i.status_id=s.id and i.tracker_id=t.id and i.project_id=#{@project.id} - group by s.id, s.is_closed, t.id") - @priorities = Enumeration::get_values('IPRI') - @issues_by_priority = + group by s.id, s.is_closed, t.id") + end + + def issues_by_priority + @issues_by_priority ||= ActiveRecord::Base.connection.select_all("select s.id as status_id, s.is_closed as closed, p.id as priority_id, @@ -46,9 +85,11 @@ class ReportsController < ApplicationController i.status_id=s.id and i.priority_id=p.id and i.project_id=#{@project.id} - group by s.id, s.is_closed, p.id") - @categories = @project.issue_categories - @issues_by_category = + group by s.id, s.is_closed, p.id") + end + + def issues_by_category + @issues_by_category ||= ActiveRecord::Base.connection.select_all("select s.id as status_id, s.is_closed as closed, c.id as category_id, @@ -59,13 +100,6 @@ class ReportsController < ApplicationController i.status_id=s.id and i.category_id=c.id and i.project_id=#{@project.id} - group by s.id, s.is_closed, c.id") - end - - -private - # Find project of id params[:id] - def find_project - @project = Project.find(params[:id]) + group by s.id, s.is_closed, c.id") end end diff --git a/redmine/app/views/reports/_details.rhtml b/redmine/app/views/reports/_details.rhtml new file mode 100644 index 000000000..be4c82e77 --- /dev/null +++ b/redmine/app/views/reports/_details.rhtml @@ -0,0 +1,47 @@ +<% if @statuses.empty? or rows.empty? %> +

<%=l(:label_no_data)%>

+<% else %> +<% col_width = 70 / (@statuses.length+3) %> + + + +<% for status in @statuses %> + +<% end %> + + + + + +<% for row in rows %> +"> + + <% for status in @statuses %> + + <% end %> + + + +<% end %> + +
<%= status.name %><%=l(:label_open_issues_plural)%><%=l(:label_closed_issues_plural)%><%=l(:label_total)%>
<%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project, + :set_filter => 1, + "#{field_name}" => row.id %><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }), + :controller => 'projects', :action => 'list_issues', :id => @project, + :set_filter => 1, + "status_id" => status.id, + "#{field_name}" => row.id %><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }), + :controller => 'projects', :action => 'list_issues', :id => @project, + :set_filter => 1, + "#{field_name}" => row.id, + "status_id" => "O" %><%= link_to (aggregate data, { field_name => row.id, "closed" => 1 }), + :controller => 'projects', :action => 'list_issues', :id => @project, + :set_filter => 1, + "#{field_name}" => row.id, + "status_id" => "C" %><%= link_to (aggregate data, { field_name => row.id }), + :controller => 'projects', :action => 'list_issues', :id => @project, + :set_filter => 1, + "#{field_name}" => row.id, + "status_id" => "A" %>
+<% end + reset_cycle %> \ No newline at end of file diff --git a/redmine/app/views/reports/_simple.rhtml b/redmine/app/views/reports/_simple.rhtml index 6838735ed..3be1281c5 100644 --- a/redmine/app/views/reports/_simple.rhtml +++ b/redmine/app/views/reports/_simple.rhtml @@ -1,16 +1,12 @@ <% if @statuses.empty? or rows.empty? %>

<%=l(:label_no_data)%>

<% else %> -<% col_width = 70 / (@statuses.length+3) %> - +
-<% for status in @statuses %> - -<% end %> - - - + + + <% for row in rows %> @@ -18,13 +14,6 @@ - <% for status in @statuses %> - - <% end %>
<%= status.name %><%=l(:label_open_issues_plural)%><%=l(:label_closed_issues_plural)%><%=l(:label_total)%><%=l(:label_open_issues_plural)%><%=l(:label_closed_issues_plural)%><%=l(:label_total)%>
<%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1, "#{field_name}" => row.id %><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }), - :controller => 'projects', :action => 'list_issues', :id => @project, - :set_filter => 1, - "status_id" => status.id, - "#{field_name}" => row.id %><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1, diff --git a/redmine/app/views/reports/issue_report.rhtml b/redmine/app/views/reports/issue_report.rhtml index 1717583d3..f4704969b 100644 --- a/redmine/app/views/reports/issue_report.rhtml +++ b/redmine/app/views/reports/issue_report.rhtml @@ -1,14 +1,18 @@

<%=l(:label_report_plural)%>

-<%=l(:field_tracker)%> +
+<%=l(:field_tracker)%> <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %> -
+

<%= link_to l(:label_details), :detail => 'tracker' %> 

<%=l(:field_priority)%> <%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %> -
+

<%= link_to l(:label_details), :detail => 'priority' %> 

+
+
<%=l(:field_category)%> <%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %> +

<%= link_to l(:label_details), :detail => 'category' %> 

+
-  diff --git a/redmine/app/views/reports/issue_report_details.rhtml b/redmine/app/views/reports/issue_report_details.rhtml new file mode 100644 index 000000000..6970a36b3 --- /dev/null +++ b/redmine/app/views/reports/issue_report_details.rhtml @@ -0,0 +1,7 @@ +

<%=l(:label_report_plural)%>

+ +<%=@report_title%> +<%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %> +
+<%= link_to l(:button_back), :action => 'issue_report' %> + diff --git a/redmine/lang/de.yml b/redmine/lang/de.yml index c39d71035..aea0de94f 100644 --- a/redmine/lang/de.yml +++ b/redmine/lang/de.yml @@ -240,6 +240,7 @@ label_none: Kein label_next: Weiter label_previous: Zurück label_used_by: Benutzt von +#label_details: Details... button_login: Einloggen button_submit: Einreichen @@ -260,6 +261,7 @@ button_download: Fernzuladen button_list: Aufzulisten button_view: Siehe button_move: Bewegen +#button_back: Back text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll. text_regexp_info: eg. ^[A-Z0-9]+$ diff --git a/redmine/lang/en.yml b/redmine/lang/en.yml index d4ef52b28..f412b0bc3 100644 --- a/redmine/lang/en.yml +++ b/redmine/lang/en.yml @@ -240,6 +240,7 @@ label_none: None label_next: Next label_previous: Previous label_used_by: Used by +label_details: Details... button_login: Login button_submit: Submit @@ -260,6 +261,7 @@ button_download: Download button_list: List button_view: View button_move: Move +button_back: Back text_select_mail_notifications: Select actions for which mail notifications should be sent. text_regexp_info: eg. ^[A-Z0-9]+$ diff --git a/redmine/lang/es.yml b/redmine/lang/es.yml index acc71eca1..a2543eca8 100644 --- a/redmine/lang/es.yml +++ b/redmine/lang/es.yml @@ -240,6 +240,7 @@ label_none: Ninguno label_next: Próximo label_previous: Precedente label_used_by: Utilizado por +#label_details: Details... button_login: Conexión button_submit: Someter @@ -260,6 +261,7 @@ button_download: Telecargar button_list: Listar button_view: Ver button_move: Mover +#button_back: Back text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail. text_regexp_info: eg. ^[A-Z0-9]+$ diff --git a/redmine/lang/fr.yml b/redmine/lang/fr.yml index 866f79af6..22a625ca3 100644 --- a/redmine/lang/fr.yml +++ b/redmine/lang/fr.yml @@ -240,6 +240,7 @@ label_none: Aucun label_next: Suivant label_previous: Précédent label_used_by: Utilisé par +label_details: Détails... button_login: Connexion button_submit: Soumettre @@ -260,6 +261,7 @@ button_download: Télécharger button_list: Lister button_view: Voir button_move: Déplacer +button_back: Retour text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée. text_regexp_info: ex. ^[A-Z0-9]+$ diff --git a/redmine/public/images/user_new.png b/redmine/public/images/user_new.png new file mode 100644 index 000000000..c7c718822 Binary files /dev/null and b/redmine/public/images/user_new.png differ diff --git a/redmine/public/stylesheets/application.css b/redmine/public/stylesheets/application.css index 8b83a21af..b93e316e4 100644 --- a/redmine/public/stylesheets/application.css +++ b/redmine/public/stylesheets/application.css @@ -265,6 +265,16 @@ tr.even { background-color: #fff; } +table.reportTableContent { + border:1px solid #c0c0c0; + width:99%; + border-collapse: collapse; +} + +table.reportTableContent td { + padding:2px; +} + hr { border:none; border-bottom: dotted 2px #c0c0c0; }