Mercurial > hg > soundsoftware-site
comparison app/models/.svn/text-base/version.rb.svn-base @ 117:af80e5618e9b redmine-1.1
* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 12:53:21 +0000 |
parents | 40f7cfd4df19 |
children | 0c939c159af4 |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 117:af80e5618e9b |
---|---|
41 def visible?(user=User.current) | 41 def visible?(user=User.current) |
42 user.allowed_to?(:view_issues, self.project) | 42 user.allowed_to?(:view_issues, self.project) |
43 end | 43 end |
44 | 44 |
45 def start_date | 45 def start_date |
46 effective_date | 46 @start_date ||= fixed_issues.minimum('start_date') |
47 end | 47 end |
48 | 48 |
49 def due_date | 49 def due_date |
50 effective_date | 50 effective_date |
51 end | 51 end |
75 end | 75 end |
76 | 76 |
77 def behind_schedule? | 77 def behind_schedule? |
78 if completed_pourcent == 100 | 78 if completed_pourcent == 100 |
79 return false | 79 return false |
80 elsif due_date && fixed_issues.present? && fixed_issues.minimum('start_date') # TODO: should use #start_date but that method is wrong... | 80 elsif due_date && start_date |
81 start_date = fixed_issues.minimum('start_date') | |
82 done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor | 81 done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor |
83 return done_date <= Date.today | 82 return done_date <= Date.today |
84 else | 83 else |
85 false # No issues so it's not late | 84 false # No issues so it's not late |
86 end | 85 end |