* adjust for build search sql.
This commit is contained in:
@@ -1796,15 +1796,10 @@ class bugModel extends model
|
||||
if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1');
|
||||
}
|
||||
|
||||
if(strpos($this->session->bugQuery, '`product`') === false)
|
||||
{
|
||||
$var = $this->session->bugQuery . ' AND `product` = ' . $productID;
|
||||
$this->session->set('bugQuery', "$var");
|
||||
}
|
||||
|
||||
$allProduct = "`product` = 'all'";
|
||||
$bugQuery = $this->session->bugQuery;
|
||||
if(strpos($this->session->bugQuery, $allProduct) !== false)
|
||||
if(strpos($bugQuery, '`product` =') === false) $bugQuery .= ' AND `product` = ' . $productID;
|
||||
if(strpos($bugQuery, $allProduct) !== false)
|
||||
{
|
||||
$products = array_keys($this->loadModel('product')->getPrivProducts());
|
||||
$bugQuery = str_replace($allProduct, '1', $this->session->bugQuery);
|
||||
|
||||
@@ -787,12 +787,12 @@ class projectModel extends model
|
||||
if($this->session->taskQuery == false) $this->session->set('taskQuery', ' 1 = 1');
|
||||
}
|
||||
|
||||
/* Limit current project when no project. */
|
||||
if(strpos($this->session->taskQuery, "`project` =") === false) $this->session->set('taskQuery', $this->session->taskQuery . " AND `project` = $projectID");
|
||||
if(strpos($this->session->taskQuery, "deleted =") === false) $this->session->set('taskQuery', $this->session->taskQuery . " AND deleted = '0'");
|
||||
|
||||
$projectQuery = "`project`" . helper::dbIN(array_keys($projects));
|
||||
$taskQuery = str_replace("`project` = 'all'", $projectQuery, $this->session->taskQuery); // Search all project.
|
||||
/* Limit current project when no project. */
|
||||
if(strpos($taskQuery, "`project` =") === false) $taskQuery = $taskQuery . " AND `project` = $projectID";
|
||||
$this->session->set('taskQueryCondition', $taskQuery);
|
||||
$this->session->set('taskOnlyCondition', true);
|
||||
$this->session->set('taskOrderBy', $sort);
|
||||
|
||||
@@ -1383,8 +1383,9 @@ class storyModel extends model
|
||||
|
||||
/* Get plans. */
|
||||
$plans = $this->dao->select('id,title')->from(TABLE_PRODUCTPLAN)
|
||||
->beginIF($productID != 'all' and $productID != '')->where('product')->eq((int)$productID)->fi()
|
||||
->beginIF($productID == 'all')->where('product')->in($productIDs)->fi()
|
||||
->where('deleted')->eq('0')
|
||||
->beginIF($productID != 'all' and $productID != '')->andWhere('product')->eq((int)$productID)->fi()
|
||||
->beginIF($productID == 'all')->andWhere('product')->in($productIDs)->fi()
|
||||
->fetchPairs();
|
||||
|
||||
$tmpStories = $this->dao->select('*')->from(TABLE_STORY)->where($sql)
|
||||
|
||||
Reference in New Issue
Block a user