* Finish task#36021.

This commit is contained in:
leiyong
2021-02-19 17:51:30 +08:00
parent 85840a26b3
commit 2b422e2436
10 changed files with 63 additions and 31 deletions
+16 -14
View File
@@ -172,20 +172,22 @@ $filter->program->pgmbrowse->cookie['showClosed'] = 'code';
$filter->program->export->cookie['checkedItem'] = 'reg::checked';
$filter->program->ajaxgetpgmdropmenu->cookie['showClosed'] = 'code';
$filter->project->default->cookie['lastProject'] = 'int';
$filter->project->default->cookie['lastPRJ'] = 'int';
$filter->project->default->cookie['projectMode'] = 'code';
$filter->project->story->cookie['storyModuleParam'] = 'int';
$filter->project->story->cookie['storyPreProjectID'] = 'int';
$filter->project->story->cookie['storyProductParam'] = 'int';
$filter->project->story->cookie['storyBranchParam'] = 'reg::checked';
$filter->project->story->cookie['projectStoryOrder'] = 'reg::orderBy';
$filter->project->task->cookie['moduleBrowseParam'] = 'int';
$filter->project->task->cookie['preProjectID'] = 'int';
$filter->project->task->cookie['productBrowseParam'] = 'int';
$filter->project->task->cookie['projectTaskOrder'] = 'reg::orderBy';
$filter->project->task->cookie['windowWidth'] = 'int';
$filter->project->export->cookie['checkedItem'] = 'reg::checked';
$filter->project->default->cookie['lastProject'] = 'int';
$filter->project->default->cookie['lastPRJ'] = 'int';
$filter->project->default->cookie['projectMode'] = 'code';
$filter->project->default->cookie['recentExecutions'] = 'code';
$filter->project->story->cookie['storyModuleParam'] = 'int';
$filter->project->story->cookie['storyPreProjectID'] = 'int';
$filter->project->story->cookie['storyProductParam'] = 'int';
$filter->project->story->cookie['storyBranchParam'] = 'reg::checked';
$filter->project->story->cookie['projectStoryOrder'] = 'reg::orderBy';
$filter->project->task->cookie['moduleBrowseParam'] = 'int';
$filter->project->task->cookie['preProjectID'] = 'int';
$filter->project->task->cookie['productBrowseParam'] = 'int';
$filter->project->task->cookie['projectTaskOrder'] = 'reg::orderBy';
$filter->project->task->cookie['windowWidth'] = 'int';
$filter->project->task->cookie['recentExecutions'] = 'code';
$filter->project->export->cookie['checkedItem'] = 'reg::checked';
$filter->qa->default->cookie['lastProduct'] = 'int';
$filter->qa->default->cookie['preBranch'] = 'int';
+2 -2
View File
@@ -24,11 +24,11 @@ body.menu-hide {padding-left: 0;}
.menu-hide #menu .nav > li > a > .text {display: none}
.menu-hide #menu .nav > li.has-avatar > a {padding: 2px 0;}
#moreExecution {display:none; max-height: 520px; min-height: 520px; max-width:260px; min-width: 150px; position: fixed; bottom: 40px; z-index: 999; background: white; padding: 20px 10px; border: 1px solid #efefef}
#moreExecution {display:none; max-height: 520px; min-height: 520px; max-width:360px; min-width: 150px; position: fixed; bottom: 40px; z-index: 999; background: white; padding: 20px 10px; border: 1px solid #efefef}
.more-execution-show {left: 96px;}
.more-execution-hide {left: 40px;}
#moreExecution .icon-search {opacity: 0.5;}
#executionList {max-height: 450px; min-height: 450px; max-width:260px; min-width: 150px; margin-top: 5px;}
#executionList {max-height: 450px; min-height: 450px; max-width:360px; min-width: 150px; margin-top: 5px;}
@media screen and (max-height: 768px)
{
+24 -10
View File
@@ -117,6 +117,13 @@ class project extends control
if(!$projectID) $this->locate($this->createLink('program', 'PRJbrowse'));
setCookie("lastPRJ", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
/* Save the recently five executions visited in the cookie. */
$recentExecutions = $this->cookie->recentExecutions ? explode('join', $this->cookie->recentExecutions) : array();
array_unshift($recentExecutions, $executionID);
$recentExecutions = array_unique($recentExecutions);
$recentExecutions = array_slice($recentExecutions, 0, 5);
setcookie("recentExecutions", implode('join', $recentExecutions), $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->loadModel('tree');
$this->loadModel('search');
$this->loadModel('task');
@@ -2471,18 +2478,25 @@ class project extends control
*/
public function ajaxGetRecentExecutions()
{
$executions = $this->project->getRecentExecutions();
if(!empty($executions))
$allExecution = $this->project->getRecentExecutions();
if(!empty($allExecution))
{
$executionsName = array();
foreach($executions as $execution) $executionsName[] = $execution->name;
$executionsPinYin = common::convert2Pinyin($executionsName);
foreach($executions as $execution)
foreach($allExecution as $type => $executionList)
{
$link = helper::createLink('project', 'task', 'executionID=' . $execution->id, '', false, $execution->project);
$execution->code = empty($execution->code) ? $execution->name : $execution->code;
$dataKey = 'date-key="' . zget($executionsPinYin, $execution->name, $execution->name) . '"';
echo html::a($link, '<i class="icon icon-' . $this->lang->icons[$execution->type] . '"></i> ' . $execution->name, '', "class='search-list-item' title='$execution->name' $dataKey");
echo '<div class="heading">'. $this->lang->project->$type . '</div>';
$color = $type == 'recent' ? 'text-brown' : '';
$executions = $allExecution[$type];
$executionsName = array();
foreach($executions as $execution) $executionsName[] = $execution->name;
$executionsPinYin = common::convert2Pinyin($executionsName);
foreach($executions as $execution)
{
$link = helper::createLink('project', 'task', 'executionID=' . $execution->id, '', false, $execution->project);
$execution->code = empty($execution->code) ? $execution->name : $execution->code;
$dataKey = 'date-key="' . zget($executionsPinYin, $execution->name, $execution->name) . '"';
$class = "class='search-list-item $color' title='$execution->name' $dataKey";
echo html::a($link, '<i class="icon icon-' . $this->lang->icons[$execution->type] . '"></i> ' . $execution->name, '', $class);
}
}
}
else
+1
View File
@@ -81,6 +81,7 @@ $lang->project->waitTasks = 'Waiting Tasks';
$lang->project->viewByUser = 'By User';
$lang->project->oneProduct = "Only one stage can be linked {$lang->productCommon}";
$lang->project->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->project->recent = 'Recent visits: ';
$lang->project->start = 'Start';
$lang->project->activate = 'Aktivieren';
+1
View File
@@ -81,6 +81,7 @@ $lang->project->waitTasks = 'Waiting Tasks';
$lang->project->viewByUser = 'By User';
$lang->project->oneProduct = "Only one stage can be linked {$lang->productCommon}";
$lang->project->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->project->recent = 'Recent visits: ';
$lang->project->start = 'Start';
$lang->project->activate = 'Activate';
+1
View File
@@ -81,6 +81,7 @@ $lang->project->waitTasks = 'Waiting Tasks';
$lang->project->viewByUser = 'Par Utilisateur';
$lang->project->oneProduct = "Only one stage can be linked {$lang->productCommon}";
$lang->project->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->project->recent = 'Recent visits: ';
$lang->project->start = 'Démarrer';
$lang->project->activate = 'Activer';
+1
View File
@@ -81,6 +81,7 @@ $lang->project->waitTasks = 'Waiting Tasks';
$lang->project->viewByUser = 'Theo người dùng';
$lang->project->oneProduct = "Only one stage can be linked {$lang->productCommon}";
$lang->project->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->project->recent = 'Recent visits: ';
$lang->project->start = 'Bắt đầu';
$lang->project->activate = 'Kích hoạt';
+1
View File
@@ -81,6 +81,7 @@ $lang->project->waitTasks = '待处理';
$lang->project->viewByUser = '按用户查看';
$lang->project->oneProduct = "阶段只能关联一个{$lang->productCommon}";
$lang->project->noLinkProduct = "阶段没有关联{$lang->productCommon}";
$lang->project->recent = '近期访问:';
$lang->project->start = "开始";
$lang->project->activate = "激活";
+1
View File
@@ -81,6 +81,7 @@ $lang->project->waitTasks = '待處理';
$lang->project->viewByUser = '按用戶查看';
$lang->project->oneProduct = "階段只能關聯一個{$lang->productCommon}";
$lang->project->noLinkProduct = "階段沒有關聯{$lang->productCommon}";
$lang->project->recent = '近期访问:';
$lang->project->start = "開始";
$lang->project->activate = "激活";
+15 -5
View File
@@ -3594,7 +3594,7 @@ class projectModel extends model
->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('id_desc')
->orderBy('project_desc, id_desc')
->fetchAll();
/* Get the project or product to which the execution belongs. */
@@ -3602,19 +3602,29 @@ class projectModel extends model
$stageIdList = array();
foreach($executions as $execution)
{
if($execution->type == 'stage') $stageIdList[$execution->id] = $execution->id;
if($execution->type == 'sprint') $projectIdList[$execution->project] = $execution->project;
if($execution->type == 'stage') $stageIdList[$execution->id] = $execution->id;
$projectIdList[$execution->project] = $execution->project;
}
$projectPairs = $this->loadModel('program')->getPRJPairsByIdList($projectIdList);
$productPairs = $this->getStageLinkProductPairs($stageIdList);
$recentExecutions = explode('join', $this->cookie->recentExecutions);
$allExecution = array('recent' => array(), 'mine' => array());
foreach($executions as $execution)
{
if($execution->type == 'stage') $execution->name = zget($productPairs, $execution->id) . '/' . $execution->name;
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['mine'][] = $execution;
}
return $executions;
ksort($allExecution['recent']);
return $allExecution;
}
/**