Refactor getIssueCountByDueDate slightly

This commit is contained in:
Simon Holywell 2012-04-26 17:01:10 +01:00
parent c3bbddb1ff
commit 53f6133899
2 changed files with 4 additions and 15 deletions

View File

@ -207,21 +207,10 @@ GROUP BY uid";
*
* @return int Count
*/
public function getIssueCountByDueDate($due='overdue', $status='open', $label=null, $ids=array())
public function getIssueCountByDueDate($due='overdue', $label=null, $ids=array())
{
switch ($status) {
case 'open':
$key = 'labels_issue_open';
$default = IDF_Form_IssueTrackingConf::init_open;
break;
case 'closed':
default:
$key = 'labels_issue_closed';
$default = IDF_Form_IssueTrackingConf::init_closed;
break;
}
$tags = array();
foreach ($this->getTagsFromConfig($key, $default, 'Status') as $tag) {
foreach ($this->getTagsFromConfig('labels_issue_open', IDF_Form_IssueTrackingConf::init_open, 'Status') as $tag) {
$tags[] = (int)$tag->id;
}
if (count($tags) == 0) return array();

View File

@ -613,7 +613,7 @@ class IDF_Views_Issue
}
// get stats about the issues
$overdue = $prj->getIssueCountByDueDate('overdue', 'open', $tag, $issue_ids);
$overdue = $prj->getIssueCountByDueDate('overdue', $tag, $issue_ids);
$open = $prj->getIssueCountByStatus('open', $tag, $issue_ids);
$closed = $prj->getIssueCountByStatus('closed', $tag, $issue_ids);
@ -931,7 +931,7 @@ class IDF_Views_Issue
// Get stats about the open/closed issues having this tag.
$open = $prj->getIssueCountByStatus('open', $tag);
$closed = $prj->getIssueCountByStatus('closed', $tag);
$overdue = $prj->getIssueCountByDueDate('overdue', 'open', $tag);
$overdue = $prj->getIssueCountByDueDate('overdue', $tag);
// Paginator to paginate the issues
$pag = new Pluf_Paginator(new IDF_Issue());
$pag->model_view = 'join_tags';