Vote #63451
完了Show last comment/notes in the issue list
0%
説明
This patch will add a column to show the last comment in the issue tracker list(also shows them in the csv and pdf outputs as well). This is helpful to get a quick status update on many issues without having to go into the issue
journals
My company is looking for this feature as well. We'd like to be able to generate reports and show the last comment as an optional field in the issue reports. The patch here look similar what I'd need except it's very old.
What I'd expect to see is an option to add it similar to the "Show Description" option.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
I've developed a patch against the latest version in source control (post 3.2.0, it also works against 3.2.0). This should do the same thing - it also adds a length restriction to the field.
This patch was created for and funded by Noble Markets (http://noblex.io/)
--------------------------------------------------------------------------------
This issue is the same as or very similar to the following issues:
Issue #10707
Issue #20520
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Hello,
I'm newbie. How do you apply this patch ? Have you got small tutorial ?
thanks
--------------------------------------------------------------------------------
Patches are a standard file format, there's lots of information about how to apply them. Google is your friend. If you still have problems applying a patch after you've done your research on google, come back and ask about a specific problem you're having.
--------------------------------------------------------------------------------
Hi,
Sorry, you're right.
So, i have an error when i run patch command (probably a newbie problem sorry...) :
<pre>
D:\APPS\redmine\apps\redmine\htdocs>D:\APPS\redmine\git\usr\bin\patch.exe -p0 <
redmine-last-note-patch.diff
can't find file to patch at input line 67
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 96080580083081655a8b5879a8d04bef8042ace2 Mon Sep 17 00:00:00 2001
|From: Tom Bull <tom@tombull.com>
|Date: Wed, 2 Mar 2016 13:58:30 +0000
|Subject: [PATCH] Merge branch '3.2-stable' of github.com:redmine/redmine
|
|# Conflicts:
|# config/locales/ar.yml
|# config/locales/az.yml
|# config/locales/bs.yml
|# config/locales/ca.yml
|# config/locales/cs.yml
|# config/locales/da.yml
|# config/locales/de.yml
|# config/locales/el.yml
|# config/locales/en-GB.yml
|# config/locales/es-PA.yml
|# config/locales/es.yml
|# config/locales/et.yml
|# config/locales/eu.yml
|# config/locales/fa.yml
|# config/locales/fi.yml
|# config/locales/gl.yml
|# config/locales/he.yml
|# config/locales/hr.yml
|# config/locales/hu.yml
|# config/locales/id.yml
|# config/locales/it.yml
|# config/locales/ja.yml
|# config/locales/ko.yml
|# config/locales/lt.yml
|# config/locales/lv.yml
|# config/locales/mk.yml
|# config/locales/mn.yml
|# config/locales/nl.yml
|# config/locales/no.yml
|# config/locales/pl.yml
|# config/locales/pt-BR.yml
|# config/locales/pt.yml
|# config/locales/ro.yml
|# config/locales/ru.yml
|# config/locales/sk.yml
|# config/locales/sl.yml
|# config/locales/sq.yml
|# config/locales/sr-YU.yml
|# config/locales/sr.yml
|# config/locales/sv.yml
|# config/locales/th.yml
|# config/locales/tr.yml
|# config/locales/uk.yml
|# config/locales/vi.yml
|# config/locales/zh.yml
|# lib/redmine/pagination.rb
|---
| app/helpers/queries_helper.rb | 12 ++++++++++++
| app/models/issue.rb | 10 ++++++++++
| app/models/issue_query.rb | 1 +
| app/views/settings/_display.html.erb | 2 ++
| config/locales/en.yml | 2 ++
| config/settings.yml | 3 +++
| public/stylesheets/application.css | 2 +-
| 7 files changed, 31 insertions(+), 1 deletion(-)
|
|diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
|index 9ad2540..51f60c9 100644
|--- a/app/helpers/queries_helper.rb
|+++ b/app/helpers/queries_helper.rb
--------------------------
File to patch:
</pre>
The file is present so i don't know what is the problem :
<pre>
D:\APPS\redmine\apps\redmine\htdocs\app\helpers>dir queri*
Volume in drive D is DATA
Volume Serial Number is 0020-E5DB
Directory of D:\APPS\redmine\apps\redmine\htdocs\app\helpers
06/12/2015 15:06 8 794 queries_helper.rb
1 File(s) 8 794 bytes
0 Dir(s) 12 256 325 632 bytes free
</pre>
I have installed 3.2.0.2 windows version of redmine.
Have you got an idea of the problem ?
Thanks
--------------------------------------------------------------------------------
Maybe try with p1 rather than p0? I think this patch was prepared such that you'd need to use p1. Let me know if that works.
--------------------------------------------------------------------------------
You're right. It works now.
Thank you very much !!
--------------------------------------------------------------------------------
F. Priou, please use "forums":http://www.redmine.org/projects/redmine/boards for questions.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
We really need this feature and we made a patch that implements this.
Regarding the implementation:
* the *Last notes* column behave like the description column (is shown under the issue row)
* it can be exported to csv / pdf.
* it checks the journal visibility
* if both columns (description and last notes) are added to the query, the column name is displayed also in order to know which is the description and which is the last note.
!last_notes_column.png!
Related to the implementation:
I'm not sure if it's a bug or not, but when I tried to use the method "visible_journals" from the Issue model I received the below SQL error:
<pre>
Mysql2::Error: Unknown column 'projects.status' in 'where clause': SELECT `journals`.* FROM `journals` WHERE `journals`.`journalized_id` = 13 AND `journals`.`journalized_type` = 'Issue' AND ((journals.private_notes = 0 OR (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))))
</pre>
--------------------------------------------------------------------------------
Marius BALTEANU, thank you for sharing the patch. But the patch cannot be applied to the current trunk (r16111) cleanly.
Could you provide a patch against the trunk?
<pre>
$ patch -p1 < add_last_notes_column.diff
patching file app/helpers/queries_helper.rb
patching file app/models/issue.rb
patching file app/models/issue_query.rb
patching file app/views/issues/_list.html.erb
patching file app/views/issues/index.html.erb
patching file app/views/timelog/_list.html.erb
patching file config/locales/en.yml
patching file lib/redmine/export/pdf/issues_pdf_helper.rb
Hunk #1 FAILED at 266.
Hunk #2 succeeded at 327 with fuzz 2.
1 out of 2 hunks FAILED -- saving rejects to file lib/redmine/export/pdf/issues_pdf_helper.rb.rej
patching file public/stylesheets/application.css
patching file test/functional/issues_controller_test.rb
patching file test/unit/query_test.rb
</pre>
--------------------------------------------------------------------------------
Very strange, I made the patch against the current trunk, but I used a new option to ignore the white spaces.
I attached a new version which applies ok.
--------------------------------------------------------------------------------
Marius BALTEANU, Thanks for the new patch.
Unfortunately I came across the error "SQLite3::SQLException: no such column: projects.status" while processing IssuesController#index.
{{collapse(development.log)
<pre>
Completed 500 Internal Server Error in 177ms (ActiveRecord: 14.7ms)
ActionView::Template::Error (SQLite3::SQLException: no such column: projects.status: SELECT "journals".* FROM "journals" WHERE "journals"."journalized_id" = ? AND "journals"."journalized_type" = ? AND ((journals.private_notes = 'f' OR (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))))):
30: <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
31: <%= raw query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
32: </tr>
33: <% @query.block_columns.each do |column|
34: if (text = column_content(column, issue)) && text.present? -%>
35: <tr class="<%= current_cycle %>">
36: <td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>">
app/helpers/queries_helper.rb:187:in `column_value'
app/helpers/queries_helper.rb:172:in `column_content'
app/views/issues/_list.html.erb:33:in `block (3 levels) in _app_views_issues__list_html_erb__2932462031535719347_70211979156140'
app/views/issues/_list.html.erb:32:in `each'
app/views/issues/_list.html.erb:32:in `block (2 levels) in _app_views_issues__list_html_erb__2932462031535719347_70211979156140'
app/helpers/issues_helper.rb:41:in `block in grouped_issue_list'
app/helpers/queries_helper.rb:137:in `block in grouped_query_results'
app/helpers/queries_helper.rb:122:in `each'
app/helpers/queries_helper.rb:122:in `grouped_query_results'
app/helpers/issues_helper.rb:37:in `grouped_issue_list'
app/views/issues/_list.html.erb:16:in `block in _app_views_issues__list_html_erb__2932462031535719347_70211979156140'
app/views/issues/_list.html.erb:1:in `_app_views_issues__list_html_erb__2932462031535719347_70211979156140'
app/views/issues/index.html.erb:19:in `_app_views_issues_index_html_erb__3156214057539695494_70212079869460'
app/controllers/issues_controller.rb:76:in `block (2 levels) in index'
app/controllers/issues_controller.rb:75:in `index'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
</pre>
}}
--------------------------------------------------------------------------------
Go MAEDA wrote:
>
> Unfortunately I came across the error "SQLite3::SQLException: no such column: projects.status" while processing IssuesController#index.
Sorry for the broken patches, I totally messed up the versions.
Now I have attached the 3rd version which applies ok and passes all the tests.
--------------------------------------------------------------------------------
Thanks to Marius, now it works fine for me. Passed all tests.
I have been using Redmine for customer support. This feature is very useful to check recent responses from customers.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> I have been using Redmine for customer support. This feature is very useful to check recent responses from customers.
Indeed, this is our use case too.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Now I have attached the 3rd version which applies ok and passes all the tests.
FWIW: I have extracted (from a trunk checkout at r16111) an updated version of your note 20 patch, without all these whitespace changes, which I'll hereby attach — thus trying to ease a review. I didn't change any of the code in the patch nor have I tested it.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Thanks Mischa for removing the whitespace changes from the patch.
I've updated the patch to work with the current trunk and to use the new logic implemented in #17720. Hope is good enough now.
--------------------------------------------------------------------------------
Patch committed, thanks Marius.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
@Chris Peterson: I tried to install this patch to my Redmine server 3.3.3, but met below error message, could you please help take a look if you can fix it? thank you!
!https://www.redmine.org/attachments/download/20324/installing%20error%20message%20-p1.png!
!https://www.redmine.org/attachments/download/20323/installing%20error%20message%20-p0.png!
--------------------------------------------------------------------------------
related_issues
relates,Closed,22452,Add ability to display last note on issue query
duplicates,Closed,20520,Latest comment on issue list
duplicates,Closed,1538,Adding "updates" information to CSV export
duplicates,Closed,10707,CSV and PDF should be able to export the last update issue comment