summaryrefslogtreecommitdiffstats
path: root/app/models/enumeration.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-03-23 12:22:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-03-23 12:22:31 +0000
commit8d54d9700746636849bd104f4d18db479492505e (patch)
treea8d9c209a929b2c6a63dbbf2cbc7f717d264ad6f /app/models/enumeration.rb
parent7cf2d889d8866226378db250a2c7ec2fc77ef9fc (diff)
downloadredmine-8d54d9700746636849bd104f4d18db479492505e.tar.gz
redmine-8d54d9700746636849bd104f4d18db479492505e.zip
Simple time tracking functionality added. Time can be logged at issue or project level.
There's no aggregation reports for now, it's just possible to see all time entries for a project or an issue. A new "activities" enumeration is added. Permission for a role to log time must be set (new "Time tracking" section in role permissions screen). git-svn-id: http://redmine.rubyforge.org/svn/trunk@368 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/enumeration.rb')
-rw-r--r--app/models/enumeration.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index 251f00fbe..de8526067 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -24,7 +24,8 @@ class Enumeration < ActiveRecord::Base
OPTIONS = {
"IPRI" => :enumeration_issue_priorities,
- "DCAT" => :enumeration_doc_categories
+ "DCAT" => :enumeration_doc_categories,
+ "ACTI" => :enumeration_activities
}.freeze
def self.get_values(option)
@@ -42,6 +43,8 @@ private
raise "Can't delete enumeration" if Issue.find(:first, :conditions => ["priority_id=?", self.id])
when "DCAT"
raise "Can't delete enumeration" if Document.find(:first, :conditions => ["category_id=?", self.id])
+ when "ACTI"
+ raise "Can't delete enumeration" if TimeEntry.find(:first, :conditions => ["activity_id=?", self.id])
end
end
end