* Finish task#61964

This commit is contained in:
zenggang
2022-07-26 06:03:35 +00:00
parent 867f5467d9
commit 7973da34a6
7 changed files with 80 additions and 35 deletions

View File

@@ -1748,6 +1748,7 @@ class block extends control
->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()
->beginIF($objectType == 'issue' or $objectType == 'risk')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=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()
@@ -1757,6 +1758,7 @@ class block extends control
->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()
->beginIF($objectType == 'feedback')->andWhere('t1.status')->in('wait, noreview')->fi()
->beginIF($objectType == 'issue' or $objectType == 'risk')->andWhere('t2.deleted')->eq(0)->fi()
->orderBy($orderBy)
->beginIF($limitCount)->limit($limitCount)->fi()
->fetchAll();
@@ -1813,16 +1815,18 @@ class block extends control
$now = date('H:i:s', strtotime(helper::now()));
$meetingCount = isset($params->meetingCount) ? isset($params->meetingCount) : 0;
$meetings = $this->dao->select('*')->from(TABLE_MEETING)
->where('deleted')->eq('0')
->andWhere('(date')->gt($today)
->orWhere('(begin')->gt($now)
->andWhere('date')->eq($today)
$meetings = $this->dao->select('*')->from(TABLE_MEETING)->alias('t1')
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.deleted')->eq('0')
->andWhere('t2.deleted')->eq('0')
->andWhere('(t1.date')->gt($today)
->orWhere('(t1.begin')->gt($now)
->andWhere('t1.date')->eq($today)
->markRight(2)
->andwhere('(host')->eq($this->app->user->account)
->orWhere('participant')->in($this->app->user->account)
->andwhere('(t1.host')->eq($this->app->user->account)
->orWhere('t1.participant')->in($this->app->user->account)
->markRight(1)
->orderBy('id_desc')
->orderBy('t1.id_desc')
->beginIF($meetingCount)->limit($meetingCount)->fi()
->fetchAll();

View File

@@ -185,9 +185,11 @@ class blockModel extends model
$data['tasks'] = isset($tasks->tasks) ? $tasks->tasks : 0;
$data['doneTasks'] = isset($tasks->doneTasks) ? $tasks->doneTasks : 0;
$data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG)
->where('assignedTo')->eq($this->app->user->account)
->andWhere('deleted')->eq(0)
$data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on("t1.product = t2.id")
->where('t1.assignedTo')->eq($this->app->user->account)
->andWhere('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->fetch('count');
$data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')

View File

@@ -1691,6 +1691,7 @@ class bugModel extends model
return $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq('0')
->beginIF($type == 'bySearch')->andWhere($query)->fi()
->beginIF($executionID)->andWhere('t1.execution')->eq($executionID)->fi()
->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi()

View File

@@ -993,7 +993,7 @@ EOF;
* @access public
* @return void
*/
public function nc($browseType = 'assignedToMe', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function nc($browseType = 'assignedToMe', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->loadModel('nc');
$this->session->set('ncList', $this->app->getURI(true));
@@ -1015,6 +1015,7 @@ EOF;
$this->view->projects = $this->loadModel('project')->getPairsByProgram();
$this->view->pager = $pager;
$this->view->orderBy = $orderBy;
$this->view->param = $param;
$this->view->mode = 'nc';
$this->display();
}

View File

@@ -334,21 +334,52 @@ class myModel extends model
->fetchAll('objectID');
if(empty($objectIDList)) return array();
$objectList = $this->dao->select('*')->from($this->config->objectTables[$module])
->where('deleted')->eq(0)
->andWhere('id')->in(array_keys($objectIDList))
->beginIF($objectType == 'requirement' or $objectType == 'story')->andWhere('type')->eq($objectType)->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
if($objectType == 'task')
{
$objectList = $this->dao->select('t1.*, t2.name as executionName')->from($this->config->objectTables[$module])->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on("t1.execution = t2.id")
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.id')->in(array_keys($objectIDList))
->orderBy('t1.' . $orderBy)
->page($pager)
->fetchAll('id');
}
elseif($objectType == 'requirement' or $objectType == 'story')
{
$objectList = $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on("t1.product = t2.id")
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.id')->in(array_keys($objectIDList))
->andWhere('t1.type')->eq($objectType)
->orderBy('t1.' . $orderBy)
->page($pager)
->fetchAll('id');
}
elseif($objectType == 'risk' or $objectType == 'issue')
{
$objectList = $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = t2.id")
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.id')->in(array_keys($objectIDList))
->orderBy('t1.' . $orderBy)
->page($pager)
->fetchAll('id');
}
else
{
$objectList = $this->dao->select('*')->from($this->config->objectTables[$module])
->where('deleted')->eq(0)
->andWhere('id')->in(array_keys($objectIDList))
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
}
if($objectType == 'task')
{
$executionList = array();
foreach($objectList as $task) $executionList[$task->execution] = $task->execution;
$objectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($executionList)->fetchPairs('id');
foreach($objectList as $task) $task->executionName = zget($objectPairs, $task->execution, '');
if($objectList) return $this->loadModel('task')->processTasks($objectList);
return $objectList;
}

View File

@@ -292,7 +292,9 @@ class testtaskModel extends model
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t1.product = t4.id')
->where('t1.deleted')->eq(0)
->andWhere('t4.deleted')->eq(0)
->andWhere('t1.auto')->ne('unit')
->andWhere('t1.owner')->eq($account)
->andWhere('t2.id')->in($this->app->user->view->sprints)

View File

@@ -2813,25 +2813,29 @@ class userModel extends model
{
if(empty($account)) $account = $this->app->user->account;
$count = 'count(id) AS count';
$t1Count = 'count(t1.id) AS count';
$personalData = array();
$personalData['createdTodos'] = $this->dao->select($count)->from(TABLE_TODO)->where('account')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdRequirements'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('type')->eq('requirement')->fetch('count');
$personalData['createdStories'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('type')->eq('story')->fetch('count');
$personalData['createdBugs'] = $this->dao->select($count)->from(TABLE_BUG)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['resolvedBugs'] = $this->dao->select($count)->from(TABLE_BUG)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdRequirements'] = $this->dao->select($t1Count)->from(TABLE_STORY)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->andWhere('t1.type')->eq('requirement')->fetch('count');
$personalData['createdStories'] = $this->dao->select($t1Count)->from(TABLE_STORY)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->andWhere('t1.type')->eq('story')->fetch('count');
$personalData['createdBugs'] = $this->dao->select($t1Count)->from(TABLE_BUG)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count');
$personalData['resolvedBugs'] = $this->dao->select($t1Count)->from(TABLE_BUG)->alias('t1')->leftjoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count');
$personalData['createdCases'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
if($this->config->edition == 'max')
{
$personalData['createdRisks'] = $this->dao->select($count)->from(TABLE_RISK)->where('createdBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['resolvedRisks'] = $this->dao->select($count)->from(TABLE_RISK)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdIssues'] = $this->dao->select($count)->from(TABLE_ISSUE)->where('createdBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['resolvedIssues'] = $this->dao->select($count)->from(TABLE_ISSUE)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdRisks'] = $this->dao->select($t1Count)->from(TABLE_RISK)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.createdBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count');
$personalData['resolvedRisks'] = $this->dao->select($t1Count)->from(TABLE_RISK)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count');
$personalData['createdIssues'] = $this->dao->select($t1Count)->from(TABLE_ISSUE)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.createdBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count');
$personalData['resolvedIssues'] = $this->dao->select($t1Count)->from(TABLE_ISSUE)->alias('t1')->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count');
}
$personalData['createdDocs'] = $this->dao->select($count)->from(TABLE_DOC)->where('addedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['finishedTasks'] = $this->dao->select($count)->from(TABLE_TASK)->where('deleted')->eq('0')
->andWhere('finishedBy', true)->eq($account)
->orWhere('finishedList')->like("%,{$account},%")
$personalData['finishedTasks'] = $this->dao->select($t1Count)->from(TABLE_TASK)->alias('t1')
->leftjoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')
->where('t1.deleted')->eq('0')
->andWhere('t2.deleted')->eq('0')
->andWhere('t1.finishedBy', true)->eq($account)
->orWhere('t1.finishedList')->like("%,{$account},%")
->markRight(1)
->fetch('count');