* Export the selected items from post variable instead of from cookie.
This commit is contained in:
@@ -4222,7 +4222,7 @@ class execution extends control
|
||||
|
||||
if($this->post->exportType == 'selected')
|
||||
{
|
||||
$checkedItem = $this->cookie->checkedItem;
|
||||
$checkedItem = $this->post->checkedItem;
|
||||
if(strpos(",$checkedItem,", ",{$execution->id},") === false) unset($executionStats[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1552,7 +1552,7 @@ class product extends control
|
||||
|
||||
if($this->post->exportType == 'selected')
|
||||
{
|
||||
$checkedItem = $this->cookie->checkedItem;
|
||||
$checkedItem = $this->post->checkedItem;
|
||||
if(strpos(",$checkedItem,", ",{$product->id},") === false) unset($productStats[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -656,7 +656,7 @@ class program extends control
|
||||
|
||||
if($this->post->exportType == 'selected')
|
||||
{
|
||||
$checkedItem = $this->cookie->checkedItem;
|
||||
$checkedItem = $this->post->checkedItem;
|
||||
if(strpos(",$checkedItem,", ",{$program->id},") === false) unset($programs[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class project extends control
|
||||
if(!$hasProduct) $project->linkedProducts = '';
|
||||
if($this->post->exportType == 'selected')
|
||||
{
|
||||
$checkedItem = $this->cookie->checkedItem;
|
||||
$checkedItem = $this->post->checkedItem;
|
||||
if(strpos(",$checkedItem,", ",{$project->id},") === false) unset($projects[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6321,7 +6321,7 @@ class storyModel extends model
|
||||
|
||||
/* Get stories. */
|
||||
$stories = array();
|
||||
$selectedIDList = $this->cookie->checkedItem ? $this->cookie->checkedItem : '0';
|
||||
$selectedIDList = $this->post->checkedItem ? $this->post->checkedItem : '0';
|
||||
if($this->session->storyOnlyCondition)
|
||||
{
|
||||
if($this->post->exportType == 'selected')
|
||||
|
||||
@@ -2126,7 +2126,7 @@ class task extends control
|
||||
if($this->session->taskOnlyCondition)
|
||||
{
|
||||
$tasks = $this->dao->select('*')->from(TABLE_TASK)->alias('t1')->where($this->session->taskQueryCondition)
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi()
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->post->checkedItem)->fi()
|
||||
->orderBy($sort)->fetchAll('id');
|
||||
|
||||
foreach($tasks as $key => $task)
|
||||
@@ -2149,7 +2149,7 @@ class task extends control
|
||||
}
|
||||
elseif($this->session->taskQueryCondition)
|
||||
{
|
||||
$stmt = $this->dbh->query($this->session->taskQueryCondition . ($this->post->exportType == 'selected' ? " AND t1.id IN({$this->cookie->checkedItem})" : '') . " ORDER BY " . strtr($orderBy, '_', ' '));
|
||||
$stmt = $this->dbh->query($this->session->taskQueryCondition . ($this->post->exportType == 'selected' ? " AND t1.id IN({$this->post->checkedItem})" : '') . " ORDER BY " . strtr($orderBy, '_', ' '));
|
||||
while($row = $stmt->fetch()) $tasks[$row->id] = $row;
|
||||
}
|
||||
|
||||
|
||||
@@ -1754,7 +1754,7 @@ class testcase extends control
|
||||
|
||||
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($this->session->testcaseQueryCondition)
|
||||
->beginIF($taskID)->andWhere('id')->in($caseIDList)->fi()
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi()
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->post->checkedItem)->fi()
|
||||
->orderBy($orderBy)
|
||||
->beginIF($this->post->limit)->limit($this->post->limit)->fi()
|
||||
->fetchAll('id');
|
||||
@@ -1767,7 +1767,7 @@ class testcase extends control
|
||||
while($row = $stmt->fetch())
|
||||
{
|
||||
$caseID = isset($row->case) ? $row->case : $row->id;
|
||||
if($this->post->exportType == 'selected' and strpos(",{$this->cookie->checkedItem},", ",$caseID,") === false) continue;
|
||||
if($this->post->exportType == 'selected' and strpos(",{$this->post->checkedItem},", ",$caseID,") === false) continue;
|
||||
$cases[$caseID] = $row;
|
||||
$row->id = $caseID;
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ class todo extends control
|
||||
|
||||
/* Get bugs. */
|
||||
$todos = $this->dao->select('*')->from(TABLE_TODO)->where($this->session->todoReportCondition)
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi()
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->post->checkedItem)->fi()
|
||||
->orderBy($orderBy)->fetchAll('id');
|
||||
|
||||
/* Get users, bugs, tasks and times. */
|
||||
|
||||
@@ -904,7 +904,7 @@ class transferModel extends model
|
||||
if(isset($this->config->$model->transfer->table)) $table = $this->config->$model->transfer->table;
|
||||
$modelDatas = $this->dao->select('*')->from($table)->alias('t1')
|
||||
->where($queryCondition)
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi()
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->post->checkedItem)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
elseif($queryCondition)
|
||||
@@ -914,7 +914,7 @@ class transferModel extends model
|
||||
preg_match_all('/[`"]' . $this->config->db->prefix . $model .'[`"] AS ([\w]+) /', $queryCondition, $matches);
|
||||
if(isset($matches[1][0])) $selectKey = "{$matches[1][0]}.id";
|
||||
|
||||
$stmt = $this->dbh->query($queryCondition . ($this->post->exportType == 'selected' ? " AND $selectKey IN(" . ($this->cookie->checkedItem ? $this->cookie->checkedItem : '0') . ")" : ''));
|
||||
$stmt = $this->dbh->query($queryCondition . ($this->post->exportType == 'selected' ? " AND $selectKey IN(" . ($this->post->checkedItem ? $this->post->checkedItem : '0') . ")" : ''));
|
||||
while($row = $stmt->fetch())
|
||||
{
|
||||
if($selectKey !== 't1.id' and isset($row->$model) and isset($row->id)) $row->id = $row->$model;
|
||||
|
||||
Reference in New Issue
Block a user