From fbdc9624fcfd2267ef9cc00f4a78a34114f778d2 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Sat, 10 Oct 2020 09:11:12 +0800 Subject: [PATCH 13/19] * Fix bug#3549. --- module/block/lang/zh-cn.php | 2 +- module/block/lang/zh-tw.php | 2 +- module/block/view/dashboard.html.php | 2 +- module/testtask/lang/zh-cn.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index eada6929c1..fc1584c16f 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -43,7 +43,7 @@ $lang->block->myBug = '我的BUG'; $lang->block->myProject = '未关闭的' . $lang->projectCommon; $lang->block->myProduct = '未关闭的' . $lang->productCommon; $lang->block->delayed = '已延期'; -$lang->block->noData = '当前统计类型下暂无数据'; +$lang->block->noData = '当前统计类型下暂无数据。'; $lang->block->emptyTip = '暂无信息'; $lang->block->params = new stdclass(); diff --git a/module/block/lang/zh-tw.php b/module/block/lang/zh-tw.php index 245e9068d1..be98789b84 100644 --- a/module/block/lang/zh-tw.php +++ b/module/block/lang/zh-tw.php @@ -43,7 +43,7 @@ $lang->block->myBug = '我的BUG'; $lang->block->myProject = '未關閉的' . $lang->projectCommon; $lang->block->myProduct = '未關閉的' . $lang->productCommon; $lang->block->delayed = '已延期'; -$lang->block->noData = '當前統計類型下暫無數據'; +$lang->block->noData = '當前統計類型下暫無數據。'; $lang->block->emptyTip = '暫無信息'; $lang->block->params = new stdclass(); diff --git a/module/block/view/dashboard.html.php b/module/block/view/dashboard.html.php index 9e5d990734..548e5dd789 100644 --- a/module/block/view/dashboard.html.php +++ b/module/block/view/dashboard.html.php @@ -21,7 +21,7 @@ $useGuest = $this->app->user->account == 'guest';

- block->noData. ',';?> + block->noData;?> createLink("block", "admin", "id=0&module=$module"), " {$lang->block->createBlock}", '', "data-toggle='modal' data-type='ajax' data-width='700' data-title='{$lang->block->createBlock}' class='btn btn-info'")?> createLink("block", "ajaxReset", "module=$module"), " {$lang->block->reset}", 'hiddenwin', 'class="btn btn-info"')?>

diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 3aa542985c..06dae20fce 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -123,7 +123,7 @@ $lang->testtask->showFail = '失败%s次'; $lang->testtask->confirmDelete = '您确认要删除该测试单吗?'; $lang->testtask->confirmUnlinkCase = '您确认要移除该用例吗?'; $lang->testtask->noticeNoOther = '该产品还没有其他测试单'; -$lang->testtask->noTesttask = '暂时没有测试单'; +$lang->testtask->noTesttask = '暂时没有测试单。'; $lang->testtask->checkLinked = '请检查测试单的产品是否与项目相关联'; $lang->testtask->noImportData = '导入的XML没有解析出数据。'; $lang->testtask->unitXMLFormat = '请选择Junit XML 格式的文件。'; From 443bbd0cefae4881eb2aca649c5a30bbc824ead6 Mon Sep 17 00:00:00 2001 From: z Date: Sat, 10 Oct 2020 09:29:18 +0800 Subject: [PATCH 14/19] * finish task #8069. --- www/js/zui/lang.ja.min.js | 6 ++---- www/tip4japanese.html | 40 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 www/tip4japanese.html diff --git a/www/js/zui/lang.ja.min.js b/www/js/zui/lang.ja.min.js index ea42f28494..ebc270c49c 100644 --- a/www/js/zui/lang.ja.min.js +++ b/www/js/zui/lang.ja.min.js @@ -1,4 +1,2 @@ -alert('日语是收费功能,需要购买插件安装'); -$.cookie('lang', 'zh-cn', {expires:config.cookieLife, path:config.webRoot}); -location.href = location.href; - +var locateLink = config.webRoot + 'tip4japanese.html'; +if(location.href.indexOf(locateLink) < 0) location.href = locateLink; diff --git a/www/tip4japanese.html b/www/tip4japanese.html new file mode 100644 index 0000000000..83a3c93894 --- /dev/null +++ b/www/tip4japanese.html @@ -0,0 +1,40 @@ + + + + + + + + グリッド・リサーチ株式会社に完全日本語使用権を取得ください + + + +
+
グリッド・リサーチ株式会社に完全日本語使用権を取得ください
+
+

〒104-0041 東京都中央区新富1-15-11 マキプラザ 3階

+

電話:03-3537-9700(代表)

+

MailTo:sales1@grids.co.jp

+
+
+ Language : + 简体 + 繁體 + English + Deutsch + Français + Tiếng Việt +
+
+ + + From 75a7aecc3ef8f5201d92888d82e9e6340f94f92a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Sat, 10 Oct 2020 09:43:44 +0800 Subject: [PATCH 15/19] * Finish task #8056. --- module/bug/js/common.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 6fbbfead07..281a2b90d7 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -112,16 +112,17 @@ function loadAllBuilds(object) { productID = $('#product').val(); projectID = $('#project').val(); - if(page == 'edit') buildBox = $(object).closest('.input-group').attr('id'); + var buildBox = ''; + if(page == 'edit') buildBox = $(object).closest('.input-group').attr('id'); if(projectID) { - loadAllProjectBuilds(projectID, productID); + loadAllProjectBuilds(projectID, productID, buildBox); } else { - loadAllProductBuilds(productID); + loadAllProductBuilds(productID, buildBox); } } } @@ -131,10 +132,11 @@ function loadAllBuilds(object) * * @param int $projectID * @param int $productID + * @param string $buildBox * @access public * @return void */ -function loadAllProjectBuilds(projectID, productID) +function loadAllProjectBuilds(projectID, productID, buildBox) { branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; @@ -171,10 +173,11 @@ function loadAllProjectBuilds(projectID, productID) * Load all builds of the product. * * @param int $productID + * @param string $buildBox * @access public * @return void */ -function loadAllProductBuilds(productID) +function loadAllProductBuilds(productID, buildBox) { branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; From 26818e8814cc8c2cde9831773db9ebee9728ffff Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Sat, 10 Oct 2020 09:44:18 +0800 Subject: [PATCH 16/19] * Edit comment. --- module/bug/js/create.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/bug/js/create.js b/module/bug/js/create.js index 09c3db92e3..ef99c2840f 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -22,7 +22,7 @@ function loadAllUsers() /** * Load team members of the latest project of a product as assignedTo list. * - * @param $productID + * @param int $productID * @access public * @return void */ @@ -33,7 +33,7 @@ function loadProjectTeamMembers(productID) } /** - * load assignedTo and stories of module. + * Load assignedTo and stories of module. * * @access public * @return void @@ -50,6 +50,8 @@ function loadModuleRelated() /** * Set the assignedTo field. * + * @param int $moduleID + * @param int $productID * @access public * @return void */ From 896c57edba5ccfa232341775013d3fd5c3ca6e08 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Sat, 10 Oct 2020 11:23:37 +0800 Subject: [PATCH 17/19] * Edit comment. --- module/bug/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index 0a7afd1dc7..a3e1d0264b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -366,7 +366,7 @@ class bug extends control $pri = 3; $color = ''; - /* Parse the extras. extract fix php7.2*/ + /* Parse the extras. extract fix php7.2. */ $extras = str_replace(array(',', ' '), array('&', ''), $extras); parse_str($extras, $output); extract($output); From 2ae42d3d16d51e95da0e25bfa6d8a791676a7020 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Sat, 10 Oct 2020 16:38:17 +0800 Subject: [PATCH 18/19] * Fix bug#3544. --- module/testreport/control.php | 8 ++++---- module/testreport/model.php | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/module/testreport/control.php b/module/testreport/control.php index 921202ba7c..5ff4d006cd 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -445,7 +445,7 @@ class testreport extends control $tasks = $report->tasks ? $this->testtask->getByList($report->tasks) : array();; $builds = $report->builds ? $this->build->getByList($report->builds) : array(); $cases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end, $report->cases, $pager); - $totalCases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end, $report->cases); + $caseIdList = $this->testreport->getCaseIdList($reportID); $bugInfo = $this->testreport->getBugInfo($tasks, $report->product, $report->begin, $report->end, $builds); if($report->objectType == 'testtask') @@ -473,10 +473,10 @@ class testreport extends control $this->view->actions = $this->loadModel('action')->getList('testreport', $reportID); $this->view->storySummary = $this->product->summary($stories); - $this->view->caseSummary = $this->testreport->getResultSummary($tasks, $totalCases, $report->begin, $report->end); + $this->view->caseSummary = $this->testreport->getResultSummary($tasks, $caseIdList, $report->begin, $report->end); - $perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $totalCases, $report->begin, $report->end); - $perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $totalCases, $report->begin, $report->end); + $perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $caseIdList, $report->begin, $report->end); + $perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $caseIdList, $report->begin, $report->end); $this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult); $this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner); diff --git a/module/testreport/model.php b/module/testreport/model.php index ea247232d0..5e9f74a0b1 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -362,6 +362,24 @@ class testreportModel extends model return $cases; } + /** + * Get caseID list. + * + * @param int $reportID + * @access public + * @return void + */ + public function getCaseIdList($reportID) + { + $caseIdList = $this->dao->select('`case`')->from(TABLE_TESTREPORT)->alias('t1') + ->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.tasks=t2.task') + ->where('t1.id')->eq($reportID) + ->andWhere('t1.deleted')->eq(0) + ->fetchPairs('case'); + + return $caseIdList; + } + /** * Get result summary. * @@ -409,6 +427,7 @@ class testreportModel extends model ->leftJoin(TABLE_TESTRUN)->alias('t2') ->on('t1.run= t2.id') ->where('t2.task')->in(array_keys($tasks)) + ->andwhere('t1.date = t2.lastRunDate') ->andWhere('t1.`case`')->in(array_keys($cases)) ->andWhere('t1.date')->ge($begin) ->andWhere('t1.date')->le($end . " 23:59:59") @@ -440,6 +459,7 @@ class testreportModel extends model ->leftJoin(TABLE_TESTRUN)->alias('t2') ->on('t1.run= t2.id') ->where('t2.task')->in(array_keys($tasks)) + ->andwhere('t1.date = t2.lastRunDate') ->andWhere('t1.`case`')->in(array_keys($cases)) ->andWhere('t1.date')->ge($begin) ->andWhere('t1.date')->le($end . " 23:59:59") From 294b3e0ccfec958e4979af03d32d8f8f845de29b Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Sat, 10 Oct 2020 16:55:47 +0800 Subject: [PATCH 19/19] * Add notes. --- module/bug/model.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 3c48c66211..f7a0e6157e 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -129,7 +129,7 @@ class bugModel extends model * * @param string $from object that is transfered to bug. * @access public - * @return int|bool + * @return array|bool */ public function create($from = '') { @@ -177,17 +177,19 @@ class bugModel extends model * Batch create * * @param int $productID + * @param int $branch * @access public * @return void */ public function batchCreate($productID, $branch = 0) { + /* Load module and init vars. */ $this->loadModel('action'); - $branch = (int)$branch; - $productID = (int)$productID; - $now = helper::now(); - $actions = array(); - $data = fixer::input('post')->get(); + $branch = (int)$branch; + $productID = (int)$productID; + $now = helper::now(); + $actions = array(); + $data = fixer::input('post')->get(); $result = $this->loadModel('common')->removeDuplicate('bug', $data, "product={$productID}"); $data = $result['data']; @@ -220,8 +222,10 @@ class bugModel extends model $data->browsers[$i] = $browser; } + /* If there are images to upload, load the file module. */ if(isset($data->uploadImage)) $this->loadModel('file'); $extendFields = $this->getFlowExtendFields(); + $bugs = array(); foreach($data->title as $i => $title) { @@ -246,6 +250,7 @@ class bugModel extends model $bug->browser = $data->browsers[$i]; $bug->keywords = $data->keywords[$i]; + /* Assign the bug to the person in charge of the module. */ if(!empty($moduleOwners[$bug->module])) { $bug->assignedTo = $moduleOwners[$bug->module]; @@ -259,6 +264,7 @@ class bugModel extends model if($message) die(js::alert($message)); } + /* Required field check. */ foreach(explode(',', $this->config->bug->create->requiredFields) as $field) { $field = trim($field); @@ -268,6 +274,7 @@ class bugModel extends model $bugs[$i] = $bug; } + /* When the bug is created by uploading an image, add the image to the step of the bug. */ foreach($bugs as $i => $bug) { if(!empty($data->uploadImage[$i])) @@ -305,6 +312,7 @@ class bugModel extends model $this->executeHooks($bugID); + /* When the bug is created by uploading the image, add the image to the file of the bug. */ $this->loadModel('score')->create('bug', 'create', $bugID); if(!empty($data->uploadImage[$i]) and !empty($file)) {