Add in the beginings of overdue issue display

This commit is contained in:
Simon Holywell
2012-03-23 00:29:15 +00:00
parent 1b363e4b6d
commit 1d15d53eaa
3 changed files with 111 additions and 0 deletions

View File

@@ -201,6 +201,28 @@ GROUP BY uid";
return $ownerStatistics;
}
/**
* Returns the number of overdue/in date issues.
*
* @param string Status ('open'), 'closed'
* @return int Count
*/
public function getIssueCountByOverdue()
{
$tags = implode(',', $this->getTagIdsByStatus('open'));
$sqlIssueTable = Pluf::factory('IDF_Issue')->getSqlTable();
$query = "SELECT (
SELECT COUNT(*) FROM $sqlIssueTable
WHERE due_dtime < NOW() AND status IN ($tags)
) AS overdue,
( SELECT COUNT(*) FROM $sqlIssueTable
WHERE due_dtime >= NOW() AND status IN ($tags)
) AS in_date";
$db = Pluf::db();
$dbData = $db->select($query);
return current($dbData);
}
/**
* Returns the number of open/closed issues.