Merged r9350 and r9351 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9352 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -37,7 +37,6 @@ class Message < ActiveRecord::Base
|
||||
:author_key => :author_id
|
||||
acts_as_watchable
|
||||
|
||||
attr_protected :locked, :sticky
|
||||
validates_presence_of :board, :subject, :content
|
||||
validates_length_of :subject, :maximum => 255
|
||||
validate :cannot_reply_to_locked_topic, :on => :create
|
||||
@@ -50,7 +49,7 @@ class Message < ActiveRecord::Base
|
||||
:conditions => Project.allowed_to_condition(args.shift || User.current, :view_messages, *args) } }
|
||||
|
||||
safe_attributes 'subject', 'content'
|
||||
safe_attributes 'locked', 'sticky',
|
||||
safe_attributes 'locked', 'sticky', 'board_id',
|
||||
:if => lambda {|message, user|
|
||||
user.allowed_to?(:edit_messages, message.project)
|
||||
}
|
||||
|
||||
@@ -6,13 +6,17 @@
|
||||
<p><label for="message_subject"><%= l(:field_subject) %></label><br />
|
||||
<%= f.text_field :subject, :size => 120, :id => "message_subject" %>
|
||||
|
||||
<% if !replying && User.current.allowed_to?(:edit_messages, @project) %>
|
||||
<% unless replying %>
|
||||
<% if @message.safe_attribute? 'sticky' %>
|
||||
<label><%= f.check_box :sticky %><%= l(:label_board_sticky) %></label>
|
||||
<% end %>
|
||||
<% if @message.safe_attribute? 'locked' %>
|
||||
<label><%= f.check_box :locked %><%= l(:label_board_locked) %></label>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if !replying && !@message.new_record? && User.current.allowed_to?(:edit_messages, @project) %>
|
||||
<% if !replying && !@message.new_record? && @message.safe_attribute?('board_id') %>
|
||||
<p><label><%= l(:label_board) %></label><br />
|
||||
<%= f.select :board_id, @project.boards.collect {|b| [b.name, b.id]} %></p>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user