From 403e75c9748bc7c93c40ed13343ec5b687739074 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 10:30:06 +0800 Subject: [PATCH 1/7] * fix bug #942. --- module/custom/control.php | 7 +++++-- module/custom/lang/en.php | 10 ++++++---- module/custom/lang/zh-cn.php | 10 ++++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/module/custom/control.php b/module/custom/control.php index d1048e3fc0..f952e328a3 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -88,8 +88,11 @@ class custom extends control $value = $_POST['values'][$index]; $system = $_POST['systems'][$index]; - //Fix bug #951. - //if(!$system and (!$value or !$key)) continue; + //if(!$system and (!$value or !$key)) continue; //Fix bug #951. + + /* Fix bug #942. */ + if($field == 'priList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->priListKey)); + if($module == 'bug' and $field == 'severityList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->severityListKey)); /* the length of role is 20, check it when save. */ if($module == 'user' and $field == 'roleList' and strlen($key) > 20) die(js::alert($this->lang->custom->notice->userRole)); diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 659759db6e..61b233a36b 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -69,10 +69,12 @@ $lang->custom->allLang = 'All Language'; $lang->custom->confirmRestore = 'Do you want to reset to Default?'; $lang->custom->notice = new stdclass(); -$lang->custom->notice->userRole = 'Key must be no more than 20 characters!'; -$lang->custom->notice->canNotAdd = 'This item will be processed, so customized feature is not enabled.'; -$lang->custom->notice->forceReview = 'Review is required for stories submitted by certain assignee.'; -$lang->custom->notice->longlife = 'List "Undone" bugs that are older than hold days from "Longlife" bugs.'; +$lang->custom->notice->userRole = 'Key must be no more than 20 characters!'; +$lang->custom->notice->canNotAdd = 'This item will be processed, so customized feature is not enabled.'; +$lang->custom->notice->forceReview = 'Review is required for stories submitted by certain assignee.'; +$lang->custom->notice->longlife = 'List "Undone" bugs that are older than hold days from "Longlife" bugs.'; +$lang->custom->notice->priListKey = 'Priority list key should be numbers!'; +$lang->custom->notice->severityListKey = 'Bug severity list key should be numbers.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Homepage. Do you want to enter Product Homepage?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Homepage. Do you want to enter Project Homepage?"; $lang->custom->notice->indexPage['qa'] = "ZenTao 8.2+ has Testing Homepage. Do you want to enter Testing Homepage?"; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 00b2aba1c4..a3860fdc60 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -69,10 +69,12 @@ $lang->custom->allLang = '适用所有语言'; $lang->custom->confirmRestore = '是否要恢复默认配置?'; $lang->custom->notice = new stdclass(); -$lang->custom->notice->userRole = '键的长度必须小于20个字符!'; -$lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能'; -$lang->custom->notice->forceReview = '指定人提交的需求必须评审。'; -$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。'; +$lang->custom->notice->userRole = '键的长度必须小于20个字符!'; +$lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能'; +$lang->custom->notice->forceReview = '指定人提交的需求必须评审。'; +$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。'; +$lang->custom->notice->priListKey = '优先级的键应当为数字!'; +$lang->custom->notice->severityListKey = 'Bug严重程度的键应当为数字!'; $lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?"; $lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?"; $lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?"; From fc2ea2d14e48e51c5c9cd8c7bc7b09246f34e4ef Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 11:05:34 +0800 Subject: [PATCH 2/7] * fix bug #940. --- module/testcase/view/showimport.html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php index dd0e6bb837..2113470642 100644 --- a/module/testcase/view/showimport.html.php +++ b/module/testcase/view/showimport.html.php @@ -51,14 +51,14 @@ testcase->typeList, !empty($case->type) ? $case->type : (!empty($case->id) ? $cases[$case->id]->type : ''), "class='form-control'")?> testcase->statusList, !empty($case->status) ? $case->status : (!empty($case->id) ? $cases[$case->id]->status : 'normal'), "class='form-control'")?> testcase->stageList, !empty($case->stage) ? $case->stage : (!empty($case->id) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?> - precondition) ? $case->precondition : "", "class='form-control'")?> + precondition) ? htmlspecialchars($case->precondition) : "", "class='form-control'")?> $desc):?> - - + +
From ef92422e71064a2d093482c15bbf73247c752f07 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 11:17:43 +0800 Subject: [PATCH 3/7] * fix bug #939. --- module/bug/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/bug/model.php b/module/bug/model.php index 80e39b2e9a..db9a72d2e1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -969,6 +969,7 @@ class bugModel extends model $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); + $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; //Fix bug #939. $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, 0, $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; if($this->session->currentProductType == 'normal') From 168e2131399f6afa79529fc86840121add3f3b77 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 13:35:15 +0800 Subject: [PATCH 4/7] * fix bug #934. --- module/task/model.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 6f1a8ec2f7..7817f8ff99 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -22,8 +22,8 @@ class taskModel extends model */ public function create($projectID) { - $tasksID = array(); - $taskFile = ''; + $tasksID = array(); + $taskFiles = array(); $this->loadModel('file'); $task = fixer::input('post') ->add('project', (int)$projectID) @@ -71,16 +71,19 @@ class taskModel extends model $taskID = $this->dao->lastInsertID(); if($this->post->story) $this->loadModel('story')->setStage($this->post->story); $this->file->updateObjectID($this->post->uid, $taskID, 'task'); - if(!empty($taskFile)) + if(!empty($taskFiles)) { - $taskFile->objectID = $taskID; - $this->dao->insert(TABLE_FILE)->data($taskFile)->exec(); + foreach($taskFiles as $taskFile) + { + $taskFile->objectID = $taskID; + $this->dao->insert(TABLE_FILE)->data($taskFile)->exec(); + } } else { $taskFileTitle = $this->file->saveUpload('task', $taskID); - $taskFile = $this->dao->select('*')->from(TABLE_FILE)->where('id')->eq(key($taskFileTitle))->fetch(); - unset($taskFile->id); + $taskFiles = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in(array_keys($taskFileTitle))->fetchAll('id'); + foreach($taskFiles as $fileID => $taskFile) unset($taskFiles[$fileID]->id); } $tasksID[$assignedTo] = array('status' => 'created', 'id' => $taskID); } From 59332be052453cf237d3062a483e7fe8518b21e6 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 15:14:57 +0800 Subject: [PATCH 5/7] * fix bug #868. --- module/story/control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/story/control.php b/module/story/control.php index 7e2a3e96f5..204b75f5af 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1364,10 +1364,12 @@ class story extends control $story->spec = htmlspecialchars_decode($story->spec); $story->spec = str_replace("
", "\n", $story->spec); $story->spec = str_replace('"', '""', $story->spec); + $story->spec = str_replace(' ', ' ', $story->spec); $story->verify = htmlspecialchars_decode($story->verify); $story->verify = str_replace("
", "\n", $story->verify); $story->verify = str_replace('"', '""', $story->verify); + $story->verify = str_replace(' ', ' ', $story->verify); } /* fill some field with useful value. */ if(isset($products[$story->product])) $story->product = $products[$story->product] . "(#$story->product)"; From 0c83443ba2bce2772b2890149b988707b5e4677e Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 15:30:42 +0800 Subject: [PATCH 6/7] * fix bug #895. --- module/testcase/model.php | 1 + module/testcase/view/showimport.html.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/module/testcase/model.php b/module/testcase/model.php index ce63c620db..02885e59dc 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -800,6 +800,7 @@ class testcaseModel extends model $caseData->type = $data->type[$key]; $caseData->status = $data->status[$key]; $caseData->stage = join(',', $data->stage[$key]); + $caseData->keywords = $data->keywords[$key]; $caseData->frequency = 1; $caseData->precondition = $data->precondition[$key]; diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php index 2113470642..0272e87649 100644 --- a/module/testcase/view/showimport.html.php +++ b/module/testcase/view/showimport.html.php @@ -14,6 +14,7 @@ testcase->type?> testcase->status?> testcase->stage?> + testcase->keywords?> testcase->precondition?> @@ -51,6 +52,7 @@ +
testcase->typeList, !empty($case->type) ? $case->type : (!empty($case->id) ? $cases[$case->id]->type : ''), "class='form-control'")?> testcase->statusList, !empty($case->status) ? $case->status : (!empty($case->id) ? $cases[$case->id]->status : 'normal'), "class='form-control'")?> testcase->stageList, !empty($case->stage) ? $case->stage : (!empty($case->id) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?>keywords) ? $case->keywords : "", "class='form-control'")?> precondition) ? htmlspecialchars($case->precondition) : "", "class='form-control'")?> From 84cf016837d183d6bbfeb620216c95c6739a3897 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 23 Dec 2016 16:23:20 +0800 Subject: [PATCH 7/7] * fix bug #878. --- module/search/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/search/model.php b/module/search/model.php index fd22b3b8f4..2381c2d8a0 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -193,7 +193,7 @@ class searchModel extends model if($hasUser) { - $users = $this->loadModel('user')->getPairs('realname'); + $users = $this->loadModel('user')->getPairs('realname|noclosed'); $users['$@me'] = $this->lang->search->me; } if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs();