##// END OF EJS Templates
issues/add_note added...
Jean-Philippe Lang -
r34:79cbe8d199c3
parent child
Show More
@@ -0,0 +1,9
1 class IssueAddNote < ActiveRecord::Migration
2 def self.up
3 Permission.create :controller => "issues", :action => "add_note", :description => "label_add_note", :sort => 1057, :mail_option => 1, :mail_enabled => 0
4 end
5
6 def self.down
7 Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'add_note']).destroy
8 end
9 end
@@ -47,6 +47,21 class IssuesController < ApplicationController
47 end
47 end
48 end
48 end
49 end
49 end
50
51 def add_note
52 unless params[:history][:notes].empty?
53 @history = @issue.histories.build(params[:history])
54 @history.author_id = self.logged_in_user.id if self.logged_in_user
55 @history.status = @issue.status
56 if @history.save
57 flash[:notice] = l(:notice_successful_update)
58 redirect_to :action => 'show', :id => @issue
59 return
60 end
61 end
62 show
63 render :action => 'show'
64 end
50
65
51 def change_status
66 def change_status
52 @history = @issue.histories.build(params[:history])
67 @history = @issue.histories.build(params[:history])
@@ -49,9 +49,18
49 <%= end_form_tag %>
49 <%= end_form_tag %>
50 &nbsp;&nbsp;
50 &nbsp;&nbsp;
51 <% end %>
51 <% end %>
52
53 </div>
52 </div>
54
53
54 <% if authorize_for('issues', 'add_note') %>
55 <div class="box">
56 <h3><%= l(:label_add_note) %></h3>
57 <%= start_form_tag ({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) %>
58 <p><label for="history_notes"><%=l(:field_notes)%></label>
59 <%= text_area 'history', 'notes', :cols => 60, :rows => 10 %></p>
60 <%= submit_tag l(:button_add) %>
61 <%= end_form_tag %>
62 </div>
63 <% end %>
55
64
56 <div class="splitcontentleft">
65 <div class="splitcontentleft">
57 <div class="box">
66 <div class="box">
@@ -64,7 +73,7
64 <td><b><%= history.status.name %></b></td>
73 <td><b><%= history.status.name %></b></td>
65 </tr>
74 </tr>
66 <% if history.notes? %>
75 <% if history.notes? %>
67 <tr><td colspan=3><div class="notes"><%= history.notes %></td></tr>
76 <tr><td colspan=3><%= simple_format auto_link history.notes %></td></tr>
68 <% end %>
77 <% end %>
69 <% end %>
78 <% end %>
70 </table>
79 </table>
@@ -241,6 +241,7 label_next: Weiter
241 label_previous: Zurück
241 label_previous: Zurück
242 label_used_by: Benutzt von
242 label_used_by: Benutzt von
243 #label_details: Details...
243 #label_details: Details...
244 #label_add_note: Add a note
244
245
245 button_login: Einloggen
246 button_login: Einloggen
246 button_submit: Einreichen
247 button_submit: Einreichen
@@ -241,6 +241,7 label_next: Next
241 label_previous: Previous
241 label_previous: Previous
242 label_used_by: Used by
242 label_used_by: Used by
243 label_details: Details...
243 label_details: Details...
244 label_add_note: Add a note
244
245
245 button_login: Login
246 button_login: Login
246 button_submit: Submit
247 button_submit: Submit
@@ -241,6 +241,7 label_next: Próximo
241 label_previous: Precedente
241 label_previous: Precedente
242 label_used_by: Utilizado por
242 label_used_by: Utilizado por
243 #label_details: Details...
243 #label_details: Details...
244 #label_add_note: Add a note
244
245
245 button_login: Conexión
246 button_login: Conexión
246 button_submit: Someter
247 button_submit: Someter
@@ -241,6 +241,7 label_next: Suivant
241 label_previous: Précédent
241 label_previous: Précédent
242 label_used_by: Utilisé par
242 label_used_by: Utilisé par
243 label_details: Détails...
243 label_details: Détails...
244 label_add_note: Ajouter une note
244
245
245 button_login: Connexion
246 button_login: Connexion
246 button_submit: Soumettre
247 button_submit: Soumettre
General Comments 0
You need to be logged in to leave comments. Login now