diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-06 10:28:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-06 10:28:20 +0000 |
commit | 5f8e9d71182040473d4072241ce81fcadada497f (patch) | |
tree | 7701b9fed7aed50afd4dbf7fd34ec5ef08d40e5f /app/controllers/versions_controller.rb | |
parent | e1781235696fe23851154ebbdc913e970d3c0f3a (diff) | |
download | redmine-5f8e9d71182040473d4072241ce81fcadada497f.tar.gz redmine-5f8e9d71182040473d4072241ce81fcadada497f.zip |
Version sharing (#465) + optional inclusion of subprojects in the roadmap view (#2666).
Each version of a project can be shared with:
* subprojects
* projects in the project hierarchy: ancestors + descendants (needs versions management permission on the root project)
* projects in the project tree: root project + all its descendants (same as above)
* all projects (can be set by admin users only)
Notes:
* when sharing a version of a private project with others projects, its name will be visible within the other projects
* a project with versions used by non descendant projects can not be archived
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3123 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/versions_controller.rb')
-rw-r--r-- | app/controllers/versions_controller.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 7be042d9f..69b253c68 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -22,14 +22,19 @@ class VersionsController < ApplicationController before_filter :authorize helper :custom_fields + helper :projects def show end def edit - if request.post? and @version.update_attributes(params[:version]) - flash[:notice] = l(:notice_successful_update) - redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project + if request.post? && params[:version] + attributes = params[:version].dup + attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing']) + if @version.update_attributes(attributes) + flash[:notice] = l(:notice_successful_update) + redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project + end end end |