diff options
60 files changed, 3 insertions, 200 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)" %> diff --git a/config/locales/ar.yml b/config/locales/ar.yml index c1ae8f28e..f066d1e05 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1478,4 +1478,3 @@ ar: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/az.yml b/config/locales/az.yml index 7ae1df05f..d86d14199 100644 --- a/config/locales/az.yml +++ b/config/locales/az.yml @@ -1570,4 +1570,3 @@ az: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 2b74c94e8..5f8b999c1 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1426,4 +1426,3 @@ bg: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/bs.yml b/config/locales/bs.yml index edae08e33..21e352da8 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -1491,4 +1491,3 @@ bs: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/ca.yml b/config/locales/ca.yml index ccaa90d2d..f4d8cd400 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1468,4 +1468,3 @@ ca: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/cs.yml b/config/locales/cs.yml index ce8331736..28d458b95 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1461,4 +1461,3 @@ cs: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/da.yml b/config/locales/da.yml index fc82501b4..595d5d1a1 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1495,4 +1495,3 @@ da: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/de.yml b/config/locales/de.yml index 207ebcf82..bcfbe9b7d 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1442,4 +1442,3 @@ de: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/el.yml b/config/locales/el.yml index e2190af18..b7a4ac832 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1478,4 +1478,3 @@ el: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index ec0c2b1f9..5d6f8df83 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1479,4 +1479,3 @@ en-GB: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/en.yml b/config/locales/en.yml index f1e2b3fd0..335614dfb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -541,7 +541,6 @@ en: permission_view_private_notes: View private notes permission_set_notes_private: Set notes as private permission_delete_issues: Delete issues - permission_change_issue_author: Change issue author permission_manage_public_queries: Manage public queries permission_save_queries: Save queries permission_view_gantt: View gantt chart diff --git a/config/locales/es-PA.yml b/config/locales/es-PA.yml index 10e37ebfb..7c6dfc9f9 100644 --- a/config/locales/es-PA.yml +++ b/config/locales/es-PA.yml @@ -1508,4 +1508,3 @@ es-PA: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/es.yml b/config/locales/es.yml index 20b6ea582..500a50747 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1545,4 +1545,3 @@ es: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/et.yml b/config/locales/et.yml index 01f741aa7..aeebf49d5 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -1483,4 +1483,3 @@ et: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 7d46b3b44..f6704e03d 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1479,4 +1479,3 @@ eu: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 057341342..65ab2d3d3 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -1424,4 +1424,3 @@ fa: is disabled. text_user_destroy_confirmation: مطمئنید که می خواهید این کاربر و همه ارجاعهای مربوط به او را حذف کنید؟ این کار قابل بازگشت نیست. غالبا، قفل کردن کاربر به جای حذف، راه حل بهتری است. برای تأیید، لطفاً شناسه ورود کاربر (%{login}) را در زیر وارد کنید. text_project_destroy_enter_identifier: برای تایید، لطفا شناسه پروژه (%{identifier}) را وارد کنید. - permission_change_issue_author: Change issue author diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 6badc1216..0e52ad456 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1499,4 +1499,3 @@ fi: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 46c3aef0a..5b3ccfb92 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1459,4 +1459,3 @@ fr: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 59f4ff7fa..6febf28de 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1484,4 +1484,3 @@ gl: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/he.yml b/config/locales/he.yml index aa0a1c97f..442121b15 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1483,4 +1483,3 @@ he: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 010ea969e..1d161b826 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -1475,4 +1475,3 @@ hr: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/hu.yml b/config/locales/hu.yml index ad63b3bc4..03fe80f64 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1497,4 +1497,3 @@ all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/id.yml b/config/locales/id.yml index f16b12024..3af8a7e86 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -1480,4 +1480,3 @@ id: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/it.yml b/config/locales/it.yml index 15103879b..f2201baef 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1471,4 +1471,3 @@ it: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 98e8bd9a2..e22651e41 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1431,4 +1431,3 @@ ja: field_is_member_of_group: グループ text_users_bulk_destroy_head: 以下のユーザーとこれらのユーザーへのすべての参照を削除しようとしています。削除後は元に戻せません。通常は削除よりロックのほうが適切です。 text_users_bulk_destroy_confirm: 削除する場合は確認のため "%{yes}" と入力してください。 - permission_change_issue_author: Change issue author diff --git a/config/locales/ko.yml b/config/locales/ko.yml index a52b5a426..090c055aa 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1516,4 +1516,3 @@ ko: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 3baddd78b..7d3a63b4c 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -1439,4 +1439,3 @@ lt: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 2f584a1ca..51f004e80 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1472,4 +1472,3 @@ lv: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/mk.yml b/config/locales/mk.yml index f017a7f23..b19fcb06e 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -1478,4 +1478,3 @@ mk: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/mn.yml b/config/locales/mn.yml index abab6baca..f2b360a9f 100644 --- a/config/locales/mn.yml +++ b/config/locales/mn.yml @@ -1478,4 +1478,3 @@ mn: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 2e15afa4f..e36a7ffca 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1453,4 +1453,3 @@ nl: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/no.yml b/config/locales/no.yml index 76b356632..687d3872d 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1468,4 +1468,3 @@ all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 08f9d17cf..15afd8e59 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1425,4 +1425,3 @@ pl: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 0ca639ee8..4be4522fe 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1483,4 +1483,3 @@ pt-BR: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/pt.yml b/config/locales/pt.yml index f35936f98..0bbbe768a 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1471,4 +1471,3 @@ pt: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/ro.yml b/config/locales/ro.yml index e1132cfc4..3008aa3bd 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -1473,4 +1473,3 @@ ro: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 01ce5d6f2..0a74859cf 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1552,4 +1552,3 @@ ru: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/sk.yml b/config/locales/sk.yml index cd1be6421..59ab2199a 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1467,4 +1467,3 @@ sk: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 37bd14824..cf0c6f582 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1478,4 +1478,3 @@ sl: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 343120ec0..5cabf07ed 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1440,4 +1440,3 @@ sq: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml index ffe42ee26..a6e091a6c 100644 --- a/config/locales/sr-YU.yml +++ b/config/locales/sr-YU.yml @@ -1480,4 +1480,3 @@ sr-YU: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 009cc7ae1..225333165 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1479,4 +1479,3 @@ sr: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/sv.yml b/config/locales/sv.yml index f1f1dc298..e4b576a13 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1511,4 +1511,3 @@ sv: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/th.yml b/config/locales/th.yml index aabdc58cb..a17c3c2f5 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1474,4 +1474,3 @@ th: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/tr.yml b/config/locales/tr.yml index b787eef9e..d6c40403c 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1485,4 +1485,3 @@ tr: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/uk.yml b/config/locales/uk.yml index f873fcc00..5a8c4a46e 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1466,4 +1466,3 @@ uk: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 664292467..fefd00ec7 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1530,4 +1530,3 @@ vi: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 615baa63f..7003582f5 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1496,4 +1496,3 @@ text_users_bulk_destroy_head: 您即將刪除下列用戶,並移除與這些用戶相關聯的資料。 此動作無法復原。鎖定用戶經常是一個比刪除用戶還要來得更好的解決方案。 text_users_bulk_destroy_confirm: 請於下方輸入 "%{yes}" 以便確認。 - permission_change_issue_author: Change issue author diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7d41be241..aed6a7b34 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1433,4 +1433,3 @@ zh: all references to them. This cannot be undone. Often, locking users instead of deleting them is the better solution. text_users_bulk_destroy_confirm: To confirm, please enter "%{yes}" below. - permission_change_issue_author: Change issue author diff --git a/lib/redmine/preparation.rb b/lib/redmine/preparation.rb index b4e37fd50..c435a9cf6 100644 --- a/lib/redmine/preparation.rb +++ b/lib/redmine/preparation.rb @@ -72,7 +72,6 @@ module Redmine map.permission :view_private_notes, {}, :read => true, :require => :member map.permission :set_notes_private, {}, :require => :member map.permission :delete_issues, {:issues => :destroy}, :require => :member - map.permission :change_issue_author, {:issues => [:edit, :update]} map.permission :mention_users, {} # Watchers map.permission :view_issue_watchers, {}, :read => true diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 4d8c00861..a10abbd12 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -8306,7 +8306,6 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_destroy_child_issue - User.current = User.find(1) parent = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Parent Issue') child = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Child Issue', :parent_issue_id => parent.id) assert child.is_descendant_of?(parent.reload) diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index 4e3d07d95..fdd767560 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -103,7 +103,6 @@ class VersionsControllerTest < Redmine::ControllerTest end def test_index_should_show_issue_assignee - User.current = User.find_by_login('jsmith') with_settings :gravatar_enabled => '1' do Issue.generate!(:project_id => 3, :fixed_version_id => 4, :assigned_to => User.find_by_login('jsmith')) Issue.generate!(:project_id => 3, :fixed_version_id => 4) diff --git a/test/helpers/issues_helper_test.rb b/test/helpers/issues_helper_test.rb index 91cdc7990..6992001ac 100644 --- a/test/helpers/issues_helper_test.rb +++ b/test/helpers/issues_helper_test.rb @@ -465,62 +465,4 @@ class IssuesHelperTest < Redmine::HelperTest assert_include "<a href=\"/issues?issue_id=#{open_issue.id}%2C#{closed_issue.id}&set_filter=true&status_id=o\">1 open</a>", html assert_include "<a href=\"/issues?issue_id=#{open_issue.id}%2C#{closed_issue.id}&set_filter=true&status_id=c\">1 closed</a>", html end - - def test_author_options_for_select_if_new_record_and_users_includes_current_user - User.current = User.find(2) - issue = Issue.new(project_id: 1) - assignable_users = [User.find(3), User.find(2)] - - assert_includes assignable_users, User.current - assert_equal( - principals_options_for_select(assignable_users, nil), - author_options_for_select(issue, issue.project)) - end - - def test_author_options_for_select_if_new_record_and_users_not_includes_current_user - User.current = User.find(1) - issue = Issue.new(project_id: 1) - assignable_users = [User.find(3), User.find(2)] - assert_not_includes assignable_users, User.current - - assert_equal( - principals_options_for_select([User.current] + assignable_users, nil), - author_options_for_select(issue, issue.project)) - end - - def test_author_options_for_select_if_persisted_record_and_users_includes_author - User.current = User.find(2) - issue = Issue.find(1) - issue.update(author_id: 2) - assignable_users = [User.find(3), User.find(2)] - - assert_includes assignable_users, issue.author - assert_equal( - principals_options_for_select(assignable_users, issue.author), - author_options_for_select(issue, issue.project)) - end - - def test_author_options_for_select_if_persisted_record_and_users_not_includes_author - User.current = User.find(2) - issue = Issue.find(1) - issue.update(author_id: 1) - assignable_users = [User.find(3), User.find(2)] - - assert_not_includes assignable_users, issue.author - assert_equal( - principals_options_for_select([User.find(1)] + assignable_users, issue.author), - author_options_for_select(issue, issue.project)) - end - - def test_author_options_for_select_if_persisted_record_and_author_is_anonymous - User.current = User.find(2) - issue = Issue.find(1) - issue.update(author_id: User.anonymous.id) - assignable_users = [User.find(3), User.find(2)] - - assert_not_includes assignable_users, issue.author - assert_equal( - principals_options_for_select([User.anonymous] + assignable_users, issue.author), - author_options_for_select(issue, issue.project)) - end end diff --git a/test/helpers/journals_helper_test.rb b/test/helpers/journals_helper_test.rb index 100121bdf..23f3bc791 100644 --- a/test/helpers/journals_helper_test.rb +++ b/test/helpers/journals_helper_test.rb @@ -22,7 +22,7 @@ require File.expand_path('../../test_helper', __FILE__) class JournalsHelperTest < Redmine::HelperTest include JournalsHelper - fixtures :projects, :trackers, :issue_statuses, :issues, :journals, :journal_details, + fixtures :projects, :trackers, :issue_statuses, :issues, :journals, :enumerations, :issue_categories, :projects_trackers, :users, :roles, :member_roles, :members, diff --git a/test/object_helpers.rb b/test/object_helpers.rb index a20afdc70..3900bc45d 100644 --- a/test/object_helpers.rb +++ b/test/object_helpers.rb @@ -95,7 +95,7 @@ module ObjectHelpers issue.project ||= Project.find(1) issue.tracker ||= issue.project.trackers.first issue.subject = 'Generated' if issue.subject.blank? - issue.author ||= (User.current || User.find(2)) + issue.author ||= User.find(2) yield issue if block_given? issue end diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb index 37bf1615d..ea877c948 100644 --- a/test/unit/issue_nested_set_test.rb +++ b/test/unit/issue_nested_set_test.rb @@ -60,7 +60,6 @@ class IssueNestedSetTest < ActiveSupport::TestCase end def test_creating_a_child_in_a_subproject_should_validate - User.current = User.find(1) issue = Issue.generate! child = nil assert_difference 'Journal.count', 1 do diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 6c359618c..b056ffb18 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -2789,7 +2789,6 @@ class IssueTest < ActiveSupport::TestCase end def test_journalized_multi_custom_field - User.current = User.find(1) field = IssueCustomField.create!(:name => 'filter', :field_format => 'list', :is_filter => true, :is_for_all => true, :tracker_ids => [1], @@ -3466,55 +3465,4 @@ class IssueTest < ActiveSupport::TestCase r = Issue.like('issue today') assert_include Issue.find(7), r end - - def test_author_should_be_changed_when_user_with_permission_change_issue_author - Role.all.each do |r| - r.add_permission! :change_issue_author - end - User.current = User.find(2) - - issue = Issue.generate!(:author => User.find(3)) - assert_equal 3, issue.author_id - - issue.safe_attributes = { 'author_id' => 4 } - assert_equal 4, issue.author_id - assert_not_equal 3, issue.author_id - end - - def test_author_should_not_be_changed_when_user_without_permission_change_issue_author - Role.all.each do |r| - r.remove_permission! :change_issue_author - end - User.current = User.find(2) - - issue = Issue.generate!(:author => User.find(3)) - assert_equal 3, issue.author_id - - issue.safe_attributes = { 'author_id' => 4 } - assert_not_equal 4, issue.author_id - assert_equal 3, issue.author_id - end - - def test_create_should_create_journal_if_user_other_than_current_user_is_set_as_the_author - User.current = User.find(1) - issue = nil - assert_difference 'Journal.count' do - issue = Issue.generate!(author: User.find(2)) - end - - first_journal_detail = issue.journals.first.details.first - assert_equal 'author_id', first_journal_detail.prop_key - assert_equal '1', first_journal_detail.old_value - assert_equal '2', first_journal_detail.value - end - - def test_create_should_create_journal_if_current_user_is_set_as_the_author - User.current = User.find(1) - issue = nil - assert_no_difference 'Journal.count' do - issue = Issue.generate!(author: User.current) - end - - assert_not issue.journals.present? - end end |