summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-31 15:26:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-31 15:26:00 +0000
commit1bda8ce9405f3568298afe86612338299c88abb6 (patch)
treec2dff57fc0b3cf800c537ec2c14ff4736aef9e04
parent1b30422354939ceb7c0cccb9822a367a950afa72 (diff)
downloadredmine-1bda8ce9405f3568298afe86612338299c88abb6.tar.gz
redmine-1bda8ce9405f3568298afe86612338299c88abb6.zip
Don't show the "reassign" option when deleting issues from different projects (#24722).
git-svn-id: http://svn.redmine.org/redmine/trunk@16121 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/issues_controller.rb2
-rw-r--r--app/views/issues/destroy.html.erb2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 2a69d57ff..0b99eb526 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -356,7 +356,7 @@ class IssuesController < ApplicationController
when 'nullify'
time_entries.update_all(:issue_id => nil)
when 'reassign'
- reassign_to = @project.issues.find_by_id(params[:reassign_to_id])
+ reassign_to = @project && @project.issues.find_by_id(params[:reassign_to_id])
if reassign_to.nil?
flash.now[:error] = l(:error_issue_not_found_in_project)
return
diff --git a/app/views/issues/destroy.html.erb b/app/views/issues/destroy.html.erb
index 4a0631e68..83da014cd 100644
--- a/app/views/issues/destroy.html.erb
+++ b/app/views/issues/destroy.html.erb
@@ -7,8 +7,10 @@
<p>
<label><%= radio_button_tag 'todo', 'destroy', true %> <%= l(:text_destroy_time_entries) %></label><br />
<label><%= radio_button_tag 'todo', 'nullify', false %> <%= l(:text_assign_time_entries_to_project) %></label><br />
+<% if @project %>
<label><%= radio_button_tag 'todo', 'reassign', false, :onchange => 'if (this.checked) { $("#reassign_to_id").focus(); }' %> <%= l(:text_reassign_time_entries) %></label>
<%= text_field_tag 'reassign_to_id', params[:reassign_to_id], :size => 6, :onfocus => '$("#todo_reassign").attr("checked", true);' %>
+<% end %>
</p>
</div>
<%= submit_tag l(:button_apply) %>