* add empty mode for getPairs method of project model.

This commit is contained in:
chenfeiCF
2016-03-13 10:56:16 +08:00
parent 6b055c87fe
commit 0190934f07
2 changed files with 2 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ class bug extends control
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Get projects. */
$projects = $this->loadModel('project')->getPairs() + array('0' => '');
$projects = $this->loadModel('project')->getPairs('empty');
/* Get bugs. */
$bugs = $this->bug->getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager);

View File

@@ -522,6 +522,7 @@ class projectModel extends model
if(strpos($mode, 'noclosed') !== false and $project->status == 'done') continue;
if($this->checkPriv($project)) $pairs[$project->id] = $project->name;
}
if(strpos($mode, 'empty') !== false) $pairs[0] = '';
/* If the pairs is empty, to make sure there's an project in the pairs. */
if(empty($pairs) and isset($projects[0]) and $this->checkPriv($projects[0]))