diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/issues_helper.rb | 21 | ||||
-rw-r--r-- | app/models/issue.rb | 12 | ||||
-rw-r--r-- | app/views/issues/_attributes.html.erb | 3 |
3 files changed, 1 insertions, 35 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index abefd7b28..dfe577650 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -534,7 +534,7 @@ module IssuesHelper old_value = format_date(detail.old_value.to_date) if detail.old_value when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id', - 'priority_id', 'category_id', 'fixed_version_id', 'author_id' + 'priority_id', 'category_id', 'fixed_version_id' value = find_name_by_reflection(field, detail.value) old_value = find_name_by_reflection(field, detail.old_value) @@ -778,23 +778,4 @@ module IssuesHelper projects end end - - def author_options_for_select(issue, project) - users = issue.assignable_users.select {|m| m.is_a?(User) && m.allowed_to?(:add_issues, project) } - - if issue.new_record? - if users.include?(User.current) - principals_options_for_select(users, issue.author) - else - principals_options_for_select([User.current] + users) - end - elsif issue.persisted? - if users.include?(issue.author) - principals_options_for_select(users, issue.author) - else - author_principal = Principal.find(issue.author_id) - principals_options_for_select([author_principal] + users, author_principal) - end - end - end end diff --git a/app/models/issue.rb b/app/models/issue.rb index 05be00d81..0e634bf8b 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -111,7 +111,6 @@ class Issue < ActiveRecord::Base before_validation :clear_disabled_fields before_save :close_duplicates, :update_done_ratio_from_issue_status, :force_updated_on_change, :update_closed_on - before_create :set_author_journal after_save do |issue| if !issue.saved_change_to_id? && issue.saved_change_to_project_id? issue.send :after_project_change @@ -520,9 +519,6 @@ class Issue < ActiveRecord::Base safe_attributes( 'deleted_attachment_ids', :if => lambda {|issue, user| issue.attachments_deletable?(user)}) - safe_attributes( - 'author_id', - :if => lambda {|issue, user| user.allowed_to?(:change_issue_author, issue.project)}) def safe_attribute_names(user=nil) names = super @@ -2024,14 +2020,6 @@ class Issue < ActiveRecord::Base end end - def set_author_journal - return unless new_record? - return unless self.author.present? && User.current.present? && self.author != User.current - - self.init_journal(User.current) - self.current_journal.__send__(:add_attribute_detail, 'author_id', User.current.id, self.author.id) - end - def send_notification if notify? && Setting.notified_events.include?('issue_added') Mailer.deliver_issue_add(self) diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index d5dec6ad7..b5003c436 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -3,9 +3,6 @@ <div class="splitcontent"> <div class="splitcontentleft"> <% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %> -<% if User.current.allowed_to?(:change_issue_author, @project) %> - <p><%= f.select :author_id, author_options_for_select(@issue, @project), :include_blank => false, :required => true %></p> -<% end %> <p> <%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true}, :onchange => "updateIssueFrom('#{escape_javascript(update_issue_form_path(@project, @issue))}', this)" %> |