diff options
-rw-r--r-- | app/controllers/issues_controller.rb | 22 | ||||
-rw-r--r-- | app/helpers/journals_helper.rb | 11 | ||||
-rw-r--r-- | app/views/issues/_history.rhtml | 3 | ||||
-rw-r--r-- | app/views/issues/show.rhtml | 6 | ||||
-rw-r--r-- | lang/bg.yml | 1 | ||||
-rw-r--r-- | lang/cs.yml | 1 | ||||
-rw-r--r-- | lang/da.yml | 1 | ||||
-rw-r--r-- | lang/de.yml | 1 | ||||
-rw-r--r-- | lang/en.yml | 1 | ||||
-rw-r--r-- | lang/es.yml | 1 | ||||
-rw-r--r-- | lang/fi.yml | 1 | ||||
-rw-r--r-- | lang/fr.yml | 1 | ||||
-rw-r--r-- | lang/he.yml | 1 | ||||
-rw-r--r-- | lang/hu.yml | 1 | ||||
-rw-r--r-- | lang/it.yml | 1 | ||||
-rw-r--r-- | lang/ja.yml | 1 | ||||
-rw-r--r-- | lang/ko.yml | 1 | ||||
-rw-r--r-- | lang/lt.yml | 1 | ||||
-rw-r--r-- | lang/nl.yml | 1 | ||||
-rw-r--r-- | lang/no.yml | 1 | ||||
-rw-r--r-- | lang/pl.yml | 1 | ||||
-rw-r--r-- | lang/pt-br.yml | 1 | ||||
-rw-r--r-- | lang/pt.yml | 1 | ||||
-rw-r--r-- | lang/ro.yml | 1 | ||||
-rw-r--r-- | lang/ru.yml | 1 | ||||
-rw-r--r-- | lang/sr.yml | 1 | ||||
-rw-r--r-- | lang/sv.yml | 1 | ||||
-rw-r--r-- | lang/th.yml | 1 | ||||
-rw-r--r-- | lang/uk.yml | 1 | ||||
-rw-r--r-- | lang/zh-tw.yml | 1 | ||||
-rw-r--r-- | lang/zh.yml | 1 | ||||
-rw-r--r-- | lib/redmine.rb | 4 | ||||
-rw-r--r-- | public/images/comment.png | bin | 0 -> 413 bytes | |||
-rw-r--r-- | test/functional/issues_controller_test.rb | 16 |
34 files changed, 81 insertions, 8 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index ca3309c46..defc0a11e 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -19,7 +19,7 @@ class IssuesController < ApplicationController layout 'base' menu_item :new_issue, :only => :new - before_filter :find_issue, :only => [:show, :edit, :destroy_attachment] + before_filter :find_issue, :only => [:show, :edit, :reply, :destroy_attachment] before_filter :find_issues, :only => [:bulk_edit, :move, :destroy] before_filter :find_project, :only => [:new, :update_form, :preview] before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu] @@ -208,6 +208,26 @@ class IssuesController < ApplicationController flash.now[:error] = l(:notice_locking_conflict) end + def reply + journal = Journal.find(params[:journal_id]) if params[:journal_id] + if journal + user = journal.user + text = journal.notes + else + user = @issue.author + text = @issue.description + end + content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> " + content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub("\n", "\n> ") + "\n\n" + render(:update) { |page| + page.replace_html "notes", content + page.show 'update' + page << "Form.Element.focus('notes');" + page << "Element.scrollTo('update');" + page << "$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;" + } + end + # Bulk edit a set of issues def bulk_edit if request.post? diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index 234bfabc0..92d6e5593 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -19,13 +19,16 @@ module JournalsHelper def render_notes(journal, options={}) content = '' editable = journal.editable_by?(User.current) - if editable && !journal.notes.blank? - links = [] + links = [] + if !journal.notes.blank? links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes", { :controller => 'journals', :action => 'edit', :id => journal }, - :title => l(:button_edit)) - content << content_tag('div', links.join(' '), :class => 'contextual') + :title => l(:button_edit)) if editable + links << link_to_remote(image_tag('comment.png'), + { :url => {:controller => 'issues', :action => 'reply', :id => journal.journalized, :journal_id => journal} }, + :title => l(:button_reply)) if options[:reply_links] end + content << content_tag('div', links.join(' '), :class => 'contextual') unless links.empty? content << textilizable(journal, :notes) content_tag('div', content, :id => "journal-#{journal.id}-notes", :class => (editable ? 'wiki editable' : 'wiki')) end diff --git a/app/views/issues/_history.rhtml b/app/views/issues/_history.rhtml index f29a44daf..b8efdb400 100644 --- a/app/views/issues/_history.rhtml +++ b/app/views/issues/_history.rhtml @@ -1,3 +1,4 @@ +<% reply_links = authorize_for('issues', 'edit') -%> <% for journal in journals %> <div id="change-<%= journal.id %>" class="journal"> <h4><div style="float:right;"><%= link_to "##{journal.indice}", :anchor => "note-#{journal.indice}" %></div> @@ -8,6 +9,6 @@ <li><%= show_detail(detail) %></li> <% end %> </ul> - <%= render_notes(journal) unless journal.notes.blank? %> + <%= render_notes(journal, :reply_links => reply_links) unless journal.notes.blank? %> </div> <% end %> diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index f788d0ec8..f1c8a82cd 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -56,6 +56,12 @@ end %> </table> <hr /> +<div class="contextual"> +<%= link_to_remote(image_tag('comment.png'), + { :url => {:controller => 'issues', :action => 'reply', :id => @issue} }, + :title => l(:button_reply)) if authorize_for('issues', 'edit') %> +</div> + <p><strong><%=l(:field_description)%></strong></p> <div class="wiki"> <%= textilizable @issue, :description, :attachments => @issue.attachments %> diff --git a/lang/bg.yml b/lang/bg.yml index 10198bce9..05a0b0d60 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/cs.yml b/lang/cs.yml index f90068b3b..829f4449e 100644 --- a/lang/cs.yml +++ b/lang/cs.yml @@ -626,3 +626,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/da.yml b/lang/da.yml index ca4ddeb46..92df87e3f 100644 --- a/lang/da.yml +++ b/lang/da.yml @@ -623,3 +623,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/de.yml b/lang/de.yml index fa33e1c74..1351d1944 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -622,3 +622,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/en.yml b/lang/en.yml index f9e07d211..4184a9175 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -596,6 +596,7 @@ text_destroy_time_entries_question: %.02f hours were reported on the issues you text_destroy_time_entries: Delete reported hours text_assign_time_entries_to_project: Assign reported hours to the project text_reassign_time_entries: 'Reassign reported hours to this issue:' +text_user_wrote: '%s wrote:' default_role_manager: Manager default_role_developper: Developer diff --git a/lang/es.yml b/lang/es.yml index 3d8c0a931..ea479630d 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -624,3 +624,4 @@ text_subprojects_destroy_warning: 'Sus subprojectos: %s también se eliminarán' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/fi.yml b/lang/fi.yml index 60428bb49..b3b888622 100644 --- a/lang/fi.yml +++ b/lang/fi.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Tämän alaprojekti(t): %s tullaan myös pois label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/fr.yml b/lang/fr.yml index 8b002bbf6..a802a44cc 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -596,6 +596,7 @@ text_destroy_time_entries_question: %.02f heures ont été enregistrées sur les text_destroy_time_entries: Supprimer les heures text_assign_time_entries_to_project: Reporter les heures sur le projet text_reassign_time_entries: 'Reporter les heures sur cette demande:' +text_user_wrote: '%s a écrit:' default_role_manager: Manager default_role_developper: Développeur diff --git a/lang/he.yml b/lang/he.yml index f972ef62a..c4d69ebb9 100644 --- a/lang/he.yml +++ b/lang/he.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/hu.yml b/lang/hu.yml index f6d312ce0..fd7bf9f52 100644 --- a/lang/hu.yml +++ b/lang/hu.yml @@ -622,3 +622,4 @@ enumeration_doc_categories: Dokumentum kategóriák enumeration_activities: Tevékenységek (idő rögzítés) mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/it.yml b/lang/it.yml index a8646644a..519dcd01f 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/ja.yml b/lang/ja.yml index d119cf55e..714539c7d 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -622,3 +622,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/ko.yml b/lang/ko.yml index 98dde9e06..81656040c 100644 --- a/lang/ko.yml +++ b/lang/ko.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/lt.yml b/lang/lt.yml index 6b791d87b..89e607a83 100644 --- a/lang/lt.yml +++ b/lang/lt.yml @@ -623,3 +623,4 @@ label_and_its_subprojects: %s projektas ir jo subprojektai mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/nl.yml b/lang/nl.yml index c36eaecd5..eebc7d993 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -622,3 +622,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/no.yml b/lang/no.yml index 5e788dc50..3f6ef6ded 100644 --- a/lang/no.yml +++ b/lang/no.yml @@ -622,3 +622,4 @@ enumeration_doc_categories: Dokument-kategorier enumeration_activities: Aktiviteter (tidssporing) mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/pl.yml b/lang/pl.yml index 4476c2160..81a7a0dba 100644 --- a/lang/pl.yml +++ b/lang/pl.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/pt-br.yml b/lang/pt-br.yml index 9b3d23151..47e80a144 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -621,3 +621,4 @@ label_age: Age label_and_its_subprojects: %s and its subprojects
mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:"
mail_subject_reminder: "%d issue(s) due in the next days"
+text_user_wrote: '%s wrote:'
diff --git a/lang/pt.yml b/lang/pt.yml index c56b76a0b..002a1b7f8 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/ro.yml b/lang/ro.yml index 30464569b..6bcd55a50 100644 --- a/lang/ro.yml +++ b/lang/ro.yml @@ -621,3 +621,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/ru.yml b/lang/ru.yml index f4fd92037..fa8fd69a9 100644 --- a/lang/ru.yml +++ b/lang/ru.yml @@ -625,3 +625,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/sr.yml b/lang/sr.yml index 53e4f9f2c..9a4adf214 100644 --- a/lang/sr.yml +++ b/lang/sr.yml @@ -622,3 +622,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/sv.yml b/lang/sv.yml index 248f3dcba..1ab11e98b 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -622,3 +622,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/th.yml b/lang/th.yml index 444316aa1..751aac749 100644 --- a/lang/th.yml +++ b/lang/th.yml @@ -624,3 +624,4 @@ enumeration_activities: กิจกรรม (ใช้ในการติด label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/uk.yml b/lang/uk.yml index 3cc60ef48..3ab4462ed 100644 --- a/lang/uk.yml +++ b/lang/uk.yml @@ -623,3 +623,4 @@ text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.' label_and_its_subprojects: %s and its subprojects mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml index 3926113b2..3b7808aae 100644 --- a/lang/zh-tw.yml +++ b/lang/zh-tw.yml @@ -622,3 +622,4 @@ enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" mail_subject_reminder: "%d issue(s) due in the next days" +text_user_wrote: '%s wrote:' diff --git a/lang/zh.yml b/lang/zh.yml index 55516e033..b5ecace82 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -622,3 +622,4 @@ enumeration_doc_categories: 文档类别 enumeration_activities: 活动(时间跟踪) mail_subject_reminder: "%d issue(s) due in the next days" mail_body_reminder: "%d issue(s) that are assigned to you are due in the next %d days:" +text_user_wrote: '%s wrote:' diff --git a/lib/redmine.rb b/lib/redmine.rb index b21f5716d..7b9832d62 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -32,9 +32,9 @@ Redmine::AccessControl.map do |map| :queries => :index, :reports => :issue_report}, :public => true map.permission :add_issues, {:issues => :new} - map.permission :edit_issues, {:issues => [:edit, :bulk_edit, :destroy_attachment]} + map.permission :edit_issues, {:issues => [:edit, :reply, :bulk_edit, :destroy_attachment]} map.permission :manage_issue_relations, {:issue_relations => [:new, :destroy]} - map.permission :add_issue_notes, {:issues => :edit} + map.permission :add_issue_notes, {:issues => [:edit, :reply]} map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin map.permission :move_issues, {:issues => :move}, :require => :loggedin diff --git a/public/images/comment.png b/public/images/comment.png Binary files differnew file mode 100644 index 000000000..7bc9233ea --- /dev/null +++ b/public/images/comment.png diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index c4389fedd..7c7d44e5f 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -263,6 +263,22 @@ class IssuesControllerTest < Test::Unit::TestCase :content => 'Urgent', :attributes => { :selected => 'selected' } } end + + def test_reply_to_issue + @request.session[:user_id] = 2 + get :reply, :id => 1 + assert_response :success + assert_select_rjs :show, "update" + assert_select_rjs :replace_html, "notes" + end + + def test_reply_to_note + @request.session[:user_id] = 2 + get :reply, :id => 1, :journal_id => 2 + assert_response :success + assert_select_rjs :show, "update" + assert_select_rjs :replace_html, "notes" + end def test_post_edit @request.session[:user_id] = 2 |