Merge branch '15.0.beta3' of http://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3

This commit is contained in:
zhujinyong
2021-03-23 14:22:16 +08:00
70 changed files with 341 additions and 532 deletions
+1 -54
View File
@@ -851,8 +851,7 @@ class executionModel extends model
}
$dropMenuLink = helper::createLink('execution', 'ajaxGetDropMenu', "executionID=$executionID&module=$currentModule&method=$currentMethod&extra=");
$output = "<div class='btn-group header-btn'><i class='icon icon-run'></i> {$this->lang->execution->common}</div> ";
$output .= "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentExecutionName}'><span class='text'>{$currentExecutionName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output = "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentExecutionName}'><span class='text'>{$currentExecutionName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
@@ -3484,58 +3483,6 @@ class executionModel extends model
if(!empty($products)) $this->user->updateUserView(array_keys($products), 'product', $users);
}
/**
* Get recent executions.
*
* @access public
* @return object
*/
public function getRecentExecutions()
{
$isView = (empty($this->app->user->view->sprints) || empty($this->app->user->view->projects)) ? false : true;
if(!$this->app->user->admin && $isView === false) return array();
$executions = $this->dao->select('t1.id,t1.project,t1.code,t1.name,t1.type')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_TEAM)->alias('t2')->on('t1.id=t2.root')
->where('t1.type')->in('stage,sprint')
->andWhere('t2.account')->eq($this->app->user->account)
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->projects)->fi()
->andWhere('t1.status')->ne('closed')
->andWhere('t1.deleted')->eq('0')
->orderBy('project_desc, id_desc')
->fetchAll();
/* Get the project or product to which the execution belongs. */
$projectIdList = array();
$stageIdList = array();
foreach($executions as $execution)
{
if($execution->type == 'stage') $stageIdList[$execution->id] = $execution->id;
$projectIdList[$execution->project] = $execution->project;
}
$projectPairs = $this->loadModel('project')->getPairsByIdList($projectIdList);
$productPairs = $this->getStageLinkProductPairs($stageIdList);
$recentExecutions = isset($this->config->execution->recentExecutions) ? explode(',', $this->config->execution->recentExecutions) : array();
$allExecution = array('recent' => array(), 'involved' => array());
foreach($executions as $execution)
{
if($execution->type == 'stage') $execution->name = zget($projectPairs, $execution->project) . '/' . zget($productPairs, $execution->id) . '/' . $execution->name;
if($execution->type == 'sprint') $execution->name = zget($projectPairs, $execution->project) . '/' . $execution->name;
if(in_array($execution->id, $recentExecutions))
{
$index = array_search($execution->id, $recentExecutions);
$allExecution['recent'][$index] = $execution;
continue;
}
$allExecution['involved'][] = $execution;
}
ksort($allExecution['recent']);
return $allExecution;
}
/**
* Get the products associated with the stage.
*