]> source.dussan.org Git - redmine.git/commitdiff
issues/add_note added
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 21 Oct 2006 16:07:34 +0000 (16:07 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 21 Oct 2006 16:07:34 +0000 (16:07 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@36 e93f8b46-1217-0410-a6f0-8f06a7374b81

redmine/app/controllers/issues_controller.rb
redmine/app/views/issues/show.rhtml
redmine/db/migrate/003_issue_add_note.rb [new file with mode: 0644]
redmine/lang/de.yml
redmine/lang/en.yml
redmine/lang/es.yml
redmine/lang/fr.yml

index 9452995fbd7dd9613460b3b15a68de5be3f29865..effd3145e97a83ca721c58c8ac92d6f4a7cdf81a 100644 (file)
@@ -47,6 +47,21 @@ class IssuesController < ApplicationController
       end\r
     end                
   end\r
+  \r
+  def add_note\r
+    unless params[:history][:notes].empty?\r
+      @history = @issue.histories.build(params[:history])\r
+      @history.author_id = self.logged_in_user.id if self.logged_in_user\r
+      @history.status = @issue.status\r
+      if @history.save\r
+        flash[:notice] = l(:notice_successful_update)\r
+        redirect_to :action => 'show', :id => @issue\r
+        return\r
+      end\r
+    end\r
+    show\r
+    render :action => 'show'\r
+  end\r
 \r
   def change_status\r
     @history = @issue.histories.build(params[:history])        \r
index 1258a050c42dc5d171f61a8bfece11b96bccb46c..3c1a0ed98d352933c79ffc37aaeb257bb761e3b4 100644 (file)
   <%= end_form_tag %>\r
   &nbsp;&nbsp;\r
 <% end %>\r
-\r
 </div>\r
 \r
+<% if authorize_for('issues', 'add_note') %>\r
+  <div class="box">\r
+  <h3><%= l(:label_add_note) %></h3>\r
+  <%= start_form_tag ({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) %>\r
+  <p><label for="history_notes"><%=l(:field_notes)%></label>\r
+    <%= text_area 'history', 'notes', :cols => 60, :rows => 10  %></p>\r
+  <%= submit_tag l(:button_add) %>\r
+  <%= end_form_tag %>\r
+  </div>\r
+<% end %>\r
 \r
 <div class="splitcontentleft">\r
 <div class="box">\r
@@ -64,7 +73,7 @@
 <td><b><%= history.status.name %></b></td>\r
 </tr>\r
 <% if history.notes? %>\r
-       <tr><td colspan=3><div class="notes"><%= history.notes %></td></tr>\r
+       <tr><td colspan=3><%= simple_format auto_link history.notes %></td></tr>\r
 <% end %>\r
 <% end %>
 </table>\r
diff --git a/redmine/db/migrate/003_issue_add_note.rb b/redmine/db/migrate/003_issue_add_note.rb
new file mode 100644 (file)
index 0000000..9f20039
--- /dev/null
@@ -0,0 +1,9 @@
+class IssueAddNote < ActiveRecord::Migration
+  def self.up
+    Permission.create :controller => "issues", :action => "add_note", :description => "label_add_note", :sort => 1057, :mail_option => 1, :mail_enabled => 0
+  end
+
+  def self.down
+    Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'add_note']).destroy
+  end
+end
index aea0de94f53e804186123483f604873789cffecd..f2dcf89947e9ffddc05c68924fee8ba1b40e4ff8 100644 (file)
@@ -241,6 +241,7 @@ label_next: Weiter
 label_previous: Zurück\r
 label_used_by: Benutzt von\r
 #label_details: Details...\r
+#label_add_note: Add a note\r
 \r
 button_login: Einloggen\r
 button_submit: Einreichen\r
index f412b0bc3bbc3c6c04811911b97cf672ad31d978..b02038ea9cdd8198dde995a0fcb778ca165f6eb2 100644 (file)
@@ -241,6 +241,7 @@ label_next: Next
 label_previous: Previous\r
 label_used_by: Used by\r
 label_details: Details...\r
+label_add_note: Add a note\r
 \r
 button_login: Login\r
 button_submit: Submit\r
index a2543eca8c8bf66c3f17eb5f9cd6ba1ede1f6bc0..5b2f69e07a4430f46f09371a5418a236602c13a2 100644 (file)
@@ -241,6 +241,7 @@ label_next: Próximo
 label_previous: Precedente\r
 label_used_by: Utilizado por\r
 #label_details: Details...\r
+#label_add_note: Add a note\r
 \r
 button_login: Conexión\r
 button_submit: Someter\r
index 22a625ca36bb29fefb7ed57a478af4ceb95899c9..c5071a2c5bf6c218283a795819cd69e0129ac762 100644 (file)
@@ -241,6 +241,7 @@ label_next: Suivant
 label_previous: Précédent\r
 label_used_by: Utilisé par\r
 label_details: Détails...\r
+label_add_note: Ajouter une note\r
 \r
 button_login: Connexion\r
 button_submit: Soumettre\r