* Merge 18.x
This commit is contained in:
+12
-11
@@ -561,7 +561,7 @@ class bugModel extends model
|
||||
|
||||
$bug = $this->loadModel('file')->replaceImgURL($bug, 'steps');
|
||||
if($setImgSize) $bug->steps = $this->file->setImgSize($bug->steps);
|
||||
foreach($bug as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr(is_null($value) ? '' : $value, 0, 4)) $bug->$key = '';
|
||||
foreach($bug as $key => $value) if(strpos($key, 'Date') !== false && $value && !(int)substr(is_null($value) ? '' : $value, 0, 4)) $bug->$key = '';
|
||||
|
||||
if($bug->duplicateBug) $bug->duplicateBugTitle = $this->dao->findById($bug->duplicateBug)->from(TABLE_BUG)->fields('title')->fetch('title');
|
||||
if($bug->case) $bug->caseTitle = $this->dao->findById($bug->case)->from(TABLE_CASE)->fields('title')->fetch('title');
|
||||
@@ -2052,21 +2052,21 @@ class bugModel extends model
|
||||
*/
|
||||
public function getProductBugPairs($productID, $branch = '', $search = '', $limit = 0)
|
||||
{
|
||||
$bugs = array('' => '');
|
||||
$data = $this->dao->select('id, title')->from(TABLE_BUG)
|
||||
$bugs = $this->dao->select("id, CONCAT(id, ':', title) AS title")->from(TABLE_BUG)
|
||||
->where('product')->eq((int)$productID)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('execution')->in('0,' . $this->app->user->view->sprints)->fi()
|
||||
->beginIF($branch !== '')->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF(strlen(trim($search)))->andWhere('title')->like('%' . $search . '%')->fi()
|
||||
->beginIF(strlen(trim($search)))
|
||||
->andWhere('id', true)->like('%' . $search . '%')
|
||||
->orWhere('title')->like('%' . $search . '%')
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy('id desc')
|
||||
->beginIF($limit)->limit($limit)->fi()
|
||||
->fetchAll();
|
||||
foreach($data as $bug)
|
||||
{
|
||||
$bugs[$bug->id] = $bug->id . ':' . $bug->title;
|
||||
}
|
||||
return $bugs;
|
||||
->fetchPairs();
|
||||
|
||||
return array('' => '') + $bugs;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2861,7 +2861,8 @@ class bugModel extends model
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('project')->in('0,' . $this->app->user->view->projects)->fi()
|
||||
->orderBy($orderBy)->page($pager)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user