* adjust code.

This commit is contained in:
wangyidong
2021-07-01 16:56:59 +08:00
parent c74a1f483d
commit c287a0cb49
7 changed files with 22 additions and 13 deletions

View File

@@ -58,11 +58,11 @@ class gitlab
{
$file = $this->files($file->path);
$info->revision = $file->revision;
$info->comment = $file->comment;
$info->account = $file->committer;
$info->date = $file->date;
$info->size = $file->size;
$info->revision = zget($file, 'revision', '');
$info->comment = zget($file, 'comment', '');
$info->account = zget($file, 'committer', '');
$info->date = zget($file, 'date', '');
$info->size = zget($file, 'size', '');
}
else
{

View File

@@ -279,7 +279,10 @@ class deptModel extends model
public function getAllChildId($deptID)
{
if($deptID == 0) return array();
$dept = $this->getById($deptID);
if(empty($dept)) return array();
$childs = $this->dao->select('id')->from(TABLE_DEPT)->where('path')->like($dept->path . '%')->fetchPairs();
return array_keys($childs);
}

View File

@@ -40,9 +40,9 @@ class execution extends control
$this->loadModel('project');
$this->executions = $this->execution->getPairs(0, 'all', 'nocode');
if(!in_array($this->methodName, array('computeburn', 'ajaxgetdropmenu')) and $this->app->openApp == 'execution')
{
$this->executions = $this->execution->getPairs(0, 'all', 'nocode');
if(!$this->executions and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('execution', 'create'));
}
$this->objectType = $this->config->systemMode == 'classic' ? 'project' : 'execution';

View File

@@ -2372,7 +2372,7 @@ class executionModel extends model
$changedAccounts = array_unique($changedAccounts);
/* Add the execution team members to the project. */
$this->addProjectMembers($execution->project, $executionMember);
if($execution->project) $this->addProjectMembers($execution->project, $executionMember);
if($execution->acl != 'open') $this->updateUserView($executionID, 'sprint', $changedAccounts);
}
@@ -2406,9 +2406,12 @@ class executionModel extends model
$changedAccounts = array_merge($changedAccounts, array_diff($oldAccounts, $accounts));
$changedAccounts = array_unique($changedAccounts);
$this->loadModel('user')->updateUserView($projectID, $projectType, $changedAccounts);
$linkedProducts = $this->loadModel('product')->getProductPairsByProject($projectID);
if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts);
if($changedAccounts)
{
$this->loadModel('user')->updateUserView($projectID, $projectType, $changedAccounts);
$linkedProducts = $this->loadModel('product')->getProductPairsByProject($projectID);
if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts);
}
}
/**

View File

@@ -657,7 +657,7 @@ class repoModel extends model
if($existsRevision)
{
if($branch) $this->dao->replace(TABLE_REPOBRANCH)->set('repo')->eq($repoID)->set('revision')->eq($existsRevision->id)->set('branch')->eq($branch)->exec();
return true;
return $version;
}
$history = new stdclass();

View File

@@ -50,8 +50,8 @@
<td class='w-60px'><?php if(!empty($result->files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?></td>
<td class='w-50px text-center'><i class='collapse-handle icon-angle-down text-muted'></i></td>
</tr>
<?php $executionParam = ($this->app->openApp == 'execution' and isset($testtask)) ? "executionID=$testtask->execution," : "executionID={$this->session->execution}";?>
<?php $params = isset($testtask) ? ",testtask=$testtask->id,{$executionParam}buildID=$testtask->build" : ",$executionParam";?>
<?php $executionParam = ($this->app->openApp == 'execution' and isset($testtask)) ? "executionID=$testtask->execution" : "";?>
<?php $params = isset($testtask) ? ",testtask=$testtask->id,{$executionParam},buildID=$testtask->build" : ",$executionParam";?>
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
<td colspan='7' class='pd-0'>
<?php $projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}," : ''?>

View File

@@ -1677,6 +1677,7 @@ class userModel extends model
->beginIF($this->config->systemMode == 'new')->andWhere('type')->eq('project')->fi()
->beginIF($this->config->systemMode == 'classic')->andWhere('type')->eq('execution')->fi()
->andWhere('root')->in(array_keys($projectProducts))
->andWhere('root')->ne(0)
->query();
while($team = $stmt->fetch())
@@ -1926,6 +1927,7 @@ class userModel extends model
$stmt = $this->dao->select('root,account')->from(TABLE_TEAM)
->where('type')->eq('project')
->andWhere('root')->in($projectIdList)
->andWhere('root')->ne(0)
->query();
while($team = $stmt->fetch()) $teamGroups[$team->root][$team->account] = $team->account;
@@ -2085,6 +2087,7 @@ class userModel extends model
$stmt = $this->dao->select('root,account')->from(TABLE_TEAM)
->where('type')->in('project,execution')
->andWhere('root')->in(array_merge($sprintIdList, $parentIdList))
->andWhere('root')->ne(0)
->query();
while($team = $stmt->fetch()) $teamGroups[$team->root][$team->account] = $team->account;