* fix the bug#177.

This commit is contained in:
wangchunsheng
2011-03-09 08:50:39 +00:00
parent d96beb2e32
commit 84f4084c60

View File

@@ -190,13 +190,20 @@ class projectModel extends model
$projects = $this->dao->select('*')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
->andWhere('deleted')->eq(0)
->beginIF($mode == 'noclosed')->andWhere('status')->ne('done')->fi()
->orderBy('status, end desc')->fetchAll();
->orderBy('status, end desc')
->fetchAll();
$pairs = array();
foreach($projects as $project)
{
if($mode == 'noclosed' and $project->status == 'done') continue;
if($this->checkPriv($project)) $pairs[$project->id] = $project->name;
}
/* If the pairs is empty, to make sure there's an project in the pairs. */
if(empty($pairs) and isset($projects[0]))
{
$firstProject = $projects[0];
$pairs[$firstProject->id] = $firstProject->name;
}
return $pairs;
}