summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-07 12:34:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-07 12:34:52 +0000
commit81cf6b23439705231e1b3655709b3d3cae43a9cd (patch)
treea5df6e34e896adba499bd536c2d3fa3e1973d752 /app/controllers/issues_controller.rb
parent3dd97a87c6707eb53410814a9594b6eebbc130ec (diff)
downloadredmine-81cf6b23439705231e1b3655709b3d3cae43a9cd.tar.gz
redmine-81cf6b23439705231e1b3655709b3d3cae43a9cd.zip
Allows project to be changed from the regular issue update action (#4769, #9803).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8531 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 6433acc5f..076a3a663 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -135,7 +135,17 @@ class IssuesController < ApplicationController
def new
respond_to do |format|
format.html { render :action => 'new', :layout => !request.xhr? }
- format.js { render :partial => 'attributes' }
+ format.js {
+ render(:update) { |page|
+ if params[:project_change]
+ page.replace_html 'all_attributes', :partial => 'form'
+ else
+ page.replace_html 'attributes', :partial => 'attributes'
+ end
+ m = User.current.allowed_to?(:log_time, @issue.project) ? 'show' : 'hide'
+ page << "if ($('log_time')) {Element.#{m}('log_time');}"
+ }
+ }
end
end
@@ -274,7 +284,7 @@ private
end
def find_project
- project_id = (params[:issue] && params[:issue][:project_id]) || params[:project_id]
+ project_id = params[:project_id] || (params[:issue] && params[:issue][:project_id])
@project = Project.find(project_id)
rescue ActiveRecord::RecordNotFound
render_404