From ddf2014f105d5bf7c3e4507d69e6c72cd66f209d Mon Sep 17 00:00:00 2001
From: reneeteng
Please backup your database before updating ZenTao!
1. Use phpMyAdmin to backup. 2. Use mysqlCommand to backup. @@ -36,11 +36,11 @@ $lang->upgrade->setStatusFile = 'Please finish the following actionsOr delete "%s" and create ok.txt and leave it blank.
I have read and done as instructed above. Continue upgrading.
'; -$lang->upgrade->selectVersion = 'Select Version'; +$lang->upgrade->selectVersion = 'Version'; $lang->upgrade->continue = 'Continue'; $lang->upgrade->noteVersion = "Select the compatible version, or it might cause data loss."; $lang->upgrade->fromVersion = 'From'; -$lang->upgrade->toVersion = 'Upgrade to'; +$lang->upgrade->toVersion = 'To'; $lang->upgrade->confirm = 'Confirm SQL'; $lang->upgrade->sureExecute = 'Execute'; $lang->upgrade->forbiddenExt = 'Extension is not compatible with the version. It has been deactivated:'; From c2121de201788d7b24e459cb791fd6bea07d0ddc Mon Sep 17 00:00:00 2001 From: YagamiDate: Wed, 20 Feb 2019 10:47:06 +0800 Subject: [PATCH 2/7] * Finish task #5267. --- module/testcase/control.php | 7 +++--- module/testcase/lang/en.php | 1 + module/testcase/lang/zh-cn.php | 1 + module/testcase/model.php | 36 +++++++++++++++++++++++++++++- module/testcase/view/edit.html.php | 1 + 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index ec65893fe0..b1017e7134 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -593,9 +593,10 @@ class testcase extends control $title = "CASE #$case->id $case->title - " . $libraries[$case->lib]; $position[] = html::a($this->createLink('testsuite', 'library', "libID=$case->lib"), $libraries[$case->lib]); - $this->view->libID = $case->lib; - $this->view->libName = $libraries[$case->lib]; - $this->view->libraries = $libraries; + $this->view->libID = $case->lib; + $this->view->libName = $libraries[$case->lib]; + $this->view->libraries = $libraries; + $this->view->linkedCaseID = $this->testcase->getLinkedCaseID($case->lib, $caseID); $this->view->moduleOptionMenu = $this->tree->getOptionMenu($case->lib, $viewType = 'caselib', $startModuleID = 0); } else diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index a89a21d2e9..d3d069d399 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -139,6 +139,7 @@ $lang->testcase->confirmDelete = 'Do you want to delete this Test Case?'; $lang->testcase->confirmBatchDelete = 'Do you want to batch delete these Test Cases?'; $lang->testcase->ditto = 'Ditto'; $lang->testcase->dittoNotice = 'This Case does not belong to the Product as the previous one!'; +$lang->testcase->haveLinkCase = 'It has linked case, update this one, the linked case will change.'; $lang->testcase->reviewList[0] = 'NO'; $lang->testcase->reviewList[1] = 'YES'; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 8983c59994..faef133b49 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -139,6 +139,7 @@ $lang->testcase->confirmDelete = '您确认要删除该测试用例吗?'; $lang->testcase->confirmBatchDelete = '您确认要批量删除这些测试用例吗?'; $lang->testcase->ditto = '同上'; $lang->testcase->dittoNotice = '该用例与上一用例不属于同一产品!'; +$lang->testcase->haveLinkCase = '此用例存在相关用例,更新后,其相关用例会一并更新。'; $lang->testcase->reviewList[0] = '否'; $lang->testcase->reviewList[1] = '是'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 382b597292..1a94ceb3a9 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -604,6 +604,24 @@ class testcaseModel extends model return $caseCounts; } + /** + * Check have imported cases or not. + * + * @param int $libID + * @param int $caseID$ + * @access public + * @return int + */ + public function getLinkedCaseID($libID, $caseID) + { + $linkedCaseID = $this->dao->select('id')->from(TABLE_CASE) + ->where('lib')->eq($libID) + ->andWhere('fromCaseID')->eq($caseID) + ->andWhere('deleted')->eq(0) + ->fetch('id'); + return $linkedCaseID; + } + /** * Update a case. * @@ -613,7 +631,10 @@ class testcaseModel extends model */ public function update($caseID) { - $oldCase = $this->getById($caseID); + $oldCase = $this->getById($caseID); + $isLibCase = ($oldCase->lib and empty($oldCase->product)); + $linkedCases = ''; + if($isLibCase) $linkedCases = $this->dao->select('id')->from(TABLE_CASE)->where('fromCaseID')->eq($caseID)->fetchPairs(); if(!empty($_POST['lastEditedDate']) and $oldCase->lastEditedDate != $this->post->lastEditedDate) { dao::$errors[] = $this->lang->error->editedByOther; @@ -666,6 +687,10 @@ class testcaseModel extends model ->get(); if(!$this->forceNotReview() and $stepChanged) $case->status = 'wait'; $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->edit->requiredFields, 'notempty')->where('id')->eq((int)$caseID)->exec(); + if($isLibCase and $linkedCases) + { + foreach($linkedCases as $linkedCaseID) $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->edit->requiredFields, 'notempty')->where('id')->eq((int)$linkedCaseID)->exec(); + } if(!$this->dao->isError()) { if($stepChanged) @@ -685,6 +710,15 @@ class testcaseModel extends model $this->dao->insert(TABLE_CASESTEP)->data($step)->autoCheck()->exec(); if($step->type == 'group') $parentStepID = $this->dao->lastInsertID(); if($step->type == 'step') $parentStepID = 0; + + if($isLibCase and $linkedCases) + { + foreach($linkedCases as $linkedCaseID) + { + $step->case = $linkedCaseID; + $this->dao->insert(TABLE_CASESTEP)->data($step)->autoCheck()->exec(); + } + } } } diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 16478f6e1e..5a561e7418 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -125,6 +125,7 @@ lastEditedDate);?> createLink('testcase', 'browse', "productID=$productID");?>"' /> + ' . $lang->testcase->haveLinkCase . ''; ?> From 1480e324af786fcfae02b596803b6205239c066f Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 20 Feb 2019 10:47:39 +0800 Subject: [PATCH 3/7] * Change the note. --- module/testcase/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index 1a94ceb3a9..e9b095e2ec 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -605,7 +605,7 @@ class testcaseModel extends model } /** - * Check have imported cases or not. + * Check have linked cases or not. * * @param int $libID * @param int $caseID$ From b7651df91ead760bb24dbf4960e271f2e12a852d Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 20 Feb 2019 10:52:47 +0800 Subject: [PATCH 4/7] * Finish task #5268. --- module/doc/view/browse.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index a390fffaeb..faeb47261b 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -49,8 +49,8 @@ var browseType = ''; " . $this->lang->doc->create, '', "class='btn btn-primary'");?> From 8f3604ec7ccc4b3b7d31bfe3cf3b48030f495495 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 20 Feb 2019 13:46:33 +0800 Subject: [PATCH 5/7] * Finish task #5270. --- module/project/view/bug.html.php | 2 +- module/testtask/control.php | 1 + module/testtask/view/create.html.php | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index b829eb0506..543809d370 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -100,7 +100,7 @@ id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'check', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); common::printIcon('bug', 'edit', $params, $bug, 'list'); diff --git a/module/testtask/control.php b/module/testtask/control.php index fb6e695005..ca2336527a 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -169,6 +169,7 @@ class testtask extends control if($projectID != 0) { + $this->app->loadLang('build'); $this->view->products = $products; $this->view->projectID = $projectID; } diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index bb2a1455ac..f7c677c022 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -40,7 +40,15 @@ testtask->build;?> -+ + + + + build->create, '', "data-toggle='modal' data-type='iframe' data-width='95%'")?> ++refresh, '', "class='refresh' onclick='loadProjectBuilds($projectID)'");?>+ +From 75c0f11b4f9a3806aab2874635fa756467866da9 Mon Sep 17 00:00:00 2001 From: Yagami -Date: Wed, 20 Feb 2019 13:59:05 +0800 Subject: [PATCH 6/7] * Finish task #5272. --- module/story/view/view.html.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index ce2a273682..6f2838017e 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -322,8 +322,8 @@ - story->legendBugs;?> ++ -story->legendBugs;?>
- story->legendCases;?> ++ -story->legendCases;?>
- story->legendLinkStories;?> ++ -story->legendLinkStories;?>
- story->legendChildStories;?> ++ story->legendChildStories;?> Date: Wed, 20 Feb 2019 14:27:38 +0800 Subject: [PATCH 7/7] * Add autocomplete to front class. --- lib/front/front.class.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 91641384f4..04ed5837b8 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -39,6 +39,26 @@ class html extends baseHTML return parent::a($href, $title, $misc, $newline); } + /** + * 生成input输入标签。 + * Create tags like "" + * + * @param string $name the name of the text input tag. + * @param string $value the default value. + * @param string $attrib other attribs. + * @static + * @access public + * @return string + */ + static public function input($name, $value = "", $attrib = "", $autocomplete = false) + { + $id = "id='$name'"; + if(strpos($attrib, 'id=') !== false) $id = ''; + $value = str_replace("'", ''', $value); + $autocomplete = $autocomplete ? 'autocomplete="on"' : 'autocomplete="off"'; + return "\n"; + } + /** * 生成多选按钮。 * Create tags like ""