* Fix bug#14454.
This commit is contained in:
@@ -1711,12 +1711,13 @@ class block extends control
|
||||
if(common::hasPriv('risk', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['risk'] = true;
|
||||
if(common::hasPriv('issue', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['issue'] = true;
|
||||
if(common::hasPriv('meeting', 'view') and $this->config->edition == 'max' and $this->config->vision != 'lite') $hasViewPriv['meeting'] = true;
|
||||
if($this->config->URAndSR and common::hasPriv('story', 'view') and $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
|
||||
|
||||
$params = $this->get->param;
|
||||
$params = json_decode(base64_decode($params));
|
||||
$count = array();
|
||||
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories');
|
||||
$objectCountList = array('todo' => 'todoCount', 'task' => 'taskCount', 'bug' => 'bugCount', 'story' => 'storyCount');
|
||||
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories', 'requirement' => 'requirements');
|
||||
$objectCountList = array('todo' => 'todoCount', 'task' => 'taskCount', 'bug' => 'bugCount', 'story' => 'storyCount', 'requirement' => 'requirementCount');
|
||||
if($this->config->edition == 'max')
|
||||
{
|
||||
$objectList += array('risk' => 'risks', 'issue' => 'issues');
|
||||
@@ -1728,18 +1729,19 @@ class block extends control
|
||||
{
|
||||
if(!isset($hasViewPriv[$objectType])) continue;
|
||||
|
||||
$table = $this->config->objectTables[$objectType];
|
||||
$table = $objectType == 'requirement' ? TABLE_STORY : $this->config->objectTables[$objectType];
|
||||
$orderBy = $objectType == 'todo' ? "`date` desc" : 'id_desc';
|
||||
$limitCount = isset($params->{$objectCount}) ? $params->{$objectCount} : 0;
|
||||
$objects = $this->dao->select('t1.*')->from($table)->alias('t1')
|
||||
->beginIF($objectType == 'story')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
->beginIF($objectType == 'story' or $objectType == 'requirement')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
->beginIF($objectType == 'bug')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
->beginIF($objectType == 'task')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')->fi()
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi()
|
||||
->beginIF($objectType == 'story')->andWhere('t1.type')->eq('story')->andWhere('t2.deleted')->eq('0')->fi()
|
||||
->beginIF($objectType == 'requirement')->andWhere('t1.type')->eq('requirement')->andWhere('t2.deleted')->eq('0')->fi()
|
||||
->beginIF($objectType == 'bug')->andWhere('t2.deleted')->eq('0')->fi()
|
||||
->beginIF($objectType == 'story')->andWhere('t2.deleted')->eq('0')->fi()
|
||||
->beginIF($objectType == 'story' or $objectType == 'requirement')->andWhere('t2.deleted')->eq('0')->fi()
|
||||
->beginIF($objectType == 'todo')->andWhere('t1.cycle')->eq(0)->andWhere('t1.status')->eq('wait')->andWhere('t1.vision')->eq($this->config->vision)->fi()
|
||||
->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi()
|
||||
->orderBy($orderBy)
|
||||
|
||||
Reference in New Issue
Block a user