* Finish task #36754.

This commit is contained in:
holan20180123
2021-03-16 15:30:18 +08:00
parent 11db3b9d5c
commit 1162b8fd05
3 changed files with 12 additions and 12 deletions
+3 -10
View File
@@ -2213,14 +2213,10 @@ class executionModel extends model
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembers();
$execution = $this->getByID($executionID);
$type = $this->config->systemMode == 'new' ? $execution->type : 'execution';
if(empty($execution)) return array();
return $this->dao->select("t1.*, t1.hours * t1.days AS totalHours, t2.id as userID, if(t2.deleted='0', t2.realname, t1.account) as realname")->from(TABLE_TEAM)->alias('t1')
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account')
->where('t1.root')->eq((int)$executionID)
->andWhere('t1.type')->eq($type)
->andWhere('t1.type')->eq('execution')
->andWhere('t2.deleted')->eq('0')
->fetchAll('account');
}
@@ -2239,14 +2235,11 @@ class executionModel extends model
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembersPairs();
$this->app->loadConfig('user');
$execution = $this->getByID($executionID);
if(empty($execution)) return array();
$keyField = strpos($params, 'useid') !== false ? 'id' : 'account';
$users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1')
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account')
->where('t1.root')->eq((int)$executionID)
->andWhere('t1.type')->eq($execution->type)
->andWhere('t1.type')->eq('execution')
->beginIF($params == 'nodeleted' or empty($this->config->user->showDeleted))
->andWhere('t2.deleted')->eq(0)
->fi()
@@ -2344,7 +2337,7 @@ class executionModel extends model
$data = (array)fixer::input('post')->get();
extract($data);
$executionType = $execution->type;
$executionType = strpos('sprint|stage', $execution->type) !== false ? 'execution' : $execution->type;
$accounts = array_unique($accounts);
$limited = array_values($limited);
$oldJoin = $this->dao->select('`account`, `join`')->from(TABLE_TEAM)->where('root')->eq((int)$executionID)->andWhere('type')->eq($executionType)->fetchPairs();
+8 -1
View File
@@ -199,11 +199,18 @@
</tbody>
</table>
<div class="table-footer">
<?php if($canBatchClose):?>
<?php if($canBatchClose or $canBatchEdit):?>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php endif;?>
<div class="table-actions btn-toolbar">
<?php
if($canBatchEdit)
{
$actionLink = $this->createLink('task', 'batchEdit');
$misc = "data-form-action='$actionLink'";
echo html::commonButton($lang->edit, $misc);
}
if($canBatchClose)
{
$actionLink = $this->createLink('task', 'batchClose', null, '', '', $task->project);
+1 -1
View File
@@ -476,7 +476,7 @@ class task extends control
/* Get execution teams. */
$executionIDList = array();
foreach($tasks as $task) if(!in_array($task->execution, $executionIDList)) $executionIDList[] = $task->execution;
$executionTeams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($executionIDList)->andWhere('type')->in('sprint,stage')->fetchGroup('root', 'account');
$executionTeams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($executionIDList)->andWhere('type')->eq('execution')->fetchGroup('root', 'account');
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($tasks) * (count(explode(',', $this->config->task->custom->batchEditFields)) + 3);