Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
b2998c39
Commit
b2998c39
authored
Dec 10, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request
#132
from mbreit/feature/733-issue-due-today
[#733] Add Issue#due_today? and add due-today css class
parents
05092b27
ed0e92b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
issue.rb
app/models/issue.rb
+6
-0
No files found.
app/models/issue.rb
View file @
b2998c39
...
@@ -401,6 +401,11 @@ class Issue < ActiveRecord::Base
...
@@ -401,6 +401,11 @@ class Issue < ActiveRecord::Base
!
due_date
.
nil?
&&
(
due_date
<
Date
.
today
)
&&
!
status
.
is_closed?
!
due_date
.
nil?
&&
(
due_date
<
Date
.
today
)
&&
!
status
.
is_closed?
end
end
# Returns true if the issue is due today and not closed
def
due_today?
!
due_date
.
nil?
&&
(
due_date
==
Date
.
today
)
&&
!
status
.
is_closed?
end
# Is the amount of work done less than it should for the due date
# Is the amount of work done less than it should for the due date
def
behind_schedule?
def
behind_schedule?
return
false
if
start_date
.
nil?
||
due_date
.
nil?
return
false
if
start_date
.
nil?
||
due_date
.
nil?
...
@@ -556,6 +561,7 @@ class Issue < ActiveRecord::Base
...
@@ -556,6 +561,7 @@ class Issue < ActiveRecord::Base
s
=
"issue status-
#{
status
.
position
}
priority-
#{
priority
.
position
}
"
s
=
"issue status-
#{
status
.
position
}
priority-
#{
priority
.
position
}
"
s
<<
' closed'
if
closed?
s
<<
' closed'
if
closed?
s
<<
' overdue'
if
overdue?
s
<<
' overdue'
if
overdue?
s
<<
' due-today'
if
due_today?
s
<<
' child'
if
child?
s
<<
' child'
if
child?
s
<<
' parent'
unless
leaf?
s
<<
' parent'
unless
leaf?
s
<<
' created-by-me'
if
User
.
current
.
logged?
&&
author_id
==
User
.
current
.
id
s
<<
' created-by-me'
if
User
.
current
.
logged?
&&
author_id
==
User
.
current
.
id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment