summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2006-10-21 12:57:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2006-10-21 12:57:19 +0000
commit7473be407216246dbf0da705dc6c7b104b4c5a7e (patch)
tree6a00430cae148f89ab671ce9e7ce328030e194d6
parent6a0022d7a146d7827fc7acccde07cd3c159e2cfb (diff)
downloadredmine-7473be407216246dbf0da705dc6c7b104b4c5a7e.tar.gz
redmine-7473be407216246dbf0da705dc6c7b104b4c5a7e.zip
issues reports improvements
git-svn-id: http://redmine.rubyforge.org/svn/trunk@34 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--redmine/app/controllers/reports_controller.rb68
-rw-r--r--redmine/app/views/reports/_details.rhtml47
-rw-r--r--redmine/app/views/reports/_simple.rhtml19
-rw-r--r--redmine/app/views/reports/issue_report.rhtml12
-rw-r--r--redmine/app/views/reports/issue_report_details.rhtml7
-rw-r--r--redmine/lang/de.yml2
-rw-r--r--redmine/lang/en.yml2
-rw-r--r--redmine/lang/es.yml2
-rw-r--r--redmine/lang/fr.yml2
-rw-r--r--redmine/public/images/user_new.pngbin0 -> 215 bytes
-rw-r--r--redmine/public/stylesheets/application.css10
11 files changed, 135 insertions, 36 deletions
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? %>
+ <p><i><%=l(:label_no_data)%></i></p>
+<% else %>
+<% col_width = 70 / (@statuses.length+3) %>
+<table class="reportTableContent">
+<tr>
+<td width="25%"></td>
+<% for status in @statuses %>
+ <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td>
+<% end %>
+<td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td>
+<td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td>
+<td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td>
+</tr>
+
+<% for row in rows %>
+<tr class="<%= cycle("odd", "even") %>">
+ <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
+ :set_filter => 1,
+ "#{field_name}" => row.id %></td>
+ <% for status in @statuses %>
+ <td align="center"><%= 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 %></td>
+ <% end %>
+ <td align="center"><%= 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" %></td>
+ <td align="center"><%= 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" %></td>
+ <td align="center"><%= 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" %></td>
+<% end %>
+</tr>
+</table>
+<% 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? %>
<p><i><%=l(:label_no_data)%></i></p>
<% else %>
-<% col_width = 70 / (@statuses.length+3) %>
-<table border="0" cellspacing="1" cellpadding="2" width="100%">
+<table class="reportTableContent">
<tr>
<td width="25%"></td>
-<% for status in @statuses %>
- <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td>
-<% end %>
-<td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td>
-<td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td>
-<td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td>
+<td align="center" width="25%"><%=l(:label_open_issues_plural)%></td>
+<td align="center" width="25%"><%=l(:label_closed_issues_plural)%></td>
+<td align="center" width="25%"><%=l(:label_total)%></td>
</tr>
<% for row in rows %>
@@ -18,13 +14,6 @@
<td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project,
:set_filter => 1,
"#{field_name}" => row.id %></td>
- <% for status in @statuses %>
- <td align="center"><%= 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 %></td>
- <% end %>
<td align="center"><%= 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 @@
<h2><%=l(:label_report_plural)%></h2>
-<strong><%=l(:field_tracker)%></strong>
+<div class="splitcontentleft">
+<strong><%=l(:field_tracker)%></strong>
<%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
-<br />
+<p align="right"><small><%= link_to l(:label_details), :detail => 'tracker' %></small>&nbsp;</p>
<strong><%=l(:field_priority)%></strong>
<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
-<br />
+<p align="right"><small><%= link_to l(:label_details), :detail => 'priority' %></small>&nbsp;</p>
+</div>
+<div class="splitcontentright">
<strong><%=l(:field_category)%></strong>
<%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
+<p align="right"><small><%= link_to l(:label_details), :detail => 'category' %></small>&nbsp;</p>
+</div>
-&nbsp;
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 @@
+<h2><%=l(:label_report_plural)%></h2>
+
+<strong><%=@report_title%></strong>
+<%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
+<br />
+<%= 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
--- /dev/null
+++ b/redmine/public/images/user_new.png
Binary files 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; }