@@ -276,18 +276,27 class ProjectsController < ApplicationController | |||||
276 | @versions = @project.versions |
|
276 | @versions = @project.versions | |
277 | end |
|
277 | end | |
278 |
|
278 | |||
279 |
# Show changelog |
|
279 | # Show changelog for @project | |
280 | def changelog |
|
280 | def changelog | |
|
281 | @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true]) | |||
|
282 | if request.get? | |||
|
283 | @selected_tracker_ids = @trackers.collect {|t| t.id.to_s } | |||
|
284 | else | |||
|
285 | @selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array | |||
|
286 | end | |||
|
287 | @selected_tracker_ids ||= [] | |||
281 | @fixed_issues = @project.issues.find(:all, |
|
288 | @fixed_issues = @project.issues.find(:all, | |
282 |
|
|
289 | :include => [ :fixed_version, :status, :tracker ], | |
283 |
|
|
290 | :conditions => [ "issue_statuses.is_closed=? and issues.tracker_id in (#{@selected_tracker_ids.join(',')}) and issues.fixed_version_id is not null", true], | |
284 | ) |
|
291 | :order => "versions.effective_date DESC, issues.id DESC" | |
|
292 | ) unless @selected_tracker_ids.empty? | |||
|
293 | @fixed_issues ||= [] | |||
285 | end |
|
294 | end | |
286 |
|
295 | |||
287 | private |
|
296 | private | |
288 | # Find project of id params[:id] |
|
297 | # Find project of id params[:id] | |
289 | # if not found, redirect to project list |
|
298 | # if not found, redirect to project list | |
290 |
# |
|
299 | # Used as a before_filter | |
291 | def find_project |
|
300 | def find_project | |
292 | @project = Project.find(params[:id]) |
|
301 | @project = Project.find(params[:id]) | |
293 | rescue |
|
302 | rescue |
@@ -1,12 +1,25 | |||||
1 | <h2><%=l(:label_change_log)%></h2> |
|
1 | <h2><%=l(:label_change_log)%></h2> | |
2 |
|
2 | |||
3 | <% fixed_issues = @fixed_issues.group_by {|i| i.fixed_version } %> |
|
3 | ||
4 | <% fixed_issues.each do |version, issues| %> |
|
4 | <%= start_form_tag %> | |
5 | <p><strong><%= version.name %></strong> - <%= format_date(version.effective_date) %><br /> |
|
5 | <% @trackers.each do |tracker| %> | |
6 | <%=h version.description %></p> |
|
6 | <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> | |
7 | <ul> |
|
7 | <%= tracker.name %> | |
8 | <% issues.each do |i| %> |
|
|||
9 | <li><%= link_to i.long_id, :controller => 'issues', :action => 'show', :id => i %> [<%= i.tracker.name %>]: <%= i.subject %></li> |
|
|||
10 | <% end %> |
|
|||
11 | </ul> |
|
|||
12 | <% end %> |
|
8 | <% end %> | |
|
9 | <%= submit_tag l(:button_apply), :class => 'button-small' %> | |||
|
10 | <%= end_form_tag %> | |||
|
11 | ||||
|
12 | <p> </p> | |||
|
13 | ||||
|
14 | <% ver_id = nil | |||
|
15 | @fixed_issues.each do |issue| %> | |||
|
16 | <% unless ver_id == issue.fixed_version_id %> | |||
|
17 | <% if ver_id %></ul><% end %> | |||
|
18 | <p><strong><%= issue.fixed_version.name %></strong> - <%= format_date(issue.fixed_version.effective_date) %><br /> | |||
|
19 | <%=h issue.fixed_version.description %></p> | |||
|
20 | <ul> | |||
|
21 | <% ver_id = issue.fixed_version_id | |||
|
22 | end %> | |||
|
23 | <li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%= issue.subject %></li> | |||
|
24 | <% end %> | |||
|
25 |
General Comments 0
You need to be logged in to leave comments.
Login now