mirror of
https://github.com/redmine/redmine.git
synced 2026-03-21 20:02:08 +01:00
Ability to add a new version from the issue form (#4315).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3126 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -234,9 +234,28 @@ class ProjectsController < ApplicationController
|
||||
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
||||
@version.attributes = attributes
|
||||
end
|
||||
if request.post? and @version.save
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
redirect_to :action => 'settings', :tab => 'versions', :id => @project
|
||||
if request.post?
|
||||
if @version.save
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
redirect_to :action => 'settings', :tab => 'versions', :id => @project
|
||||
end
|
||||
format.js do
|
||||
# IE doesn't support the replace_html rjs method for select box options
|
||||
render(:update) {|page| page.replace "issue_fixed_version_id",
|
||||
content_tag('select', '<option></option>' + version_options_for_select(@project.shared_versions.open, @version), :id => 'issue_fixed_version_id', :name => 'issue[fixed_version_id]')
|
||||
}
|
||||
end
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js do
|
||||
render(:update) {|page| page.alert(@version.errors.full_messages.join('\n')) }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user