From 2b422e243684640f2544a222558d4fcb1ea0af90 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 19 Feb 2021 17:51:30 +0800 Subject: [PATCH] * Finish task#36021. --- config/filter.php | 30 ++++++++++++++++-------------- module/index/css/index.css | 4 ++-- module/project/control.php | 34 ++++++++++++++++++++++++---------- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/lang/zh-tw.php | 1 + module/project/model.php | 20 +++++++++++++++----- 10 files changed, 63 insertions(+), 31 deletions(-) diff --git a/config/filter.php b/config/filter.php index f2f17a2258..46fde65570 100644 --- a/config/filter.php +++ b/config/filter.php @@ -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'; diff --git a/module/index/css/index.css b/module/index/css/index.css index a2e7e20609..359a4665a0 100644 --- a/module/index/css/index.css +++ b/module/index/css/index.css @@ -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) { diff --git a/module/project/control.php b/module/project/control.php index e095bef854..06e6d1395b 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -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, ' ' . $execution->name, '', "class='search-list-item' title='$execution->name' $dataKey"); + echo '