* Finish task #45157.

This commit is contained in:
liumengyi
2021-11-26 08:55:04 +08:00
parent 26da1c72cb
commit fb843381ca
6 changed files with 13 additions and 21 deletions

View File

@@ -586,7 +586,7 @@ class block extends control
$this->session->set('todoList', $uri, 'my');
$this->session->set('bugList', $uri, 'qa');
$this->session->set('taskList', $uri, 'execution');
//$this->session->set('taskList', $uri, 'execution');
$this->session->set('storyList', $uri, 'product');
$this->session->set('testtaskList', $uri, 'qa');
@@ -1736,6 +1736,8 @@ class block extends control
{
$this->app->loadLang('task');
$this->app->loadLang('execution');
$objects = $this->loadModel('task')->getUserTasks($this->app->user->account, 'assignedTo', $limitCount);
}
if($objectType == 'bug') $this->app->loadLang('bug');

View File

@@ -166,7 +166,9 @@ class blockModel extends model
{
$data = array();
$data['tasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count');
$getTaskCount = "SELECT count(*) AS count FROM `zt_task` WHERE assignedTo = 'admin' AND deleted = '0'"
. " AND (project not in (select id from zt_project where deleted = '0' and status ='suspended') AND execution not in (select id from zt_project where deleted = '0' and status ='suspended'))";
$data['tasks'] = (int)$this->dao->query($getTaskCount)->fetchAll();
$data['doneTasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('status')->eq('done')->fetch('count');
$data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG)
->where('assignedTo')->eq($this->app->user->account)

View File

@@ -304,7 +304,6 @@ class my extends control
$task->parentName = $parent->name;
}
}
if($task->isSuspened) unset($tasks[$task->id]);
}
/* Get the story language configuration. */

View File

@@ -1349,6 +1349,8 @@ class task extends control
$account = $user->account;
$tasks = $this->task->getUserTaskPairs($account, $status);
//$tasks = $this->task->getUserTasks($account, 'assignedTo');
//foreach($tasks as $task) if($task->status != 'wait' and $task->status != 'doing') unset($tasks[$task->id]);
if($id) die(html::select("tasks[$id]", $tasks, '', 'class="form-control"'));
die(html::select('task', $tasks, '', 'class=form-control'));

View File

@@ -2131,6 +2131,7 @@ class taskModel extends model
->from(TABLE_TASK)->alias('t1')
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id')
->leftjoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project = t4.id')
->where('t1.deleted')->eq(0)
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi()
->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi()
@@ -2139,6 +2140,7 @@ class taskModel extends model
->orWhere('t1.finishedList')->like("%,{$account},%")
->markRight(1)
->fi()
->beginIF($this->app->rawModule == 'my' || $this->app->rawModule == 'block')->andWhere('t2.status')->ne('suspended')->andWhere('t4.status')->ne('suspended')->fi()
->beginIF($type != 'all' and $type != 'finishedBy')->andWhere("t1.`$type`")->eq($account)->fi()
->orderBy($orderBy)
->beginIF($limit > 0)->limit($limit)->fi()
@@ -2158,24 +2160,6 @@ class taskModel extends model
$projectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectList)->fetchPairs('id');
foreach($tasks as $task) $task->projectName = zget($projectPairs, $task->project);
$suspendedLists = $this->dao->select('id')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('status')->eq('suspended')
->andWhere('type')->in('project,sprint')
->fetchAll('id');
foreach($tasks as $task)
{
foreach($suspendedLists as $suspendedList)
{
if($task->project == $suspendedList->id || $task->execution == $suspendedList->id)
{
$task->isSuspened = 1;
break;
}
}
if(!isset($task->isSuspened)) $task->isSuspened = 0;
}
if($tasks) return $this->processTasks($tasks);
return array();
}
@@ -2194,10 +2178,12 @@ class taskModel extends model
$stmt = $this->dao->select('t1.id, t1.name, t2.name as execution')
->from(TABLE_TASK)->alias('t1')
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id')
->leftjoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->where('t1.assignedTo')->eq($account)
->andWhere('t1.deleted')->eq(0)
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi()
->andWhere('t2.status')->ne('suspended')->andWhere('t3.status')->ne('suspended')->fi()
->query();
$tasks = array();

View File

@@ -51,6 +51,7 @@ class todoModel extends model
if($todo->pri == 'low') $todo->pri = 3;
}
a($todo->type . '11111');
if($todo->type != 'custom')
{
$type = $todo->type;