Feature #1474 » show_last_comment_in_issues_list.patch
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
:conditions => @query.statement,
|
||
|
:limit => limit,
|
||
|
:offset => @issue_pages.current.offset
|
||
|
@issues.each do |issue|
|
||
|
journals = issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on DESC LIMIT 1")
|
||
|
issue.last_comment ||= journals.first[:notes] if !journals.first.nil?
|
||
|
end
|
||
|
respond_to do |format|
|
||
|
format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
|
||
|
format.atom { render_feed(@issues, :title => l(:label_issue_plural)) }
|
||
| ... | ... | |
|
@issue.project = @project
|
||
|
@issue.author = User.current
|
||
|
@issue.tracker ||= @project.trackers.find(params[:tracker_id] ? params[:tracker_id] : :first)
|
||
|
#@issue.last_comment = " "
|
||
|
if @issue.tracker.nil?
|
||
|
flash.now[:error] = 'No tracker is associated to this project. Please check the Project settings.'
|
||
|
render :nothing => true, :layout => true
|
||
| app/helpers/issues_helper.rb (working copy) | ||
|---|---|---|
|
@cached_label_due_date ||= l(:field_due_date)
|
||
|
@cached_label_assigned_to ||= l(:field_assigned_to)
|
||
|
@cached_label_priority ||= l(:field_priority)
|
||
|
#@cahced_label_last_comment ||= l(:field_last_comment)
|
||
|
|
||
|
link_to_issue(issue) + ": #{h(issue.subject)}<br /><br />" +
|
||
|
"<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.start_date)}<br />" +
|
||
| ... | ... | |
|
l(:field_done_ratio),
|
||
|
l(:field_estimated_hours),
|
||
|
l(:field_created_on),
|
||
|
l(:field_updated_on)
|
||
|
l(:field_updated_on),
|
||
|
l(:field_last_comment),
|
||
|
]
|
||
|
# Export project custom fields if project is given
|
||
|
# otherwise export custom fields marked as "For all projects"
|
||
| ... | ... | |
|
issue.done_ratio,
|
||
|
issue.estimated_hours,
|
||
|
format_time(issue.created_on),
|
||
|
format_time(issue.updated_on)
|
||
|
format_time(issue.updated_on),
|
||
|
issue.last_comment
|
||
|
]
|
||
|
custom_fields.each {|f| fields << show_value(issue.custom_value_for(f)) }
|
||
|
fields << issue.description
|
||
| app/models/query.rb (working copy) | ||
|---|---|---|
|
QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"),
|
||
|
QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio"),
|
||
|
QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'),
|
||
|
QueryColumn.new(:last_comment, :sortable => "#{Issue.table_name}.last_comment"),
|
||
|
]
|
||
|
cattr_reader :available_columns
|
||
|
|
||
| app/views/issues/index.rfpdf (working copy) | ||
|---|---|---|
|
pdf.AliasNbPages
|
||
|
pdf.footer_date = format_date(Date.today)
|
||
|
pdf.AddPage("L")
|
||
|
row_height = 7
|
||
|
row_height = 5
|
||
|
|
||
|
#
|
||
|
# title
|
||
| ... | ... | |
|
#
|
||
|
pdf.SetFontStyle('B',10)
|
||
|
pdf.SetFillColor(230, 230, 230)
|
||
|
pdf.Cell(15, row_height, "#", 0, 0, 'L', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_tracker), 0, 0, 'L', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_status), 0, 0, 'L', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_priority), 0, 0, 'L', 1)
|
||
|
pdf.Cell(40, row_height, l(:field_assigned_to), 0, 0, 'L', 1)
|
||
|
pdf.Cell(25, row_height, l(:field_updated_on), 0, 0, 'L', 1)
|
||
|
pdf.Cell(0, row_height, l(:field_subject), 0, 0, 'L', 1)
|
||
|
pdf.Cell(15, row_height, "#", 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_tracker), 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_status), 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_priority), 0, 0, 'C', 1)
|
||
|
pdf.Cell(50, row_height, l(:field_assigned_to), 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, l(:field_updated_on), 0, 0, 'C', 1)
|
||
|
pdf.Cell(0, row_height, l(:field_subject), 0, 0, 'L', 1)
|
||
|
|
||
|
pdf.Line(10, pdf.GetY, 287, pdf.GetY)
|
||
|
pdf.Ln
|
||
|
pdf.Line(10, pdf.GetY, 287, pdf.GetY)
|
||
| ... | ... | |
|
pdf.SetFontStyle('',9)
|
||
|
pdf.SetFillColor(255, 255, 255)
|
||
|
@issues.each do |issue|
|
||
|
pdf.Cell(15, row_height, issue.id.to_s, 0, 0, 'L', 1)
|
||
|
pdf.Cell(30, row_height, issue.tracker.name, 0, 0, 'L', 1)
|
||
|
pdf.Cell(30, row_height, issue.status.name, 0, 0, 'L', 1)
|
||
|
pdf.Cell(30, row_height, issue.priority.name, 0, 0, 'L', 1)
|
||
|
pdf.Cell(40, row_height, issue.assigned_to ? issue.assigned_to.name : '', 0, 0, 'L', 1)
|
||
|
pdf.Cell(25, row_height, format_date(issue.updated_on), 0, 0, 'L', 1)
|
||
|
pdf.MultiCell(0, row_height, (@project == issue.project ? issue.subject : "#{issue.project.name} - #{issue.subject}"))
|
||
|
pdf.Cell(15, row_height, issue.id.to_s, 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, issue.tracker.name, 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, issue.status.name, 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, issue.priority.name, 0, 0, 'C', 1)
|
||
|
pdf.Cell(50, row_height, issue.assigned_to ? issue.assigned_to.name : '', 0, 0, 'C', 1)
|
||
|
pdf.Cell(30, row_height, format_date(issue.updated_on), 0, 0, 'C', 1)
|
||
|
pdf.MultiCell(0, row_height, (@project == issue.project ? issue.subject : "#{issue.project.name}\n#{issue.subject}"))
|
||
|
if issue.last_comment != nil
|
||
|
if issue.last_comment != ""
|
||
|
pdf.Cell(23, row_height, "Last Comment:",0,0,'R',1)
|
||
|
pdf.MultiCell(0, row_height, issue.last_comment)
|
||
|
end
|
||
|
end
|
||
|
pdf.Line(10, pdf.GetY, 287, pdf.GetY)
|
||
|
pdf.SetY(pdf.GetY() + 1)
|
||
|
end
|
||
| lang/en.yml (working copy) | ||
|---|---|---|
|
field_assignable: Issues can be assigned to this role
|
||
|
field_redirect_existing_links: Redirect existing links
|
||
|
field_estimated_hours: Estimated time
|
||
|
field_last_comment: Last Comment
|
||
|
field_column_names: Columns
|
||
|
field_time_zone: Time zone
|
||
|
field_searchable: Searchable
|
||
| public/stylesheets/application.css (working copy) | ||
|---|---|---|
|
table.list.issues { margin-top: 10px; }
|
||
|
tr.issue { text-align: center; white-space: nowrap; }
|
||
|
tr.issue td.subject, tr.issue td.category { white-space: normal; }
|
||
|
tr.issue td.subject { text-align: left; }
|
||
|
tr.issue td.subject, tr.issue td.category, tr.issue td.last_comment { white-space: normal; }
|
||
|
tr.issue td.subject, tr.issue td.last_comment { text-align: left; width: 25%}
|
||
|
tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;}
|
||
|
tr.entry { border: 1px solid #f8f8f8; }
|
||