Skip to content

Commit

Permalink
Set the PERCENT-COMPLETE attribute if necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Mar 1, 2015
1 parent 1387b57 commit e8bab80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nag/lib/Task.php
Expand Up @@ -1270,7 +1270,11 @@ public function toiCalendar(Horde_Icalendar $calendar)
if ($this->completed) {
$vTodo->setAttribute('STATUS', 'COMPLETED');
$vTodo->setAttribute('COMPLETED', $this->completed_date ? $this->completed_date : $_SERVER['REQUEST_TIME']);
$vTodo->setAttribute('PERCENT-COMPLETE', '100');
} else {
if (!empty($this->estimate)) {
$vTodo->setAttribute('PERCENT-COMPLETE', ($this->actual / $this->estimate) * 100);
}
if ($v1) {
$vTodo->setAttribute('STATUS', 'NEEDS ACTION');
} else {
Expand Down

0 comments on commit e8bab80

Please sign in to comment.