Index: app/controllers/issues_controller.rb
===================================================================
--- app/controllers/issues_controller.rb (revision 1341)
+++ app/controllers/issues_controller.rb (working copy)
@@ -63,6 +63,10 @@
: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)) }
@@ -116,6 +120,7 @@
@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
Index: app/helpers/issues_helper.rb
===================================================================
--- app/helpers/issues_helper.rb (revision 1341)
+++ app/helpers/issues_helper.rb (working copy)
@@ -25,6 +25,7 @@
@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)}
" +
"#{@cached_label_start_date}: #{format_date(issue.start_date)}
" +
@@ -138,7 +139,8 @@
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"
@@ -164,7 +166,8 @@
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
Index: app/models/query.rb
===================================================================
--- app/models/query.rb (revision 1341)
+++ app/models/query.rb (working copy)
@@ -107,6 +107,7 @@
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
Index: app/views/issues/index.rfpdf
===================================================================
--- app/views/issues/index.rfpdf (revision 1341)
+++ app/views/issues/index.rfpdf (working copy)
@@ -4,7 +4,7 @@
pdf.AliasNbPages
pdf.footer_date = format_date(Date.today)
pdf.AddPage("L")
- row_height = 7
+ row_height = 5
#
# title
@@ -18,13 +18,14 @@
#
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)
@@ -36,13 +37,19 @@
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
Index: lang/en.yml
===================================================================
--- lang/en.yml (revision 1341)
+++ lang/en.yml (working copy)
@@ -174,6 +174,7 @@
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
Index: public/stylesheets/application.css
===================================================================
--- public/stylesheets/application.css (revision 1341)
+++ public/stylesheets/application.css (working copy)
@@ -86,8 +86,8 @@
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; }