Commit 316f02b4 authored by jplang's avatar jplang

issues/add_note added

git-svn-id: https://svn.redmine.org/redmine/trunk@36 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 9e2b98ff
...@@ -47,6 +47,21 @@ class IssuesController < ApplicationController ...@@ -47,6 +47,21 @@ class IssuesController < ApplicationController
end end
end end
end end
def add_note
unless params[:history][:notes].empty?
@history = @issue.histories.build(params[:history])
@history.author_id = self.logged_in_user.id if self.logged_in_user
@history.status = @issue.status
if @history.save
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @issue
return
end
end
show
render :action => 'show'
end
def change_status def change_status
@history = @issue.histories.build(params[:history]) @history = @issue.histories.build(params[:history])
......
...@@ -49,9 +49,18 @@ ...@@ -49,9 +49,18 @@
<%= end_form_tag %> <%= end_form_tag %>
&nbsp;&nbsp; &nbsp;&nbsp;
<% end %> <% end %>
</div> </div>
<% if authorize_for('issues', 'add_note') %>
<div class="box">
<h3><%= l(:label_add_note) %></h3>
<%= start_form_tag ({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) %>
<p><label for="history_notes"><%=l(:field_notes)%></label>
<%= text_area 'history', 'notes', :cols => 60, :rows => 10 %></p>
<%= submit_tag l(:button_add) %>
<%= end_form_tag %>
</div>
<% end %>
<div class="splitcontentleft"> <div class="splitcontentleft">
<div class="box"> <div class="box">
...@@ -64,7 +73,7 @@ ...@@ -64,7 +73,7 @@
<td><b><%= history.status.name %></b></td> <td><b><%= history.status.name %></b></td>
</tr> </tr>
<% if history.notes? %> <% if history.notes? %>
<tr><td colspan=3><div class="notes"><%= history.notes %></td></tr> <tr><td colspan=3><%= simple_format auto_link history.notes %></td></tr>
<% end %> <% end %>
<% end %> <% end %>
</table> </table>
......
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
...@@ -241,6 +241,7 @@ label_next: Weiter ...@@ -241,6 +241,7 @@ label_next: Weiter
label_previous: Zurück label_previous: Zurück
label_used_by: Benutzt von label_used_by: Benutzt von
#label_details: Details... #label_details: Details...
#label_add_note: Add a note
button_login: Einloggen button_login: Einloggen
button_submit: Einreichen button_submit: Einreichen
......
...@@ -241,6 +241,7 @@ label_next: Next ...@@ -241,6 +241,7 @@ label_next: Next
label_previous: Previous label_previous: Previous
label_used_by: Used by label_used_by: Used by
label_details: Details... label_details: Details...
label_add_note: Add a note
button_login: Login button_login: Login
button_submit: Submit button_submit: Submit
......
...@@ -241,6 +241,7 @@ label_next: Próximo ...@@ -241,6 +241,7 @@ label_next: Próximo
label_previous: Precedente label_previous: Precedente
label_used_by: Utilizado por label_used_by: Utilizado por
#label_details: Details... #label_details: Details...
#label_add_note: Add a note
button_login: Conexión button_login: Conexión
button_submit: Someter button_submit: Someter
......
...@@ -241,6 +241,7 @@ label_next: Suivant ...@@ -241,6 +241,7 @@ label_next: Suivant
label_previous: Précédent label_previous: Précédent
label_used_by: Utilisé par label_used_by: Utilisé par
label_details: Détails... label_details: Détails...
label_add_note: Ajouter une note
button_login: Connexion button_login: Connexion
button_submit: Soumettre button_submit: Soumettre
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment