From f289ed31b1c244cf29e1cdd8a739f21b43bee88b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 16 Oct 2017 13:43:20 +0800 Subject: [PATCH 1/9] * finish task #3246. --- module/bug/config.php | 60 +++++++++++++++++++++++--- module/bug/control.php | 14 ++++++ module/bug/lang/en.php | 1 + module/bug/lang/zh-cn.php | 1 + module/bug/model.php | 44 +++++++++++++++++-- module/bug/view/datatabledata.html.php | 2 +- module/story/config.php | 35 ++++++++++++--- module/story/model.php | 21 +++++++++ module/task/config.php | 15 +++++++ module/task/model.php | 15 +++++++ module/testcase/config.php | 35 +++++++++++++++ module/testcase/control.php | 6 ++- module/testcase/model.php | 21 +++++++++ module/testtask/model.php | 21 +++++++++ 14 files changed, 274 insertions(+), 17 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index 5f95ff8482..ed27b6af24 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -187,11 +187,26 @@ $config->bug->datatable->fieldList['title']['fixed'] = 'left'; $config->bug->datatable->fieldList['title']['width'] = 'auto'; $config->bug->datatable->fieldList['title']['required'] = 'yes'; +$config->bug->datatable->fieldList['branch']['title'] = 'branch'; +$config->bug->datatable->fieldList['branch']['fixed'] = 'left'; +$config->bug->datatable->fieldList['branch']['width'] = '100'; +$config->bug->datatable->fieldList['branch']['required'] = 'no'; + $config->bug->datatable->fieldList['type']['title'] = 'type'; $config->bug->datatable->fieldList['type']['fixed'] = 'no'; $config->bug->datatable->fieldList['type']['width'] = '90'; $config->bug->datatable->fieldList['type']['required'] = 'no'; +$config->bug->datatable->fieldList['project']['title'] = 'project'; +$config->bug->datatable->fieldList['project']['fixed'] = 'no'; +$config->bug->datatable->fieldList['project']['width'] = '120'; +$config->bug->datatable->fieldList['project']['required'] = 'no'; + +$config->bug->datatable->fieldList['plan']['title'] = 'plan'; +$config->bug->datatable->fieldList['plan']['fixed'] = 'no'; +$config->bug->datatable->fieldList['plan']['width'] = '120'; +$config->bug->datatable->fieldList['plan']['required'] = 'no'; + $config->bug->datatable->fieldList['status']['title'] = 'statusAB'; $config->bug->datatable->fieldList['status']['fixed'] = 'no'; $config->bug->datatable->fieldList['status']['width'] = '80'; @@ -207,6 +222,41 @@ $config->bug->datatable->fieldList['activatedDate']['fixed'] = 'no'; $config->bug->datatable->fieldList['activatedDate']['width'] = '90'; $config->bug->datatable->fieldList['activatedDate']['required'] = 'no'; +$config->bug->datatable->fieldList['story']['title'] = 'story'; +$config->bug->datatable->fieldList['story']['fixed'] = 'no'; +$config->bug->datatable->fieldList['story']['width'] = '120'; +$config->bug->datatable->fieldList['story']['required'] = 'no'; + +$config->bug->datatable->fieldList['task']['title'] = 'task'; +$config->bug->datatable->fieldList['task']['fixed'] = 'no'; +$config->bug->datatable->fieldList['task']['width'] = '120'; +$config->bug->datatable->fieldList['task']['required'] = 'no'; + +$config->bug->datatable->fieldList['keywords']['title'] = 'keywords'; +$config->bug->datatable->fieldList['keywords']['fixed'] = 'no'; +$config->bug->datatable->fieldList['keywords']['width'] = '100'; +$config->bug->datatable->fieldList['keywords']['required'] = 'no'; + +$config->bug->datatable->fieldList['os']['title'] = 'os'; +$config->bug->datatable->fieldList['os']['fixed'] = 'no'; +$config->bug->datatable->fieldList['os']['width'] = '80'; +$config->bug->datatable->fieldList['os']['required'] = 'no'; + +$config->bug->datatable->fieldList['browser']['title'] = 'browser'; +$config->bug->datatable->fieldList['browser']['fixed'] = 'no'; +$config->bug->datatable->fieldList['browser']['width'] = '80'; +$config->bug->datatable->fieldList['browser']['required'] = 'no'; + +$config->bug->datatable->fieldList['found']['title'] = 'found'; +$config->bug->datatable->fieldList['found']['fixed'] = 'no'; +$config->bug->datatable->fieldList['found']['width'] = '80'; +$config->bug->datatable->fieldList['found']['required'] = 'no'; + +$config->bug->datatable->fieldList['mailto']['title'] = 'mailto'; +$config->bug->datatable->fieldList['mailto']['fixed'] = 'no'; +$config->bug->datatable->fieldList['mailto']['width'] = '100'; +$config->bug->datatable->fieldList['mailto']['required'] = 'no'; + $config->bug->datatable->fieldList['openedBy']['title'] = 'openedByAB'; $config->bug->datatable->fieldList['openedBy']['fixed'] = 'no'; $config->bug->datatable->fieldList['openedBy']['width'] = '80'; @@ -267,6 +317,11 @@ $config->bug->datatable->fieldList['closedDate']['fixed'] = 'no'; $config->bug->datatable->fieldList['closedDate']['width'] = '90'; $config->bug->datatable->fieldList['closedDate']['required'] = 'no'; +$config->bug->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy'; +$config->bug->datatable->fieldList['lastEditedBy']['fixed'] = 'no'; +$config->bug->datatable->fieldList['lastEditedBy']['width'] = '80'; +$config->bug->datatable->fieldList['lastEditedBy']['required'] = 'no'; + $config->bug->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDateAB'; $config->bug->datatable->fieldList['lastEditedDate']['fixed'] = 'no'; $config->bug->datatable->fieldList['lastEditedDate']['width'] = '90'; @@ -276,8 +331,3 @@ $config->bug->datatable->fieldList['actions']['title'] = 'actions'; $config->bug->datatable->fieldList['actions']['fixed'] = 'right'; $config->bug->datatable->fieldList['actions']['width'] = '140'; $config->bug->datatable->fieldList['actions']['required'] = 'yes'; - -$config->bug->datatable->fieldList['branch']['title'] = 'branch'; -$config->bug->datatable->fieldList['branch']['fixed'] = 'left'; -$config->bug->datatable->fieldList['branch']['width'] = '100'; -$config->bug->datatable->fieldList['branch']['required'] = 'no'; diff --git a/module/bug/control.php b/module/bug/control.php index 3694f79dba..95ac916703 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -121,6 +121,16 @@ class bug extends control /* Process the openedBuild and resolvedBuild fields. */ $bugs = $this->bug->processBuildForBugs($bugs); + /* Get story and task id list. */ + $storyIdList = $taskIdList = array(); + foreach($bugs as $bug) + { + if($bug->story) $storyIdList[$bug->story] = $bug->story; + if($bug->task) $taskIdList[$bug->task] = $bug->task; + } + $storyList = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array(); + $taskList = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array(); + /* Build the search form. */ $actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->config->bug->search['onMenuBar'] = 'yes'; @@ -150,6 +160,10 @@ class bug extends control $this->view->memberPairs = $this->user->getPairs('noletter|nodeleted'); $this->view->branch = $branch; $this->view->branches = $this->loadModel('branch')->getPairs($productID); + $this->view->projects = $projects; + $this->view->plans = $this->loadModel('productplan')->getPairs($productID); + $this->view->stories = $storyList; + $this->view->tasks = $taskList; $this->view->setShowModule = true; $this->display(); diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 613c15c005..5d969c580a 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -51,6 +51,7 @@ $lang->bug->resolvedBuild = 'Resolved Build'; $lang->bug->resolvedDate = 'Resolved On'; $lang->bug->resolvedDateAB = 'Resolved On'; $lang->bug->deadline = 'Deadline'; +$lang->bug->plan = 'Plan'; $lang->bug->closedBy = 'Closed By'; $lang->bug->closedDate = 'Closed On'; $lang->bug->duplicateBug = 'Duplicate'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index bdca46ec46..6a265b1ca1 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -51,6 +51,7 @@ $lang->bug->resolvedBuild = '解决版本'; $lang->bug->resolvedDate = '解决日期'; $lang->bug->resolvedDateAB = '解决日期'; $lang->bug->deadline = '截止日期'; +$lang->bug->plan = '所属计划'; $lang->bug->closedBy = '由谁关闭'; $lang->bug->closedDate = '关闭日期'; $lang->bug->duplicateBug = '重复ID'; diff --git a/module/bug/model.php b/module/bug/model.php index 0dda750fba..33e52442e6 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2310,7 +2310,7 @@ class bugModel extends model * @access public * @return void */ - public function printCell($col, $bug, $users, $builds, $branches, $modulePairs) + public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array()) { $bugLink = inlink('view', "bugID=$bug->id"); $account = $this->app->user->account; @@ -2349,6 +2349,18 @@ class bugModel extends model case 'branch': echo $branches[$bug->branch]; break; + case 'project': + echo zget($projects, $bug->project, ''); + break; + case 'plan': + echo zget($plans, $bug->plan, ''); + break; + case 'story': + echo zget($stories, $bug->story, ''); + break; + case 'task': + echo zget($tasks, $bug->task, ''); + break; case 'type': echo zget($this->lang->bug->typeList, $bug->type); break; @@ -2361,6 +2373,27 @@ class bugModel extends model case 'activatedDate': echo substr($bug->activatedDate, 5, 11); break; + case 'keywords': + echo $bug->keywords; + break; + case 'os': + echo zget($this->lang->bug->osList, $bug->os); + break; + case 'browser': + echo zget($this->lang->bug->browserList, $bug->browser); + break; + case 'mailto': + $mailto = explode(',', $bug->mailto); + foreach($mailto as $account) + { + $account = trim($account); + if(empty($account)) continue; + echo zget($users, $account) . "  "; + } + break; + case 'found': + echo zget($users, $bug->found); + break; case 'openedBy': echo zget($users, $bug->openedBy); break; @@ -2394,12 +2427,15 @@ class bugModel extends model case 'closedBy': echo zget($users, $bug->closedBy); break; - case 'lastEditedDate': - echo substr($bug->lastEditedDate, 5, 11); - break; case 'closedDate': echo substr($bug->closedDate, 5, 11); break; + case 'lastEditedBy': + echo zget($users, $bug->lastEditedBy); + break; + case 'lastEditedDate': + echo substr($bug->lastEditedDate, 5, 11); + break; case 'actions': $params = "bugID=$bug->id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); diff --git a/module/bug/view/datatabledata.html.php b/module/bug/view/datatabledata.html.php index ebe823e1ca..47be55c06c 100644 --- a/module/bug/view/datatabledata.html.php +++ b/module/bug/view/datatabledata.html.php @@ -23,7 +23,7 @@ extract($widths); - $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs);?> + $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks);?> diff --git a/module/story/config.php b/module/story/config.php index 04152e193c..5da07f186a 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -64,6 +64,16 @@ $config->story->datatable->fieldList['title']['fixed'] = 'left'; $config->story->datatable->fieldList['title']['width'] = 'auto'; $config->story->datatable->fieldList['title']['required'] = 'yes'; +$config->story->datatable->fieldList['branch']['title'] = 'branch'; +$config->story->datatable->fieldList['branch']['fixed'] = 'no'; +$config->story->datatable->fieldList['branch']['width'] = '100'; +$config->story->datatable->fieldList['branch']['required'] = 'no'; + +$config->story->datatable->fieldList['keywords']['title'] = 'keywords'; +$config->story->datatable->fieldList['keywords']['fixed'] = 'no'; +$config->story->datatable->fieldList['keywords']['width'] = '100'; +$config->story->datatable->fieldList['keywords']['required'] = 'no'; + $config->story->datatable->fieldList['plan']['title'] = 'planAB'; $config->story->datatable->fieldList['plan']['fixed'] = 'no'; $config->story->datatable->fieldList['plan']['width'] = '90'; @@ -157,12 +167,27 @@ $config->story->datatable->fieldList['closedReason']['fixed'] = 'no'; $config->story->datatable->fieldList['closedReason']['width'] = '90'; $config->story->datatable->fieldList['closedReason']['required'] = 'no'; +$config->story->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy'; +$config->story->datatable->fieldList['lastEditedBy']['fixed'] = 'no'; +$config->story->datatable->fieldList['lastEditedBy']['width'] = '80'; +$config->story->datatable->fieldList['lastEditedBy']['required'] = 'no'; + +$config->story->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDate'; +$config->story->datatable->fieldList['lastEditedDate']['fixed'] = 'no'; +$config->story->datatable->fieldList['lastEditedDate']['width'] = '90'; +$config->story->datatable->fieldList['lastEditedDate']['required'] = 'no'; + +$config->story->datatable->fieldList['mailto']['title'] = 'mailto'; +$config->story->datatable->fieldList['mailto']['fixed'] = 'no'; +$config->story->datatable->fieldList['mailto']['width'] = '100'; +$config->story->datatable->fieldList['mailto']['required'] = 'no'; + +$config->story->datatable->fieldList['version']['title'] = 'version'; +$config->story->datatable->fieldList['version']['fixed'] = 'no'; +$config->story->datatable->fieldList['version']['width'] = '60'; +$config->story->datatable->fieldList['version']['required'] = 'no'; + $config->story->datatable->fieldList['actions']['title'] = 'actions'; $config->story->datatable->fieldList['actions']['fixed'] = 'right'; $config->story->datatable->fieldList['actions']['width'] = '140'; $config->story->datatable->fieldList['actions']['required'] = 'yes'; - -$config->story->datatable->fieldList['branch']['title'] = 'branch'; -$config->story->datatable->fieldList['branch']['fixed'] = 'left'; -$config->story->datatable->fieldList['branch']['width'] = '100'; -$config->story->datatable->fieldList['branch']['required'] = 'no'; diff --git a/module/story/model.php b/module/story/model.php index e905fa662c..402cc7fd5c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2285,6 +2285,9 @@ class storyModel extends model case 'branch': echo $branches[$story->branch]; break; + case 'keywords': + echo $story->keywords; + break; case 'source': echo zget($this->lang->story->sourceList, $story->source, $story->source); break; @@ -2348,6 +2351,24 @@ class storyModel extends model case 'closedReason': echo zget($this->lang->story->reasonList, $story->closedReason, $story->closedReason); break; + case 'lastEditedBy': + echo zget($users, $story->lastEditedBy, $story->lastEditedBy); + break; + case 'lastEditedDate': + echo substr($story->lastEditedDate, 5, 11); + break; + case 'mailto': + $mailto = explode(',', $story->mailto); + foreach($mailto as $account) + { + $account = trim($account); + if(empty($account)) continue; + echo zget($users, $account) . '  '; + } + break; + case 'version': + echo $story->version; + break; case 'actions': $vars = "story={$story->id}"; common::printIcon('story', 'change', $vars, $story, 'list', 'random'); diff --git a/module/task/config.php b/module/task/config.php index b5bbbc3481..eb91526364 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -181,6 +181,21 @@ $config->task->datatable->fieldList['story']['fixed'] = 'no'; $config->task->datatable->fieldList['story']['width'] = '80'; $config->task->datatable->fieldList['story']['required'] = 'no'; +$config->task->datatable->fieldList['mailto']['title'] = 'mailto'; +$config->task->datatable->fieldList['mailto']['fixed'] = 'no'; +$config->task->datatable->fieldList['mailto']['width'] = '100'; +$config->task->datatable->fieldList['mailto']['required'] = 'no'; + +$config->task->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy'; +$config->task->datatable->fieldList['lastEditedBy']['fixed'] = 'no'; +$config->task->datatable->fieldList['lastEditedBy']['width'] = '80'; +$config->task->datatable->fieldList['lastEditedBy']['required'] = 'no'; + +$config->task->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDate'; +$config->task->datatable->fieldList['lastEditedDate']['fixed'] = 'no'; +$config->task->datatable->fieldList['lastEditedDate']['width'] = '90'; +$config->task->datatable->fieldList['lastEditedDate']['required'] = 'no'; + $config->task->datatable->fieldList['actions']['title'] = 'actions'; $config->task->datatable->fieldList['actions']['fixed'] = 'right'; $config->task->datatable->fieldList['actions']['width'] = '140'; diff --git a/module/task/model.php b/module/task/model.php index b74b5e646c..22acfe5d28 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1760,6 +1760,21 @@ class taskModel extends model if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle; } break; + case 'mailto': + $mailto = explode(',', $task->mailto); + foreach($mailto as $account) + { + $account = trim($account); + if(empty($account)) continue; + echo zget($users, $account) . '  '; + } + break; + case 'lastEditedBy': + echo zget($users, $task->lastEditedBy, $task->lastEditedBy); + break; + case 'lastEditedDate': + echo substr($task->lastEditedDate, 5, 11); + break; case 'actions': common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); diff --git a/module/testcase/config.php b/module/testcase/config.php index 59010ded91..d0bd0f68e2 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -106,6 +106,16 @@ $config->testcase->datatable->fieldList['status']['fixed'] = 'no'; $config->testcase->datatable->fieldList['status']['width'] = '80'; $config->testcase->datatable->fieldList['status']['required'] = 'no'; +$config->testcase->datatable->fieldList['precondition']['title'] = 'precondition'; +$config->testcase->datatable->fieldList['precondition']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['precondition']['width'] = '120'; +$config->testcase->datatable->fieldList['precondition']['required'] = 'no'; + +$config->testcase->datatable->fieldList['keywords']['title'] = 'keywords'; +$config->testcase->datatable->fieldList['keywords']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['keywords']['width'] = '100'; +$config->testcase->datatable->fieldList['keywords']['required'] = 'no'; + $config->testcase->datatable->fieldList['openedBy']['title'] = 'openedByAB'; $config->testcase->datatable->fieldList['openedBy']['fixed'] = 'no'; $config->testcase->datatable->fieldList['openedBy']['width'] = '80'; @@ -116,6 +126,16 @@ $config->testcase->datatable->fieldList['openedDate']['fixed'] = 'no'; $config->testcase->datatable->fieldList['openedDate']['width'] = '90'; $config->testcase->datatable->fieldList['openedDate']['required'] = 'no'; +$config->testcase->datatable->fieldList['reviewedBy']['title'] = 'reviewedBy'; +$config->testcase->datatable->fieldList['reviewedBy']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['reviewedBy']['width'] = '80'; +$config->testcase->datatable->fieldList['reviewedBy']['required'] = 'no'; + +$config->testcase->datatable->fieldList['reviewedDate']['title'] = 'reviewedDate'; +$config->testcase->datatable->fieldList['reviewedDate']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['reviewedDate']['width'] = '90'; +$config->testcase->datatable->fieldList['reviewedDate']['required'] = 'no'; + $config->testcase->datatable->fieldList['lastRunner']['title'] = 'lastRunner'; $config->testcase->datatable->fieldList['lastRunner']['fixed'] = 'no'; $config->testcase->datatable->fieldList['lastRunner']['width'] = '80'; @@ -131,6 +151,21 @@ $config->testcase->datatable->fieldList['lastRunResult']['fixed'] = 'no'; $config->testcase->datatable->fieldList['lastRunResult']['width'] = '80'; $config->testcase->datatable->fieldList['lastRunResult']['required'] = 'no'; +$config->testcase->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy'; +$config->testcase->datatable->fieldList['lastEditedBy']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['lastEditedBy']['width'] = '80'; +$config->testcase->datatable->fieldList['lastEditedBy']['required'] = 'no'; + +$config->testcase->datatable->fieldList['lastEditedDate']['title'] = 'lastEditedDate'; +$config->testcase->datatable->fieldList['lastEditedDate']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['lastEditedDate']['width'] = '90'; +$config->testcase->datatable->fieldList['lastEditedDate']['required'] = 'no'; + +$config->testcase->datatable->fieldList['version']['title'] = 'version'; +$config->testcase->datatable->fieldList['version']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['version']['width'] = '60'; +$config->testcase->datatable->fieldList['version']['required'] = 'no'; + $config->testcase->datatable->fieldList['story']['title'] = 'story'; $config->testcase->datatable->fieldList['story']['fixed'] = 'no'; $config->testcase->datatable->fieldList['story']['width'] = '90'; diff --git a/module/testcase/control.php b/module/testcase/control.php index b7c35fdd3d..bcbadf5123 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -500,7 +500,9 @@ class testcase extends control $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($case->branch); } - $caseFails = $this->dao->select('`case` AS name, COUNT(*) AS value')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + $caseFails = $this->dao->select('COUNT(*) AS count')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID) + ->beginIF($from == 'testtask')->andwhere('`run`')->eq($taskID)->fi() + ->fetch('count'); $this->view->position[] = $this->lang->testcase->common; $this->view->position[] = $this->lang->testcase->view; @@ -515,7 +517,7 @@ class testcase extends control $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID); $this->view->runID = $from == 'testcase' ? 0 : $run->id; $this->view->isLibCase = $isLibCase; - $this->view->caseFails = $caseFails ? $caseFails : 0; + $this->view->caseFails = $caseFails; $this->display(); } diff --git a/module/testcase/model.php b/module/testcase/model.php index fe50967fe1..d8970b9ff6 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1286,12 +1286,33 @@ class testcaseModel extends model if(empty($stories)) $stories = $this->dao->select('id,title')->from(TABLE_STORY)->where('deleted')->eq('0')->andWhere('product')->eq($case->product)->fetchPairs('id', 'title'); if($case->story and isset($stories[$case->story])) echo html::a(helper::createLink('story', 'view', "storyID=$case->story"), $stories[$case->story]); break; + case 'precondition': + echo $case->precondition; + break; + case 'keywords': + echo $case->keywords; + break; + case 'version': + echo $case->version; + break; case 'openedBy': echo zget($users, $case->openedBy, $case->openedBy); break; case 'openedDate': echo substr($case->openedDate, 5, 11); break; + case 'reviewedBy': + echo zget($users, $case->reviewedBy, $case->reviewedBy); + break; + case 'reviewedDate': + echo substr($case->reviewedDate, 5, 11); + break; + case 'lastEditedBy': + echo zget($users, $case->lastEditedBy, $case->lastEditedBy); + break; + case 'lastEditedDate': + echo substr($case->lastEditedDate, 5, 11); + break; case 'lastRunner': echo zget($users, $case->lastRunner, $case->lastRunner); break; diff --git a/module/testtask/model.php b/module/testtask/model.php index 6b4a06f3e0..200ec43d55 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1158,6 +1158,15 @@ class testtaskModel extends model case 'status': echo ($run->version < $run->caseVersion) ? "{$this->lang->testcase->changed}" : $this->lang->testtask->statusList[$run->status]; break; + case 'precondition': + echo $run->precondition; + break; + case 'keywords': + echo $run->keywords; + break; + case 'version': + echo $run->version; + break; case 'openedBy': $openedBy = zget($users, $run->openedBy, $run->openedBy); echo substr($openedBy, strpos($openedBy, ':') + 1); @@ -1165,6 +1174,18 @@ class testtaskModel extends model case 'openedDate': echo substr($run->openedDate, 5, 11); break; + case 'reviewedBy': + echo zget($users, $run->reviewedBy, $run->reviewedBy); + break; + case 'reviewedDate': + echo substr($run->reviewedDate, 5, 11); + break; + case 'lastEditedBy': + echo zget($users, $run->lastEditedBy, $run->lastEditedBy); + break; + case 'lastEditedDate': + echo substr($run->lastEditedDate, 5, 11); + break; case 'lastRunner': $lastRunner = zget($users, $run->lastRunner, $run->lastRunner); echo substr($lastRunner, strpos($lastRunner, ':') + 1); From 912548e494c3fa87683466914c41534c06c68b9e Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 16 Oct 2017 16:52:10 +0800 Subject: [PATCH 2/9] * Add update sql. --- db/update9.5.1.sql | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 db/update9.5.1.sql diff --git a/db/update9.5.1.sql b/db/update9.5.1.sql new file mode 100644 index 0000000000..88c7cd1fdb --- /dev/null +++ b/db/update9.5.1.sql @@ -0,0 +1,29 @@ +-- DROP TABLE IF EXISTS `zt_entry`; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- DROP TABLE IF EXISTS `zt_webhook`; +CREATE TABLE IF NOT EXISTS `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `requestType` enum('post', 'get') NOT NULL DEFAULT 'get', + `params` text NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; From 735f0ad1d18e63ee586b31ab79b4a4146bad7310 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 17 Oct 2017 14:04:11 +0800 Subject: [PATCH 3/9] * fix task #3254. --- module/company/view/browse.html.php | 2 +- module/datatable/control.php | 31 ++++++++++++++++++++++- module/datatable/lang/zh-cn.php | 2 ++ module/datatable/view/ajaxcustom.html.php | 1 + 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/module/company/view/browse.html.php b/module/company/view/browse.html.php index 3223d9d404..04d2cf8649 100644 --- a/module/company/view/browse.html.php +++ b/module/company/view/browse.html.php @@ -94,7 +94,7 @@ js::set('confirmDelete', $lang->user->confirmDelete); - +
app->user->account; - $name = 'owner=' . $account . '&module=datatable§ion=' . $module . ucfirst($method) . '&key=cols'; + $target = $module . ucfirst($method); + $mode = isset($this->config->datatable->$target->mode) ? $this->config->datatable->$target->mode : 'table'; + $key = $mode == 'datatable' ? 'cols' : 'tablecols'; + $name = "owner=$account&module=datatable§ion=$target&key=$key"; + if($module == 'testtask') { $this->loadModel('testcase'); @@ -66,6 +70,9 @@ class datatable extends control $this->config->testcase->datatable->fieldList['actions']['width'] = '100'; } + $this->view->module = $module; + $this->view->method = $method; + $module = zget($this->config->datatable->moduleAlias, $module, $module); $this->view->cols = $this->datatable->getFieldList($module); $this->view->setting = $this->loadModel('setting')->getItem($name); @@ -73,4 +80,26 @@ class datatable extends control $this->display(); } + + /** + * Ajax reset cols + * + * @param string $module + * @param string $method + * @param string $confirm + * @access public + * @return void + */ + public function ajaxReset($module, $method, $confirm = 'no') + { + if($confirm == 'no') die(js::confirm($this->lang->datatable->confirmReset, inlink('ajaxReset', "module=$module&method=$method&confirm=yes"))); + + $account = $this->app->user->account; + $target = $module . ucfirst($method); + $mode = isset($this->config->datatable->$target->mode) ? $this->config->datatable->$target->mode : 'table'; + $key = $mode == 'datatable' ? 'cols' : 'tablecols'; + + $this->loadModel('setting')->deleteItems("owner=$account&module=datatable§ion=$target&key=$key"); + die(js::reload('parent')); + } } diff --git a/module/datatable/lang/zh-cn.php b/module/datatable/lang/zh-cn.php index bfbc7015d9..94b051d384 100644 --- a/module/datatable/lang/zh-cn.php +++ b/module/datatable/lang/zh-cn.php @@ -4,12 +4,14 @@ $lang->datatable->common = '数据表格'; $lang->datatable->width = '宽度'; $lang->datatable->show = '显示'; $lang->datatable->hide = '隐藏'; +$lang->datatable->reset = '恢复默认'; $lang->datatable->custom = '自定义列'; $lang->datatable->customTip = '勾选需要显示的列'; $lang->datatable->switchToTable = '切换到简单表格'; $lang->datatable->switchToDatatable = '切换到高级表格'; $lang->datatable->required = '必选'; +$lang->datatable->confirmReset = '是否恢复默认设置?'; $lang->datatable->branch = '分支'; $lang->datatable->platform = '平台'; diff --git a/module/datatable/view/ajaxcustom.html.php b/module/datatable/view/ajaxcustom.html.php index b55daf57ad..945fa25946 100644 --- a/module/datatable/view/ajaxcustom.html.php +++ b/module/datatable/view/ajaxcustom.html.php @@ -71,6 +71,7 @@
  + datatable->reset, 'hiddenwin', "class='btn btn-default'");?>
From 5f0c90a9231938d646b6d3be91660ac199538a6f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 17 Oct 2017 14:54:56 +0800 Subject: [PATCH 4/9] * fix for link story in plan for branch. --- module/action/model.php | 2 +- module/productplan/model.php | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 03f975328c..5f1a54b01d 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -53,7 +53,7 @@ class actionModel extends model /* Get product and project for this object. */ $productAndProject = $this->getProductAndProject($action->objectType, $objectID); $action->product = $productAndProject['product']; - $action->project = $productAndProject['project']; + $action->project = (int)$productAndProject['project']; $this->dao->insert(TABLE_ACTION)->data($action)->autoCheck()->exec(); $actionID = $this->dbh->lastInsertID(); diff --git a/module/productplan/model.php b/module/productplan/model.php index 0515da1666..029ebbd53a 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -241,20 +241,28 @@ class productplanModel extends model { $this->loadModel('story'); $this->loadModel('action'); + + $stories = $this->story->getByList($this->post->stories); + $plan = $this->getByID($planID); + foreach($this->post->stories as $storyID) { - if($this->session->currentProductType == 'normal') + if(!isset($stories[$storyID])) continue; + $story = $stories[$storyID]; + + if($this->session->currentProductType == 'normal' or $story->branch != 0 or empty($story->plan)) { $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->exec(); } else { - $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->andWhere('branch')->ne('0')->exec(); - $this->dao->update(TABLE_STORY)->set("plan=CONCAT(plan, ',', $planID)")->where('id')->eq((int)$storyID)->andWhere('branch')->eq('0')->exec(); + $plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('id')->in($story->plan)->fetchPairs('branch', 'id'); + $plans[$plan->branch] = $planID; + $this->dao->update(TABLE_STORY)->set("plan")->eq(join(',', $plans))->where('id')->eq((int)$storyID)->andWhere('branch')->eq('0')->exec(); } $this->action->create('story', $storyID, 'linked2plan', '', $planID); $this->story->setStage($storyID); - } + } } /** From fe16db7484650052a23528227915ce321bac24ab Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 18 Oct 2017 16:53:33 +0800 Subject: [PATCH 5/9] =?UTF-8?q?Finish=20task#3247=20=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=AE=9A=E4=B9=89=E6=89=80?= =?UTF-8?q?=E6=9C=89=E4=BA=BA=E7=94=A8=E7=9A=84=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=B8=83=E5=B1=80=E3=80=82,cost:5=20left:0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/common/view/datatable.fix.html.php | 14 ++++++---- module/common/view/datatable.html.php | 7 ++--- module/datatable/control.php | 29 ++++++++++++-------- module/datatable/lang/en.php | 4 +++ module/datatable/lang/zh-cn.php | 2 ++ module/datatable/model.php | 7 +++-- module/datatable/view/ajaxcustom.html.php | 32 ++++++++++++++++++----- 7 files changed, 67 insertions(+), 28 deletions(-) diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index 31d1f0b871..0d9f8abd03 100644 --- a/module/common/view/datatable.fix.html.php +++ b/module/common/view/datatable.fix.html.php @@ -9,17 +9,19 @@