diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-12 15:55:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-12 15:55:06 +0000 |
commit | 65e05d822acd6d9cd4cd77ac83e885cba2e52a3c (patch) | |
tree | ef3c2aaf1662e08ea1a906b7d7bc26c49da54855 /app/models/issue_status.rb | |
parent | bce286f45867050a835b93becae134167cf734d3 (diff) | |
download | redmine-65e05d822acd6d9cd4cd77ac83e885cba2e52a3c.tar.gz redmine-65e05d822acd6d9cd4cd77ac83e885cba2e52a3c.zip |
Status can now be updated when bulk editing issues.
Workflow permissions are applied as when changing the status of a single issue. The issue is not saved (and an error is displayed) if the status transition is not allowed for the user.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@831 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_status.rb')
-rw-r--r-- | app/models/issue_status.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb index 3929c6774..62b2cb762 100644 --- a/app/models/issue_status.rb +++ b/app/models/issue_status.rb @@ -51,6 +51,12 @@ class IssueStatus < ActiveRecord::Base :conditions => ["role_id=? and tracker_id=?", role.id, tracker.id]).collect{ |w| w.new_status }.compact if role && tracker new_statuses ? new_statuses.sort{|x, y| x.position <=> y.position } : [] end + + def new_status_allowed_to?(status, role, tracker) + status && role && tracker ? + !workflows.find(:first, :conditions => {:new_status_id => status.id, :role_id => role.id, :tracker_id => tracker.id}).nil? : + false + end def to_s; name end |