Created
March 3, 2010 23:35
-
-
Save edavis10/321193 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RedmineRestricutedStatus | |
module Patches | |
module IssuePatch | |
def self.included(base) # :nodoc: | |
base.extend(ClassMethods) | |
base.send(:include, InstanceMethods) | |
base.class_eval do | |
unloadable # Send unloadable so it will not be unloaded in development | |
def new_statuses_allowed_to(user) | |
statuses = super(user) | |
if Setting.plugin_redmine_restricted_status && | |
Setting.plugin_redmine_restricted_status['restricted_project'].include?(self.project_id.to_s) | |
return statuses.reject {|s| | |
Setting.plugin_redmine_restricted_status['allowed_statuses'] && | |
Setting.plugin_redmine_restricted_status['allowed_statuses'].include?(s.id.to_s) | |
} | |
else | |
return statuses | |
end | |
end | |
end | |
end | |
module ClassMethods | |
end | |
module InstanceMethods | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment