From fe3f85b4107e38864f7c53aee748d15587b9cec9 Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Wed, 16 Feb 2022 14:52:00 +0800 Subject: [PATCH 001/181] * Fix bug #19365. --- module/story/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index baa1d04c68..0df764b5de 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -245,7 +245,7 @@ status == 'closed'):?> story->duplicateStory;?> - duplicateStory, "class='form-control'");?> + duplicateStory == 0 ? "" : $story->duplicateStory, "class='form-control'");?> status == 'closed'):?> From 06dcb591383a37eede5389539f2ea712c3df3110 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 25 Mar 2022 01:22:21 +0000 Subject: [PATCH 002/181] * Fix bug #18307. --- module/program/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/program/view/edit.html.php b/module/program/view/edit.html.php index 397f6a5843..190f843ffe 100644 --- a/module/program/view/edit.html.php +++ b/module/program/view/edit.html.php @@ -101,7 +101,7 @@ whitelist;?>
- whitelist, 'class="form-control chosen" multiple');?> + whitelist, 'class="form-control chosen" multiple data-drop_direction="up"');?> fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
From dd2460d8edc5579e5fa8e3a67411b300d90670c7 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 6 Apr 2022 13:40:32 +0800 Subject: [PATCH 003/181] * Fix bug for edit project. --- extension/lite/project/ext/view/edit.lite.html.hook.php | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 extension/lite/project/ext/view/edit.lite.html.hook.php diff --git a/extension/lite/project/ext/view/edit.lite.html.hook.php b/extension/lite/project/ext/view/edit.lite.html.hook.php deleted file mode 100644 index 294fb97412..0000000000 --- a/extension/lite/project/ext/view/edit.lite.html.hook.php +++ /dev/null @@ -1,3 +0,0 @@ - From 84879b6230e910951341219fa5dfbe5da8a39243 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Wed, 6 Apr 2022 15:22:45 +0800 Subject: [PATCH 004/181] * fix bug add install lite version text --- extension/lite/install/ext/lang/en/lite.php | 2 +- extension/lite/install/ext/lang/zh-cn/lite.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/lite/install/ext/lang/en/lite.php b/extension/lite/install/ext/lang/en/lite.php index 1b618e860b..fa555ca7cc 100644 --- a/extension/lite/install/ext/lang/en/lite.php +++ b/extension/lite/install/ext/lang/en/lite.php @@ -19,7 +19,7 @@ Facebook: Easy Twitter: ZenTao Lite - +You are installing ZenTao %s. EOT; $lang->install->successLabel = "

You have installed ZenTao Lite %s.

"; diff --git a/extension/lite/install/ext/lang/zh-cn/lite.php b/extension/lite/install/ext/lang/zh-cn/lite.php index 4b0a59ab1a..40e0c890e3 100644 --- a/extension/lite/install/ext/lang/zh-cn/lite.php +++ b/extension/lite/install/ext/lang/zh-cn/lite.php @@ -13,7 +13,7 @@ $lang->install->links = <<https://weibo.com/easysoft - +您现在正在安装的版本是 %s。 EOT; $lang->install->successLabel = "

您已经成功安装禅道迅捷版%s。

"; From 0f6c3176e77d16b947f15b49feb39e4d53d9f87b Mon Sep 17 00:00:00 2001 From: chaideqing Date: Thu, 7 Apr 2022 09:03:43 +0800 Subject: [PATCH 005/181] * fix show ... when text too long in xuanxuan card --- module/productplan/css/x.view.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/css/x.view.css b/module/productplan/css/x.view.css index 63f306b45c..ed93fc1ed9 100644 --- a/module/productplan/css/x.view.css +++ b/module/productplan/css/x.view.css @@ -7,7 +7,7 @@ .tab-btn-container {width: 100%; background-color: #f2f2f2;} .tab-btn-container ul {padding-left: 200px;;} .tab-btn-container ul li {list-style: none;} -.plan-title {position: absolute; top: 0; left: 0; padding: 8px 15px; font-weight: bolder; width: 200px;} +.plan-title {position: absolute; top: 0; left: 0; padding: 8px 15px; font-weight: bolder; width: 200px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden} .tab-btn-container ul li.active span {display: inline-block;} .linkButton {position: absolute; right: 0; top: 0; padding-right: 10px; cursor: pointer;} .linkButton i {font-size: 18px !important;} From 8ce69bb012d8da3d530e66b0e4a96b990b500f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Thu, 7 Apr 2022 11:00:15 +0800 Subject: [PATCH 006/181] * Code for project test. --- test/model/project/batchupdate.php | 32 ++++++++++++++ test/model/project/update.php | 68 ++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 test/model/project/batchupdate.php create mode 100644 test/model/project/update.php diff --git a/test/model/project/batchupdate.php b/test/model/project/batchupdate.php new file mode 100644 index 0000000000..9ea974fa51 --- /dev/null +++ b/test/model/project/batchupdate.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +batchUpdate(); +cid=1 +pid=1 + +*/ + +$project = new Project(); +$projectIdList = array(11, 12, 13); + +$data['names'] = array(11 => '批量修改项目11', 12 => '批量修改项目12', 13 => '批量修改项目13'); +$data['projectIdList'] = $projectIdList; +$data['PMs'] = array(11 => 'admin', 12 => '', 13 => ''); +$data['begins'] = array(11 => '2022-01-03', 12 => '2022-03-05', 13 => ''); +$data['ends'] = array(11 => '2022-03-03', 12 => '2022-06-05', 13 => '2022-07-11'); + +$name = array( '7' => '批量修改任务一'); +$type = array( '7' => 'devel'); +$statuses = array('7' =>'doing'); + +$normal = array('names' => $name, 'types' => $type,'statuses'=> $statuses); + +$task = new taskTest(); +r($task->batchUpdateObject($normal, $taskID)) && p('1:field,old,new') && e('name,开发任务17,批量修改任务一'); // 测试批量修改任务 +system("./ztest init"); diff --git a/test/model/project/update.php b/test/model/project/update.php new file mode 100644 index 0000000000..e342fb80d8 --- /dev/null +++ b/test/model/project/update.php @@ -0,0 +1,68 @@ +#!/usr/bin/env php +> 测试更新项目十 +当计划开始为空时更新项目信息 >> 『计划开始』不能为空。 +当计划完成为空时更新项目信息 >> 『计划完成』不能为空。 +当计划完成小于计划开始时 >> 『计划完成』应当大于『2020-10-10』。 +项目名称已经存在时 >> 『项目名称』已经有『项目1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 +项目开始时间小于父项目时 >> 父项目的开始日期:2019-09-09,开始日期不能小于父项目的开始日期;父项目的完成日期:2019-09-09,完成日期不能大于父项目的完成日期 + +*/ + +global $tester; +$tester->app->loadConfig('execution'); + +$project = new Project(); + +$data = array( + 'parent' => '0', + 'name' => '测试更新项目十', + 'begin' => '2020-10-10', + 'end' => '2022-06-01', + 'acl' => 'private', + 'budget' => '100', + 'budgetUnit' => 'CNY', + 'PM' => 'admin', + 'products' => array(1, 2, 3), + 'whitelist' => array('dev10', 'dev12') +); + +$normalProject = $data; + +$noProductProject = $data; +$noProductProject['products'] = array(); + +$emptyTitleProject = $data; +$emptyTitleProject['name'] = ''; + +$emptyBeginProject = $data; +$emptyBeginProject['begin'] = ''; + +$emptyEndProject = $data; +$emptyEndProject['end'] = ''; + +$beginGtEndProject = $data; +$beginGtEndProject['begin'] = '2022-07-01'; + +$beginLtParentProject = $data; +$beginLtParentProject['parent'] = '9'; +$beginLtParentProject['begin'] = '2019-01-01'; + +r($project->update(10, $normalProject)) && p('name') && e('测试更新项目十'); // 正常更新项目的情况 +r($project->update(10, $noProductProject)) && p('message:0') && e('最少关联一个产品'); // 未关联产品的项目 +r($project->update(10, $emptyTitleProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 更新项目名称为空时 +r($project->update(10, $emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目信息 +r($project->update(10, $emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 当计划完成小于计划开始时 +r($project->update(10, $beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-07-01』。'); // 父项目的开始日期大于子项目的开始日期时 +r($project->update(10, $beginLtParentProject)) && p('message:begin;message:end') && e('项目集的最小开始日期:2022-02-15,项目的开始日期不能小于项目集的最小开始日期;项目集的最大完成日期:2022-04-22,项目的完成日期不能大于项目集的最大完成日期'); // 项目开始、结束日期和子项目不符的情况 +system("./ztest init"); From 9065d0527eb64af16ff510fc1d9d07134cca6ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Thu, 7 Apr 2022 11:29:49 +0800 Subject: [PATCH 007/181] * Add upgrade logic. --- module/upgrade/config.php | 4 ++++ module/upgrade/control.php | 17 +++++++++++++++++ module/upgrade/lang/version.php | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/module/upgrade/config.php b/module/upgrade/config.php index fc5d01e5db..99613eb8fe 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -171,6 +171,10 @@ $config->upgrade->proVersion['pro10_3_1'] = '15_7_1'; $config->upgrade->proVersion['pro11_0_beta1'] = '16_0_beta1'; $config->upgrade->proVersion['pro11_0'] = '16_0'; +$config->upgrade->liteVersion = array(); +$config->upgrade->liteVersion['lite1_0'] = '16_5_beta1'; +$config->upgrade->liteVersion['lite1_1'] = '16_5'; + $config->upgrade->lowerTables = array(); $config->upgrade->lowerTables[$config->db->prefix . 'caseStep'] = $config->db->prefix . 'casestep'; $config->upgrade->lowerTables[$config->db->prefix . 'docLib'] = $config->db->prefix . 'doclib'; diff --git a/module/upgrade/control.php b/module/upgrade/control.php index 960f4aeb1c..e81435c209 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -82,6 +82,20 @@ class upgrade extends control { $version = str_replace(array(' ', '.'), array('', '_'), $this->config->installedVersion); $version = strtolower($version); + + if($this->config->visions == ',lite,') + { + $installedVersion = str_replace('.', '_', $this->config->installedVersion); + $version = array_search($installedVersion, $this->config->upgrade->liteVersion); + + foreach($this->lang->upgrade->fromVersions as $key => $value) + { + if(strpos($key, 'lite') === false) unset($this->lang->upgrade->fromVersions[$key]); + } + + $this->config->version = 'Lite' . $this->config->liteVersion; + } + $this->view->title = $this->lang->upgrade->common . $this->lang->colon . $this->lang->upgrade->selectVersion; $this->view->position[] = $this->lang->upgrade->common; $this->view->version = $version; @@ -96,6 +110,8 @@ class upgrade extends control */ public function confirm() { + if(strpos($this->post->fromVersion, 'lite') !== false) $this->post->fromVersion = $this->config->upgrade->liteVersion[$this->post->fromVersion]; + $this->session->set('step', ''); $this->view->title = $this->lang->upgrade->confirm; $this->view->position[] = $this->lang->upgrade->common; @@ -131,6 +147,7 @@ class upgrade extends control } $fromVersion = isset($_POST['fromVersion']) ? $this->post->fromVersion : $fromVersion; + if(strpos($fromVersion, 'lite') !== false) $fromVersion = $this->config->upgrade->liteVersion[$fromVersion]; $this->upgrade->execute($fromVersion); if(!$this->upgrade->isError()) diff --git a/module/upgrade/lang/version.php b/module/upgrade/lang/version.php index b8d17c6d19..999fe1818c 100644 --- a/module/upgrade/lang/version.php +++ b/module/upgrade/lang/version.php @@ -157,6 +157,10 @@ $lang->upgrade->fromVersions['16_4'] = '16.4'; $lang->upgrade->fromVersions['16_5_beta1'] = '16.5.beta1'; $lang->upgrade->fromVersions['16_5'] = '16.5'; +/* Lite. */ +$lang->upgrade->fromVersions['lite1_0'] = 'Lite1.0'; +$lang->upgrade->fromVersions['lite1_1'] = 'Lite1.1'; + /* Pro. */ $lang->upgrade->fromVersions['pro1_0'] = 'Pro1.0'; $lang->upgrade->fromVersions['pro1_1'] = 'Pro1.1'; From 4846c7af1a456b18cbafb2e299e52079cf613efe Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 7 Apr 2022 14:11:42 +0800 Subject: [PATCH 008/181] * fix bug install vision --- extension/lite/install/ext/control/index.php | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 extension/lite/install/ext/control/index.php diff --git a/extension/lite/install/ext/control/index.php b/extension/lite/install/ext/control/index.php new file mode 100644 index 0000000000..d4096243e0 --- /dev/null +++ b/extension/lite/install/ext/control/index.php @@ -0,0 +1,25 @@ +config->installed) or !$this->config->installed) $this->session->set('installing', true); + + $this->view->title = $this->lang->install->welcome; + if(!isset($this->view->versionName)) + { + $versionName = ucfirst($this->config->vision); + if($this->config->edition == 'biz') $versionName .= 'VIP'; + $versionName .= $this->config->liteVersion; // If the versionName variable has been defined in the max version, it cannot be defined here to avoid being overwritten. + $this->view->versionName = $versionName; + } + $this->display(); + } +} From 6f8d2334fdbd1c5c9094277d2c8a3aea1574f871 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 7 Apr 2022 14:12:57 +0800 Subject: [PATCH 009/181] * Fix upgrade vision for litevip. --- module/upgrade/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/upgrade/control.php b/module/upgrade/control.php index e81435c209..fa8d42ae69 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -92,8 +92,8 @@ class upgrade extends control { if(strpos($key, 'lite') === false) unset($this->lang->upgrade->fromVersions[$key]); } - - $this->config->version = 'Lite' . $this->config->liteVersion; + + $this->config->version = ($this->config->edition == 'biz' ? 'LiteVIP' : 'Lite') . $this->config->liteVersion; } $this->view->title = $this->lang->upgrade->common . $this->lang->colon . $this->lang->upgrade->selectVersion; From a8f6e27359a7cc4fe825c969d36abceba7411746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Thu, 7 Apr 2022 14:36:42 +0800 Subject: [PATCH 010/181] * Code for project. --- module/project/model.php | 4 +-- test/class/project.class.php | 50 +++++++++++++++++++++++++----- test/model/program/update.php | 10 +++--- test/model/project/activate.php | 16 +++++----- test/model/project/batchupdate.php | 18 +++++------ test/model/project/close.php | 22 +++++++------ test/model/project/create.php | 14 ++++----- test/model/project/putoff.php | 23 ++++++++++++++ test/model/project/start.php | 22 +++++-------- test/model/project/suspend.php | 23 +++++++------- 10 files changed, 131 insertions(+), 71 deletions(-) create mode 100644 test/model/project/putoff.php diff --git a/module/project/model.php b/module/project/model.php index 50905c096b..37956abcd4 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1264,7 +1264,7 @@ class projectModel extends model if($message) hepler::end(js::alert($message)); } } - if(dao::isError()) helper::end(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($projects as $projectID => $project) { @@ -1290,7 +1290,7 @@ class projectModel extends model if($oldProject->parent != $project->parent) $this->loadModel('program')->processNode($projectID, $project->parent, $oldProject->path, $oldProject->grade); /* When acl is open, white list set empty. When acl is private,update user view. */ - if($project->acl == 'open') $this->loadModel('personnel')->updateWhitelist('', 'project', $projectID); + if($project->acl == 'open') $this->loadModel('personnel')->updateWhitelist(array(), 'project', $projectID); if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project'); } $allChanges[$projectID] = common::createChanges($oldProject, $project); diff --git a/test/class/project.class.php b/test/class/project.class.php index 82971993f9..8960264c54 100644 --- a/test/class/project.class.php +++ b/test/class/project.class.php @@ -136,22 +136,21 @@ class Project } /** - * checkStatusBegin + * Test start a project. * - * @param int mixed $projectID + * @param int $projectID * @access public * @return void */ - public function checkStatusBegin($projectID) + public function start($projectID) { + $_POST['realBegan'] = helper::today(); $oldProject = $this->project->getById($projectID); if($oldProject->status != 'suspended' and $oldProject->status != 'wait') return false; - $change = $this->project->start($projectID); - $project = $this->project->getById($projectID); - if($project->status != 'doing') return false; + $changes = $this->project->start($projectID); - return true; + return $this->project->getById($projectID); } /** @@ -304,6 +303,43 @@ class Project return $this->project->getById($projectID); } + /** + * Update a project. + * + * @param int $projectID + * @param array $data + * @access public + * @return void + */ + public function update($projectID, $data) + { + $_POST = $data; + $this->project->update($projectID); + + unset($_POST); + if(dao::isError()) return array('message' => dao::getError()); + + return $this->project->getByID($projectID); + } + + /** + * Batch update projects. + * + * @param array $data + * @access public + * @return void + */ + public function batchUpdate($data) + { + $_POST = $data; + $this->project->batchUpdate(); + + unset($_POST); + if(dao::isError()) return array('message' => dao::getError()); + + return $this->project->getByIdList($data['projectIdList']); + } + /** * saveState * diff --git a/test/model/program/update.php b/test/model/program/update.php index a81e60f420..15dc691661 100755 --- a/test/model/program/update.php +++ b/test/model/program/update.php @@ -25,7 +25,7 @@ $data = array( 'parent' => '0', 'name' => '测试更新项目集十', 'begin' => '2020-10-10', - 'end' => '2022-06-01', + 'end' => '2022-06-03', 'acl' => 'private', 'budget' => '100', 'budgetUnit' => 'CNY', @@ -37,7 +37,7 @@ $data = array( $normalProgram = $data; $emptyTitleProgram = $data; -$emptyTitleProgram['name'] = '项目集1'; +$emptyTitleProgram['name'] = ''; $emptyBeginProgram = $data; $emptyBeginProgram['begin'] = ''; @@ -52,9 +52,9 @@ $beginLtParentProgram = $data; $beginLtParentProgram['parent'] = '9'; $beginLtParentProgram['begin'] = '2019-01-01'; -r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况 -r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』已经有『项目集1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 更新项目集名称重复时 -r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息 +r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况 +r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』不能为空。'); // 更新项目集名称为空时 +r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息 r($program->update(10, $emptyEndProgram)) && p('message:end') && e('子项目的最大完成日期:2022-05-27,父项目的完成日期不能小于子项目的最大完成日期'); //当计划完成小于计划开始时 r($program->update(10, $beginGtEndProgram)) && p('message:begin') && e('子项目集的最小开始日期:2022-02-01,父项目集的开始日期不能大于子项目集的最小开始日期'); // 父项目集的开始日期大于子项目集的开始日期时 r($program->update(10, $beginLtParentProgram)) && p('message:begin;message:end') && e('父项目集的开始日期:2022-02-09,开始日期不能小于父项目集的开始日期;父项目集的完成日期:2022-04-16,完成日期不能大于父项目集的完成日期'); // 项目集开始、结束日期和子项目不符的情况 diff --git a/test/model/project/activate.php b/test/model/project/activate.php index 075a91c16d..2aaea526f7 100755 --- a/test/model/project/activate.php +++ b/test/model/project/activate.php @@ -1,11 +1,11 @@ #!/usr/bin/env php activate(); cid=1 pid=1 @@ -14,10 +14,12 @@ pid=1 */ -$project = new Project('admin'); +global $tester; +$tester->loadModel('project'); -$beginId = array(66, 67); +$changes1 = $tester->project->activate(66); +$changes2 = $tester->project->activate(73); -r($project->checkStatus($beginId[0])) && p() && e('1'); //开始id为66状态不是closed的项目 -r($project->checkStatus($beginId[1])) && p() && e('0'); //开始id为67状态是closed的项目 -system("./ztest init"); \ No newline at end of file +r($changes1) && p('1:field,old,new') && e('status,closed,doing'); // 激活id为66状态是closed的项目 +r($changes2) && p('1:field,old,new') && e('status,suspended,doing'); // 激活id为73状态是suspended的项目 +system("./ztest init"); diff --git a/test/model/project/batchupdate.php b/test/model/project/batchupdate.php index 9ea974fa51..c798c2147a 100644 --- a/test/model/project/batchupdate.php +++ b/test/model/project/batchupdate.php @@ -16,17 +16,17 @@ $project = new Project(); $projectIdList = array(11, 12, 13); $data['names'] = array(11 => '批量修改项目11', 12 => '批量修改项目12', 13 => '批量修改项目13'); +$data['parents'] = array(11 => 1, 12 => 2, 13 => 3); $data['projectIdList'] = $projectIdList; $data['PMs'] = array(11 => 'admin', 12 => '', 13 => ''); -$data['begins'] = array(11 => '2022-01-03', 12 => '2022-03-05', 13 => ''); -$data['ends'] = array(11 => '2022-03-03', 12 => '2022-06-05', 13 => '2022-07-11'); +$data['begins'] = array(11 => '2022-02-08', 12 => '2022-03-05', 13 => '2022-02-19'); +$data['ends'] = array(11 => '2022-04-13', 12 => '2022-04-13', 13 => '2022-04-13'); +$data['dayses'] = array(11 => 10, 12 => 10, 13 => 14); +$data['acls'] = array(11 => 'open', 12 => 'private', 13 => 'program'); -$name = array( '7' => '批量修改任务一'); -$type = array( '7' => 'devel'); -$statuses = array('7' =>'doing'); +$projects = $project->batchUpdate($data); -$normal = array('names' => $name, 'types' => $type,'statuses'=> $statuses); - -$task = new taskTest(); -r($task->batchUpdateObject($normal, $taskID)) && p('1:field,old,new') && e('name,开发任务17,批量修改任务一'); // 测试批量修改任务 +r(count($projects)) && p() && e('3'); // 查看被编辑了的项目数量 +r($projects) && p('11:name,parent,PM,begin,acl') && e('批量修改项目11,1,admin,2022-02-08,open'); // 查看被编辑了的项目11详情 +r($projects) && p('12:name,parent,PM,begin,acl') && e('批量修改项目12,2,,2022-03-05,private'); // 查看被编辑了的项目12详情 system("./ztest init"); diff --git a/test/model/project/close.php b/test/model/project/close.php index 895a8d4220..9ee0f3e5b0 100755 --- a/test/model/project/close.php +++ b/test/model/project/close.php @@ -1,11 +1,11 @@ #!/usr/bin/env php close(); cid=1 pid=1 @@ -15,13 +15,17 @@ pid=1 */ -$project = new Project('admin'); +global $tester; +$tester->loadModel('project'); $closeId = array(20, 26, 41); -$realEnd1 = array('realEnd' => '2022-03-11'); +$_POST['realEnd'] = '2022-03-11'; -//var_dump($project->checkStatusOff($closeId[0], $realEnd1));die; -r($project->checkStatusOff($closeId[0], $realEnd1)) && p() && e('1'); //关闭id为20状态不是closed的项目 -r($project->checkStatusOff($closeId[1], $realEnd1)) && p() && e('0'); //关闭id为26状态是closed的项目 -r($project->checkStatusOff($closeId[2], $realEnd1)) && p() && e('0'); //关闭id为41状态是suspended的项目 -system("./ztest init"); \ No newline at end of file +$changes1 = $tester->project->close(20); +$changes2 = $tester->project->close(26); +$changes3 = $tester->project->close(41); + +r($changes1) && p() && e('1'); //关闭id为20状态不是closed的项目 +r($changes2) && p() && e('0'); //关闭id为26状态是closed的项目 +r($changes3) && p() && e('0'); //关闭id为41状态是suspended的项目 +system("./ztest init"); diff --git a/test/model/project/create.php b/test/model/project/create.php index 2f8d17048d..d1c1e52250 100644 --- a/test/model/project/create.php +++ b/test/model/project/create.php @@ -6,7 +6,7 @@ su('admin'); /** -title=测试 projectModel::create(); +title=测试 projectModel->create(); cid=1 pid=1 @@ -55,10 +55,10 @@ $moreThanParent = $data; $moreThanParent['parent'] = '1'; $moreThanParent['begin'] = '2018-01-01'; -r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目 -r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时 -r($project->create($emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 项目的开始时间为空 -r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空 -r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-01-12』。'); // 项目的计划完成时间大于计划开始时间 -r($project->create($moreThanParent)) && p('message:begin;message:end') && e('父项目的开始日期:2022-01-16,开始日期不能小于父项目的开始日期'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期) +r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目 +r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时 +r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空 +r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-02-07』。'); // 项目的计划完成时间大于计划开始时间 +r($project->create($emptyBeginProject)) && p('message:begin') && e('项目集的最小开始日期:2022-02-07,项目的开始日期不能小于项目集的最小开始日期'); // 项目的开始时间为空 +r($project->create($moreThanParent)) && p('message:begin;message:end') && e('项目集的最小开始日期:2022-02-07,项目的开始日期不能小于项目集的最小开始日期;'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期) system("./ztest init"); diff --git a/test/model/project/putoff.php b/test/model/project/putoff.php new file mode 100644 index 0000000000..adc9b03237 --- /dev/null +++ b/test/model/project/putoff.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +start(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); +$_POST['end'] = '2023-07-01'; + +$changes1 = $tester->project->putoff(81); +$changes2 = $tester->project->putoff(0); + +r($changes1[0]) && p('new') && e('2023-07-01'); // 延期ID为81的项目,查看延期后的日期 +r($changes2) && p() && e('0'); // 延期ID为0的项目,返回空 +system("./ztest init"); diff --git a/test/model/project/start.php b/test/model/project/start.php index 7305a71968..ad7a8b9160 100755 --- a/test/model/project/start.php +++ b/test/model/project/start.php @@ -2,26 +2,20 @@ start(); cid=1 pid=1 -开始id为81状态是suspended的项目(代码缺失elBegan参数,报警告) >> 1 -开始id为83状态是wait的项目 >> 1 -开始id为82状态是closed的项目 >> 0 -开始id为85状态是doing的项目 >> 0 - */ -$project = new Project('admin'); +$project = new Project(); -$statusId = array(81, 83, 82, 85); - -r($project->checkStatusBegin($statusId[0])) && p() && e('1'); // 开始id为81状态是suspended的项目(代码缺失elBegan参数,报警告) -r($project->checkStatusBegin($statusId[1])) && p() && e('1'); // 开始id为83状态是wait的项目 -r($project->checkStatusBegin($statusId[2])) && p() && e('0'); // 开始id为82状态是closed的项目 -r($project->checkStatusBegin($statusId[3])) && p() && e('0'); // 开始id为85状态是doing的项目 -system("./ztest init"); \ No newline at end of file +r($project->start(81)) && p('name,status') && e('项目71,doing'); // 开始id为81状态是suspended的项目 +r($project->start(82)) && p() && e('0'); // 开始id为82状态是closed的项目 +r($project->start(83)) && p('name,status') && e('项目73,doing'); // 开始id为83状态是wait的项目 +r($project->start(85)) && p() && e('0'); // 开始id为85状态是doing的项目 +system("./ztest init"); diff --git a/test/model/project/suspend.php b/test/model/project/suspend.php index f6e322e188..46566e47f6 100755 --- a/test/model/project/suspend.php +++ b/test/model/project/suspend.php @@ -1,23 +1,24 @@ #!/usr/bin/env php suspend(); cid=1 pid=1 -暂停id为56状态是doing的项目 >> 1 -暂停id为73状态是suspended的项目 >> 0 -暂停id为74状态是closed的项目 >> 0 - */ -$t = new Project('admin'); +global $tester; +$tester->loadModel('project'); -r($t->checkStatusStop(56)) && p() && e('1'); // 暂停id为56状态是doing的项目 -r($t->checkStatusStop(73)) && p() && e('0'); // 暂停id为73状态是suspended的项目 -r($t->checkStatusStop(74)) && p() && e('0'); // 暂停id为74状态是closed的项目 -system("./ztest init"); \ No newline at end of file +$changes1 = $tester->project->suspend(56); +$changes2 = $tester->project->suspend(73); +$changes3 = $tester->project->suspend(74); + +r($changes1[0]) && p('new') && e('suspended'); // 挂起id为56状态是doing的项目 +r($changes2[0]) && p('field') && e('suspendedDate'); // 挂起id为73状态是suspended的项目 +r($changes3[0]) && p('new') && e('suspended'); // 挂起id为74状态是closed的项目 +system("./ztest init"); From 8b58e7166734a73baf5b8f87c3d1c05e3942ef2b Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 7 Apr 2022 16:05:54 +0800 Subject: [PATCH 011/181] * bug #16555, remove scrollbar when drag item to outside of kanban. --- module/execution/css/executionkanban.css | 2 ++ module/project/css/kanban.css | 2 ++ 2 files changed, 4 insertions(+) diff --git a/module/execution/css/executionkanban.css b/module/execution/css/executionkanban.css index d0391273f7..c69606538d 100644 --- a/module/execution/css/executionkanban.css +++ b/module/execution/css/executionkanban.css @@ -6,3 +6,5 @@ #kanbanList .kanban-lane-name > .text {display: none;} #kanbanList .kanban-item.link-block > a {cursor: move;} #kanbanList .kanban-lane + .kanban-lane {margin-top: 2px!important;} + +.kanban.kanban-dragging {overflow: hidden;} diff --git a/module/project/css/kanban.css b/module/project/css/kanban.css index 24771aaf89..b0ef038e3a 100644 --- a/module/project/css/kanban.css +++ b/module/project/css/kanban.css @@ -22,3 +22,5 @@ table th, td {border: 2px solid #fff !important;} .kanban-col[data-type='closedProject'] .count {display: none} .kanban-item > a {cursor: move;} .kanban-item.execution-item > a {cursor: pointer;} + +.kanban.kanban-dragging {overflow: hidden;} From 8b336e8694a50d9628cf2f97c4fe3d128b761029 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 7 Apr 2022 16:06:46 +0800 Subject: [PATCH 012/181] * bug #16555, remove scrollbar when drag item to outside of kanban. --- module/execution/css/executionkanban.css | 2 +- module/project/css/kanban.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/css/executionkanban.css b/module/execution/css/executionkanban.css index c69606538d..69673ddfbb 100644 --- a/module/execution/css/executionkanban.css +++ b/module/execution/css/executionkanban.css @@ -7,4 +7,4 @@ #kanbanList .kanban-item.link-block > a {cursor: move;} #kanbanList .kanban-lane + .kanban-lane {margin-top: 2px!important;} -.kanban.kanban-dragging {overflow: hidden;} +.kanban.kanban-dragging {overflow: hidden!important;} diff --git a/module/project/css/kanban.css b/module/project/css/kanban.css index b0ef038e3a..f83fa33f6f 100644 --- a/module/project/css/kanban.css +++ b/module/project/css/kanban.css @@ -23,4 +23,4 @@ table th, td {border: 2px solid #fff !important;} .kanban-item > a {cursor: move;} .kanban-item.execution-item > a {cursor: pointer;} -.kanban.kanban-dragging {overflow: hidden;} +.kanban.kanban-dragging {overflow: hidden!important;} From edfae1f3c593584a4ae2b8a38d3f32681c9beb73 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 7 Apr 2022 17:11:28 +0800 Subject: [PATCH 013/181] * bug #21160, optimize chosen UI. --- www/js/zui/min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/zui/min.js b/www/js/zui/min.js index c0fac09be7..16baf9bd1e 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,5 +1,5 @@ /*! - * ZUI: ZUI for Zentao - v1.10.0 - 2022-04-06 + * ZUI: ZUI for Zentao - v1.10.0 - 2022-04-07 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2022 cnezsoft.com; Licensed MIT @@ -41,8 +41,8 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ -function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=c.substr(0,l)+""+c.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(h),c=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+c.substr(0,l)+""+c.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
",i),this.is_multiple?this.container.html('
    '):(this.container.html(''+this.default_text+'
      '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),c=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+c+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
    • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
      ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
    • '+this.results_none_found+' ""
    • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,c;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.selectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, -selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,c=this.options,h=this,d=c.ignoreVal,u=!0,p="."+this.name+"."+this.id,f="function"==typeof c.checkFunc?c.checkFunc:null,g="function"==typeof c.rangeFunc?c.rangeFunc:null,m=!1,v=null,y="mousedown"+p,b=function(){a&&h.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(f){var s=f.call(h,{intersect:n,target:e,range:a,targetRange:i});s===!0?h.select(e):s===!1&&h.unselect(e)}else n?h.select(e):h.multiKey||h.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width
      ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},h.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=0,C=function(e){x&&(t.zui.clearAsap||clearTimeout)(x),x=(t.zui.asap||setTimeout)(function(){x=0,w(e)},0)},_=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()}),e.preventDefault())},k=function(o){if(m)return _(o);var a=t.zui.getMouseButtonCode(c.mouseButton);if(!(a>-1&&o.button!==a||t(o.target).closest("input,select,textarea,label").length||h.altKey||3===o.which||h.callEvent("start",o)===!1)){var s=h.$children=h.$.find(c.selector);s.addClass("selectable-item");var r=h.multiKey?"multi":c.clickBehavior;if("single"===r&&h.unselect(),c.listenClick&&("multi"===r?h.toggle(o.target):"single"===r?h.select(o.target):"toggle"===r&&h.toggle(o.target,null,function(t){h.unselect()})),h.callEvent("startDrag",o)===!1)return void h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+p,C).on("mouseup"+p,_),v=setTimeout(function(){t(document).on(y,_)},10),o.preventDefault()}},T=c.container&&"default"!==c.container?t(c.container):this.$;c.trigger?T.on(y,c.trigger,k):T.on(y,k),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?h.multiKey=e:18===e&&(h.altKey=!0)}).on("keyup",function(t){h.multiKey=!1,h.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,c=o.dragCssClass,h=o.targetSelector,d=o.reverse,u=o.moveDirection,p=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};h||p(),n.droppable({handle:o.trigger,target:h?h:r?s+","+r:s,selector:s,container:o.container||n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,noShadow:o.noShadow,dropOnMouseleave:o.dropOnMouseleave,stopPropagation:o.stopPropagation,start:function(t){if(c&&t.element.addClass(c),e=!1,i.$element=t.element,!u&&t.targets.length>1){var n=t.targets.eq(0).offset(),o=t.targets.eq(1).offset();u=Math.abs(n.left-o.left)>Math.abs(n.top-o.top)?"h":"v"}p(),i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,c=t.target,h=r&&c.is(r);if(h)return void(c.children(s).filter(".dragging").length||(c.append(o),p(b),i.trigger(a,{list:b,element:o})));var f=o.data(a),g=c.data(a);if(f===g)return;var m="h"===u?"left":"top",v=t.mouseOffset[m]-t.lastMouseOffset[m];if(0===v)return;var y=f>g?d:!d;if(v<0&&y||v>0&&!y)return;c[y?"after":"before"](o),e=!0;var b=i.getItems(1);p(b),i.trigger(a,{list:b,element:o})}},finish:function(t){c&&t.element&&t.element.removeClass(c),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e}),i.$element=null}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i,n=this,o=n.options.targetSelector;return i=o?"function"==typeof o?o(n.$element,n.$):n.$.find(o):n.$.find(n.options.selector),i=i.not(".drag-shadow"),e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";function i(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
    • ');var n=t("
      ").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick);var o=t("
    • ").toggleClass("disabled",e.disabled===!0).append(n);return e.items&&o.data("item",e).addClass("dropdown-submenu"),o}function n(e,n,o){var a=o.itemCreator||i,s=typeof e;return"string"===s?e=e.split(","):"function"===s&&(e=e(o)),!!e&&(t.each(e,function(t,e){n.append(a(e,t,o))}),!0)}var o="zui.contextmenu",a={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200},s=!1,r={},l="zui-contextmenu-"+t.zui.uuid(),c=0,h=0,d=function(){return t(document).off("mousemove."+o).on("mousemove."+o,function(t){c=t.clientX,h=t.clientY}),r},u=function(e){var i=t("#"+l);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},p=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),p&&(clearTimeout(p),p=null);var n=t("#"+l);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var a=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var s=o.animation;n.find(".contextmenu-menu").removeClass("in"),s?p=setTimeout(a,o.duration):a()}}return r},g=function(i,d,u){t.isPlainObject(i)&&(u=d,d=i,i=d.items),s=!0,d=t.extend({},a,d);var g=t("#"+l);g.length||(g=t('
      ').appendTo("body"));var m=g.find(".contextmenu-menu").empty();m.off("click."+o).on("click."+o,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).off("mouseenter."+o).on("mouseenter."+o,".dropdown-submenu",function(e){var i=t(this),o=i.data("item"),a=i.children(".dropdown-menu");if(o&&(o.items&&(a.length||(a=t(d.menuTemplate).appendTo(i)),n(o.items,a,d)),i.removeData("item")),a.length){a.removeClass("pull-left").css("top",0);var s=(i[0].getBoundingClientRect(),a[0].getBoundingClientRect()),r=window.innerWidth,l=window.innerHeight;if(s.bottom>l){var c=Math.max(-s.top,l-s.bottom);a.css("top",c)}s.right>r&&a.addClass("pull-left")}}),m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(i,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=n(i,y,d);if(b===!1)return b}var w=d.animation,x=d.duration;w===!0&&(d.animation=w="fade"),p&&(clearTimeout(p),p=null);var C=function(){m.addClass("in"),d.onShown&&d.onShown(),u&&u()};d.onShow&&d.onShow(),g.data("options",{animation:w,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:x});var _=d.x,k=d.y;_===e&&(_=(d.event||d).clientX),_===e&&(_=c),k===e&&(k=(d.event||d).clientY),k===e&&(k=h);var T=window.innerHeight,S=window.innerWidth,y=m.children().first(),D=y.outerWidth(),M=y.outerHeight();if(d.position){var L=d.position({x:_,y:k,width:D,height:M,winHeight:T,winWidth:S},d,m);L&&(_=L.x,k=L.y)}return _=Math.max(0,Math.min(_,S-D)),k=Math.max(0,Math.min(k,T-M)),g.css({left:_,top:k}).show(),m.addClass("open"),w?(m.addClass(w),p=setTimeout(function(){C(),s=!1},10)):(C(),s=!1),r};t.extend(r,{NAME:o,DEFAULTS:a,show:g,hide:f,listenMouse:d,isShow:u}),t.zui({ContextMenu:r});var m=function(e,i){var n=this;n.name=o,n.$=t(e),n.id=t.zui.uuid(),i=n.options=t.extend({trigger:"contextmenu"},r.DEFAULTS,this.$.data(),i);var a=function(t){if("mousedown"!==t.type||2===t.button){if(i.toggleTrigger&&n.isShow())n.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(n.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},s=i.trigger,l=s+"."+o;i.selector?n.$.on(l,i.selector,a):n.$.on(l,a),i.show&&n.show("object"==typeof i.show?i.show:null)};m.prototype.destory=function(){that.$.off("."+o)},m.prototype.hide=function(t){return r.hide(this.id,t)},m.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),r.show(e,i)},m.prototype.isShow=function(){return u(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var i=t(this),n=i.data(o),a="object"==typeof e&&e;n||i.data(o,n=new m(this,a)),"string"==typeof e&&n[e]()})},t.fn.contextmenu.Constructor=m,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var i=t(e.target),n=i.closest('[data-toggle="context-dropdown"]');if(n.length){var a=n.data(o);a||n.contextDropdown({show:!0})}else s||i.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! +function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=c.substr(0,l)+""+c.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(h),c=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+c.substr(0,l)+""+c.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
      ",i),this.is_multiple?this.container.html('
        '):(this.container.html('
        '+this.default_text+'
          '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.val(e.search_field.val()),e.search_field.focus(),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),c=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+c+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
        • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
          ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
        • '+this.results_none_found+' ""
        • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,c;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.selectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections, +target:o,selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,c=this.options,h=this,d=c.ignoreVal,u=!0,p="."+this.name+"."+this.id,f="function"==typeof c.checkFunc?c.checkFunc:null,g="function"==typeof c.rangeFunc?c.rangeFunc:null,m=!1,v=null,y="mousedown"+p,b=function(){a&&h.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(f){var s=f.call(h,{intersect:n,target:e,range:a,targetRange:i});s===!0?h.select(e):s===!1&&h.unselect(e)}else n?h.select(e):h.multiKey||h.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},h.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=0,C=function(e){x&&(t.zui.clearAsap||clearTimeout)(x),x=(t.zui.asap||setTimeout)(function(){x=0,w(e)},0)},_=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()}),e.preventDefault())},k=function(o){if(m)return _(o);var a=t.zui.getMouseButtonCode(c.mouseButton);if(!(a>-1&&o.button!==a||t(o.target).closest("input,select,textarea,label").length||h.altKey||3===o.which||h.callEvent("start",o)===!1)){var s=h.$children=h.$.find(c.selector);s.addClass("selectable-item");var r=h.multiKey?"multi":c.clickBehavior;if("single"===r&&h.unselect(),c.listenClick&&("multi"===r?h.toggle(o.target):"single"===r?h.select(o.target):"toggle"===r&&h.toggle(o.target,null,function(t){h.unselect()})),h.callEvent("startDrag",o)===!1)return void h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+p,C).on("mouseup"+p,_),v=setTimeout(function(){t(document).on(y,_)},10),o.preventDefault()}},T=c.container&&"default"!==c.container?t(c.container):this.$;c.trigger?T.on(y,c.trigger,k):T.on(y,k),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?h.multiKey=e:18===e&&(h.altKey=!0)}).on("keyup",function(t){h.multiKey=!1,h.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,c=o.dragCssClass,h=o.targetSelector,d=o.reverse,u=o.moveDirection,p=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};h||p(),n.droppable({handle:o.trigger,target:h?h:r?s+","+r:s,selector:s,container:o.container||n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,noShadow:o.noShadow,dropOnMouseleave:o.dropOnMouseleave,stopPropagation:o.stopPropagation,start:function(t){if(c&&t.element.addClass(c),e=!1,i.$element=t.element,!u&&t.targets.length>1){var n=t.targets.eq(0).offset(),o=t.targets.eq(1).offset();u=Math.abs(n.left-o.left)>Math.abs(n.top-o.top)?"h":"v"}p(),i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,c=t.target,h=r&&c.is(r);if(h)return void(c.children(s).filter(".dragging").length||(c.append(o),p(b),i.trigger(a,{list:b,element:o})));var f=o.data(a),g=c.data(a);if(f===g)return;var m="h"===u?"left":"top",v=t.mouseOffset[m]-t.lastMouseOffset[m];if(0===v)return;var y=f>g?d:!d;if(v<0&&y||v>0&&!y)return;c[y?"after":"before"](o),e=!0;var b=i.getItems(1);p(b),i.trigger(a,{list:b,element:o})}},finish:function(t){c&&t.element&&t.element.removeClass(c),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e}),i.$element=null}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i,n=this,o=n.options.targetSelector;return i=o?"function"==typeof o?o(n.$element,n.$):n.$.find(o):n.$.find(n.options.selector),i=i.not(".drag-shadow"),e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";function i(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
        • ');var n=t("
          ").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick);var o=t("
        • ").toggleClass("disabled",e.disabled===!0).append(n);return e.items&&o.data("item",e).addClass("dropdown-submenu"),o}function n(e,n,o){var a=o.itemCreator||i,s=typeof e;return"string"===s?e=e.split(","):"function"===s&&(e=e(o)),!!e&&(t.each(e,function(t,e){n.append(a(e,t,o))}),!0)}var o="zui.contextmenu",a={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200},s=!1,r={},l="zui-contextmenu-"+t.zui.uuid(),c=0,h=0,d=function(){return t(document).off("mousemove."+o).on("mousemove."+o,function(t){c=t.clientX,h=t.clientY}),r},u=function(e){var i=t("#"+l);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},p=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),p&&(clearTimeout(p),p=null);var n=t("#"+l);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var a=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var s=o.animation;n.find(".contextmenu-menu").removeClass("in"),s?p=setTimeout(a,o.duration):a()}}return r},g=function(i,d,u){t.isPlainObject(i)&&(u=d,d=i,i=d.items),s=!0,d=t.extend({},a,d);var g=t("#"+l);g.length||(g=t('
          ').appendTo("body"));var m=g.find(".contextmenu-menu").empty();m.off("click."+o).on("click."+o,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).off("mouseenter."+o).on("mouseenter."+o,".dropdown-submenu",function(e){var i=t(this),o=i.data("item"),a=i.children(".dropdown-menu");if(o&&(o.items&&(a.length||(a=t(d.menuTemplate).appendTo(i)),n(o.items,a,d)),i.removeData("item")),a.length){a.removeClass("pull-left").css("top",0);var s=(i[0].getBoundingClientRect(),a[0].getBoundingClientRect()),r=window.innerWidth,l=window.innerHeight;if(s.bottom>l){var c=Math.max(-s.top,l-s.bottom);a.css("top",c)}s.right>r&&a.addClass("pull-left")}}),m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(i,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=n(i,y,d);if(b===!1)return b}var w=d.animation,x=d.duration;w===!0&&(d.animation=w="fade"),p&&(clearTimeout(p),p=null);var C=function(){m.addClass("in"),d.onShown&&d.onShown(),u&&u()};d.onShow&&d.onShow(),g.data("options",{animation:w,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:x});var _=d.x,k=d.y;_===e&&(_=(d.event||d).clientX),_===e&&(_=c),k===e&&(k=(d.event||d).clientY),k===e&&(k=h);var T=window.innerHeight,S=window.innerWidth,y=m.children().first(),D=y.outerWidth(),M=y.outerHeight();if(d.position){var L=d.position({x:_,y:k,width:D,height:M,winHeight:T,winWidth:S},d,m);L&&(_=L.x,k=L.y)}return _=Math.max(0,Math.min(_,S-D)),k=Math.max(0,Math.min(k,T-M)),g.css({left:_,top:k}).show(),m.addClass("open"),w?(m.addClass(w),p=setTimeout(function(){C(),s=!1},10)):(C(),s=!1),r};t.extend(r,{NAME:o,DEFAULTS:a,show:g,hide:f,listenMouse:d,isShow:u}),t.zui({ContextMenu:r});var m=function(e,i){var n=this;n.name=o,n.$=t(e),n.id=t.zui.uuid(),i=n.options=t.extend({trigger:"contextmenu"},r.DEFAULTS,this.$.data(),i);var a=function(t){if("mousedown"!==t.type||2===t.button){if(i.toggleTrigger&&n.isShow())n.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(n.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},s=i.trigger,l=s+"."+o;i.selector?n.$.on(l,i.selector,a):n.$.on(l,a),i.show&&n.show("object"==typeof i.show?i.show:null)};m.prototype.destory=function(){that.$.off("."+o)},m.prototype.hide=function(t){return r.hide(this.id,t)},m.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),r.show(e,i)},m.prototype.isShow=function(){return u(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var i=t(this),n=i.data(o),a="object"==typeof e&&e;n||i.data(o,n=new m(this,a)),"string"==typeof e&&n[e]()})},t.fn.contextmenu.Constructor=m,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var i=t(e.target),n=i.closest('[data-toggle="context-dropdown"]');if(n.length){var a=n.data(o);a||n.contextDropdown({show:!0})}else s||i.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! * jQuery Form Plugin * version: 4.2.2 * Requires jQuery v1.7.2 or later From 846e904b015333106a9679778955144c603c52c9 Mon Sep 17 00:00:00 2001 From: renying Date: Fri, 8 Apr 2022 08:42:01 +0800 Subject: [PATCH 014/181] Add auto test of custom. --- test/class/custom.class.php | 337 ++++++++++++++++++++++ test/model/custom/deleteitems.php | 37 +++ test/model/custom/getalllang.php | 19 ++ test/model/custom/getformfields.php | 125 ++++++++ test/model/custom/getitems.php | 35 +++ test/model/custom/getrequiredfields.php | 19 ++ test/model/custom/getsrpairs.php | 19 ++ test/model/custom/geturpairs.php | 19 ++ test/model/custom/getursrlist.php | 19 ++ test/model/custom/getursrpairs.php | 19 ++ test/model/custom/parseitemparam.php | 36 +++ test/model/custom/preparesql.php | 50 ++++ test/model/custom/savecustommenu.php | 19 ++ test/model/custom/saverequiredfields.php | 149 ++++++++++ test/model/custom/setconcept.php | 25 ++ test/model/custom/setitem.php | 36 +++ test/model/custom/setstoryrequirement.php | 19 ++ test/model/custom/seturandsr.php | 29 ++ test/model/custom/updateurandsr.php | 33 +++ 19 files changed, 1044 insertions(+) create mode 100644 test/class/custom.class.php create mode 100755 test/model/custom/deleteitems.php create mode 100755 test/model/custom/getalllang.php create mode 100755 test/model/custom/getformfields.php create mode 100755 test/model/custom/getitems.php create mode 100755 test/model/custom/getrequiredfields.php create mode 100755 test/model/custom/getsrpairs.php create mode 100755 test/model/custom/geturpairs.php create mode 100755 test/model/custom/getursrlist.php create mode 100755 test/model/custom/getursrpairs.php create mode 100755 test/model/custom/parseitemparam.php create mode 100755 test/model/custom/preparesql.php create mode 100755 test/model/custom/savecustommenu.php create mode 100755 test/model/custom/saverequiredfields.php create mode 100755 test/model/custom/setconcept.php create mode 100755 test/model/custom/setitem.php create mode 100755 test/model/custom/setstoryrequirement.php create mode 100755 test/model/custom/seturandsr.php create mode 100755 test/model/custom/updateurandsr.php diff --git a/test/class/custom.class.php b/test/class/custom.class.php new file mode 100644 index 0000000000..e65e102c82 --- /dev/null +++ b/test/class/custom.class.php @@ -0,0 +1,337 @@ +objectModel = $tester->loadModel('custom'); + } + + /** + * Test get all custom lang. + * + * @access public + * @return int + */ + public function getAllLangTest() + { + $objects = $this->objectModel->getAllLang(); + + if(dao::isError()) return dao::getError(); + $counts = count($objects); + + return $counts; + } + + /** + * Test set value of an item. + * + * @param string $path + * @param string $value + * @access public + * @return object|int + */ + public function setItemTest($path, $value = '') + { + $objects = $this->objectModel->setItem($path, $value); + + if(dao::isError()) return dao::getError(); + + $level = substr_count($path, '.'); + if($level > 1) + { + if($level == 2) list($lang, $module, $key) = explode('.', $path); + if($level == 3) list($lang, $module, $section, $key) = explode('.', $path); + if($level == 4) list($lang, $module, $section, $key, $system) = explode('.', $path); + + global $tester; + $objects = $tester->dao->select('*')->from(TABLE_LANG)->where('`lang`')->eq($lang)->andWhere('`module`')->eq($module)->andWhere('`key`')->eq($key)->fetch(); + } + + return $objects; + } + + /** + * Test get some items + * + * @param string $paramString + * @access public + * @return array + */ + public function getItemsTest($paramString) + { + $objects = $this->objectModel->getItems($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test delete items. + * + * @param string $paramString + * @access public + * @return int + */ + public function deleteItemsTest($paramString) + { + $objects = $this->objectModel->deleteItems($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test parse the param string for select or delete items. + * + * @param string $paramString + * @access public + * @return array + */ + public function parseItemParamTest($paramString) + { + $objects = $this->objectModel->parseItemParam($paramString); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test create a DAO object to select or delete one or more records. + * + * @param string $paramString + * @param string $method + * @access public + * @return array|int + */ + public function prepareSQLTest($paramString, $method = 'select') + { + $params = $this->objectModel->parseItemParam($paramString); + if($method == 'delete') + { + $objects = $this->objectModel->prepareSQL($params, $method)->exec(); + } + else + { + $objects = $this->objectModel->prepareSQL($params, $method)->orderBy('lang,id')->fetchAll('key'); + } + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function saveCustomMenuTest($menu, $module, $method = '') + { + $objects = $this->objectModel->saveCustomMenu($menu, $module, $method); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getRequiredFieldsTest($moduleConfig) + { + $objects = $this->objectModel->getRequiredFields($moduleConfig); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test get module fields. + * + * @param string $moduleName + * @param string $method + * @access public + * @return array + */ + public function getFormFieldsTest($moduleName, $method = '') + { + global $app; + $app->loadLang($moduleName); + + $objects = $this->objectModel->getFormFields($moduleName, $method); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test get UR and SR pairs. + * + * @access public + * @return array + */ + public function getURSRPairsTest() + { + $objects = $this->objectModel->getURSRPairs(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test get UR pairs. + * + * @access public + * @return array + */ + public function getURPairsTest() + { + $objects = $this->objectModel->getURPairs(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test get SR pairs. + * + * @access public + * @return array + */ + public function getSRPairsTest() + { + $objects = $this->objectModel->getSRPairs(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test get UR and SR list. + * + * @access public + * @return array + */ + public function getURSRListTest() + { + $objects = $this->objectModel->getURSRList(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test save required fields. + * + * @param string $moduleName + * @param string $requiredFields + * @param string $fieldsType + * @access public + * @return object + */ + public function saveRequiredFieldsTest($moduleName, $requiredFields, $fieldsType) + { + global $app, $tester; + $app->loadLang($moduleName); + + $_POST = $requiredFields; + $this->objectModel->saveRequiredFields($moduleName); + + $objects = $tester->dao->select('`value`')->from(TABLE_CONFIG) + ->where('`owner`')->eq('system') + ->andWhere('`module`')->eq($moduleName) + ->andWhere('`key`')->eq('requiredFields') + ->andWhere('`section`')->eq($fieldsType) + ->fetch(); + + unset($_POST); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test set product and project and sprint concept. + * + * @param int $sprintConcept + * @access public + * @return object + */ + public function setConceptTest($sprintConcept) + { + global $tester; + + $_POST['sprintConcept'] = $sprintConcept; + $this->objectModel->setConcept(); + + if(dao::isError()) return dao::getError(); + $objects = $tester->dao->select('`id`')->from(TABLE_BLOCK)->where('source')->eq('execution')->fetch(); + + unset($_POST); + + return $objects; + } + + /** + * Test set UR and SR concept. + * + * @param array $SRName + * @access public + * @return int + */ + public function setURAndSRTest($SRName) + { + $_POST = $SRName; + $objects = $this->objectModel->setURAndSR(); + + if(dao::isError()) return dao::getError(); + + unset($_POST); + + return $objects; + } + + /** + * Test edit UR and SR concept. + * + * @param int $key + * @param string $SRName + * @access public + * @return object + */ + public function updateURAndSRTest($key = 0, $SRName) + { + global $app, $tester; + + $_POST['URName'] = '用户需求'; + $_POST['SRName'] = $SRName; + $this->objectModel->updateURAndSR($key); + + if(dao::isError()) return dao::getError(); + + $lang = $app->getClientLang(); + + $objects = $tester->dao->select('`value`')->from(TABLE_LANG) + ->where('`key`')->eq($key) + ->andWhere('section')->eq('URSRList') + ->andWhere('lang')->eq($lang) + ->andWhere('module')->eq('custom') + ->fetch(); + + unset($_POST); + + return $objects; + } + + public function setStoryRequirementTest() + { + $objects = $this->objectModel->setStoryRequirement(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } +} diff --git a/test/model/custom/deleteitems.php b/test/model/custom/deleteitems.php new file mode 100755 index 0000000000..a7cc6f8bb3 --- /dev/null +++ b/test/model/custom/deleteitems.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php +deleteItems(); +cid=1 +pid=1 + +测试参数为空 >> 0 +测试参数为lang >> 0 +测试参数为lang,module >> 0 +测试参数为lang,key,section >> 0 +测试参数为lang,key,section,module >> 0 +测试参数为lang,key,section,module,vision >> 0 + +*/ + +$lang = 'lang=zh-cn'; +$module = 'module=custom'; +$section = 'section=URSRList'; +$key = 'key=1'; +$vision = 'vision=rnd'; +$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision); + +$custom = new customTest(); + +r($custom->deleteItemsTest($paramString[0])) && p() && e('0'); //测试参数为空 +r($custom->deleteItemsTest($paramString[1])) && p() && e('0'); //测试参数为lang +r($custom->deleteItemsTest($paramString[2])) && p() && e('0'); //测试参数为lang,module +r($custom->deleteItemsTest($paramString[3])) && p() && e('0'); //测试参数为lang,key,section +r($custom->deleteItemsTest($paramString[4])) && p() && e('0'); //测试参数为lang,key,section,module +r($custom->deleteItemsTest($paramString[5])) && p() && e('0'); //测试参数为lang,key,section,module,vision +system("./ztest init"); \ No newline at end of file diff --git a/test/model/custom/getalllang.php b/test/model/custom/getalllang.php new file mode 100755 index 0000000000..64c63eb325 --- /dev/null +++ b/test/model/custom/getalllang.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getAllLang(); +cid=1 +pid=1 + +测试正常查询 >> 2 + +*/ + +$custom = new customTest(); + +r($custom->getAllLangTest()) && p() && e('2'); //测试正常查询 \ No newline at end of file diff --git a/test/model/custom/getformfields.php b/test/model/custom/getformfields.php new file mode 100755 index 0000000000..29eeec22bb --- /dev/null +++ b/test/model/custom/getformfields.php @@ -0,0 +1,125 @@ +#!/usr/bin/env php +getFormFields(); +cid=1 +pid=1 + +测试moduleName值为product,method为空 >> 0 +测试moduleName值为product,method为create >> 产品负责人,测试负责人,发布负责人,产品类型 +测试moduleName值为product,method为edit >> 产品负责人,测试负责人,发布负责人,产品类型,状态 +测试moduleName值为story,method为空 >> 0 +测试moduleName值为story,method为create >> 所属模块,所属计划,来源,优先级 +测试moduleName值为story,method为change >> 备注 +测试moduleName值为story,method为close >> 备注 +测试moduleName值为story,method为review >> 评审时间,备注 +测试moduleName值为productplan,method为空 >> 开始日期,结束日期,描述 +测试moduleName值为productplan,method为create >> 开始日期,结束日期,描述 +测试moduleName值为productplan,method为edit >> 开始日期,结束日期,描述 +测试moduleName值为release,method为空 >> 0 +测试moduleName值为release,method为create >> 描述 +测试moduleName值为release,method为edit >> 描述 +测试moduleName值为execution,method为空 >> 0 +测试moduleName值为execution,method为create >> 可用工作日,迭代描述 +测试moduleName值为execution,method为edit >> 可用工作日,迭代描述,产品负责人,迭代负责人 +测试moduleName值为execution,method为close >> 0 +测试moduleName值为execution,method为start >> 0 +测试moduleName值为task,method为空 >> 0 +测试moduleName值为task,method为create >> 相关研发需求,优先级,最初预计,任务描述 +测试moduleName值为task,method为edit >> 优先级,最初预计,预计开始 +测试moduleName值为task,method为finish >> 备注 +测试moduleName值为task,method为activate >> 指派给,备注 +测试moduleName值为build,method为空 >> 源代码地址,下载地址,描述 +测试moduleName值为build,method为create >> 源代码地址,下载地址,描述 +测试moduleName值为build,method为edit >> 源代码地址,下载地址,描述 +测试moduleName值为bug,method为空 >> 0 +测试moduleName值为bug,method为create >> 所属模块,所属项目,截止日期 +测试moduleName值为bug,method为edit >> 所属计划,Bug类型,浏览器,优先级 +测试moduleName值为bug,method为resolve >> 解决版本,备注 +测试moduleName值为testcase,method为空 >> 0 +测试moduleName值为testcase,method为create >> 适用阶段,相关研发需求,优先级 +测试moduleName值为testcase,method为edit >> 适用阶段,相关研发需求,优先级 +测试moduleName值为testsuite,method为空 >> 描述 +测试moduleName值为testsuite,method为create >> 描述 +测试moduleName值为testsuite,method为edit >> 描述 +测试moduleName值为testreport,method为空 >> 开始时间,结束时间,参与人员,总结 +测试moduleName值为testreport,method为create >> 开始时间,结束时间,参与人员,总结 +测试moduleName值为testreport,method为edit >> 开始时间,结束时间,参与人员,总结 +测试moduleName值为caselib,method为空 >> 描述 +测试moduleName值为caselib,method为create >> 描述 +测试moduleName值为caselib,method为edit >> 描述 +测试moduleName值为caselib,method为空 >> 负责人,优先级,描述 +测试moduleName值为testtask,method为create >> 负责人,优先级,描述 +测试moduleName值为testtask,method为edit >> 负责人,优先级,描述 +测试moduleName值为testtask,method为importUnit >> 负责人,优先级,描述 +测试moduleName值为doc,method为空 >> 关键字,文档正文 +测试moduleName值为doc,method为create >> 关键字,文档正文 +测试moduleName值为doc,method为edit >> 关键字,文档正文 +测试moduleName值为user,method为空 >> 0 +测试moduleName值为user,method为create >> 部门,职位,邮箱,源代码帐号 +测试moduleName值为user,method为edit >> Skype,QQ,手机,电话 + +*/ +$moduleName = array('product', 'story', 'productplan', 'release', 'execution', 'task', 'build', 'bug', 'testcase', 'testsuite', 'testreport', 'caselib', 'testtask', 'doc', 'user'); +$method = array('', 'create', 'edit', 'change', 'close', 'review', 'start', 'finish', 'activate', 'resolve', 'importUnit'); + +$custom = new customTest(); + +r($custom->getFormFieldsTest($moduleName[0], $method[0])) && p() && e('0'); //测试moduleName值为product,method为空 +r($custom->getFormFieldsTest($moduleName[0], $method[1])) && p('PO,QD,RD,type') && e('产品负责人,测试负责人,发布负责人,产品类型'); //测试moduleName值为product,method为create +r($custom->getFormFieldsTest($moduleName[0], $method[2])) && p('PO,QD,RD,type,status') && e('产品负责人,测试负责人,发布负责人,产品类型,状态');//测试moduleName值为product,method为edit +r($custom->getFormFieldsTest($moduleName[1], $method[0])) && p() && e('0'); //测试moduleName值为story,method为空 +r($custom->getFormFieldsTest($moduleName[1], $method[1])) && p('module,plan,source,pri') && e('所属模块,所属计划,来源,优先级'); //测试moduleName值为story,method为create +r($custom->getFormFieldsTest($moduleName[1], $method[3])) && p('comment') && e('备注'); //测试moduleName值为story,method为change +r($custom->getFormFieldsTest($moduleName[1], $method[4])) && p('comment') && e('备注'); //测试moduleName值为story,method为close +r($custom->getFormFieldsTest($moduleName[1], $method[5])) && p('reviewedDate,comment') && e('评审时间,备注'); //测试moduleName值为story,method为review +r($custom->getFormFieldsTest($moduleName[2], $method[0])) && p('begin,end,desc') && e('开始日期,结束日期,描述'); //测试moduleName值为productplan,method为空 +r($custom->getFormFieldsTest($moduleName[2], $method[1])) && p('begin,end,desc') && e('开始日期,结束日期,描述'); //测试moduleName值为productplan,method为create +r($custom->getFormFieldsTest($moduleName[2], $method[2])) && p('begin,end,desc') && e('开始日期,结束日期,描述'); //测试moduleName值为productplan,method为edit +r($custom->getFormFieldsTest($moduleName[3], $method[0])) && p() && e('0'); //测试moduleName值为release,method为空 +r($custom->getFormFieldsTest($moduleName[3], $method[1])) && p('desc') && e('描述'); //测试moduleName值为release,method为create +r($custom->getFormFieldsTest($moduleName[3], $method[2])) && p('desc') && e('描述'); //测试moduleName值为release,method为edit +r($custom->getFormFieldsTest($moduleName[4], $method[0])) && p() && e('0'); //测试moduleName值为execution,method为空 +r($custom->getFormFieldsTest($moduleName[4], $method[1])) && p('days,desc') && e('可用工作日,迭代描述'); //测试moduleName值为execution,method为create +r($custom->getFormFieldsTest($moduleName[4], $method[2])) && p('days,desc,PO,PM') && e('可用工作日,迭代描述,产品负责人,迭代负责人'); //测试moduleName值为execution,method为edit +r($custom->getFormFieldsTest($moduleName[4], $method[4])) && p() && e('0'); //测试moduleName值为execution,method为close +r($custom->getFormFieldsTest($moduleName[4], $method[6])) && p() && e('0'); //测试moduleName值为execution,method为start +r($custom->getFormFieldsTest($moduleName[5], $method[0])) && p() && e('0'); //测试moduleName值为task,method为空 +r($custom->getFormFieldsTest($moduleName[5], $method[1])) && p('story,pri,estimate,desc') && e('相关研发需求,优先级,最初预计,任务描述'); //测试moduleName值为task,method为create +r($custom->getFormFieldsTest($moduleName[5], $method[2])) && p('pri,estimate,estStarted') && e('优先级,最初预计,预计开始'); //测试moduleName值为task,method为edit +r($custom->getFormFieldsTest($moduleName[5], $method[7])) && p('comment') && e('备注'); //测试moduleName值为task,method为finish +r($custom->getFormFieldsTest($moduleName[5], $method[8])) && p('assignedTo,comment') && e('指派给,备注'); //测试moduleName值为task,method为activate +r($custom->getFormFieldsTest($moduleName[6], $method[0])) && p('scmPath,filePath,desc') && e('源代码地址,下载地址,描述'); //测试moduleName值为build,method为空 +r($custom->getFormFieldsTest($moduleName[6], $method[1])) && p('scmPath,filePath,desc') && e('源代码地址,下载地址,描述'); //测试moduleName值为build,method为create +r($custom->getFormFieldsTest($moduleName[6], $method[2])) && p('scmPath,filePath,desc') && e('源代码地址,下载地址,描述'); //测试moduleName值为build,method为edit +r($custom->getFormFieldsTest($moduleName[7], $method[0])) && p() && e('0'); //测试moduleName值为bug,method为空 +r($custom->getFormFieldsTest($moduleName[7], $method[1])) && p('module,project,deadline') && e('所属模块,所属项目,截止日期'); //测试moduleName值为bug,method为create +r($custom->getFormFieldsTest($moduleName[7], $method[2])) && p('plan,type,browser,pri') && e('所属计划,Bug类型,浏览器,优先级'); //测试moduleName值为bug,method为edit +r($custom->getFormFieldsTest($moduleName[7], $method[9])) && p('resolvedBuild,comment') && e('解决版本,备注'); //测试moduleName值为bug,method为resolve +r($custom->getFormFieldsTest($moduleName[8], $method[0])) && p() && e('0'); //测试moduleName值为testcase,method为空 +r($custom->getFormFieldsTest($moduleName[8], $method[1])) && p('stage,story,pri') && e('适用阶段,相关研发需求,优先级'); //测试moduleName值为testcase,method为create +r($custom->getFormFieldsTest($moduleName[8], $method[2])) && p('stage,story,pri') && e('适用阶段,相关研发需求,优先级'); //测试moduleName值为testcase,method为edit +r($custom->getFormFieldsTest($moduleName[9], $method[0])) && p('desc') && e('描述'); //测试moduleName值为testsuite,method为空 +r($custom->getFormFieldsTest($moduleName[9], $method[1])) && p('desc') && e('描述'); //测试moduleName值为testsuite,method为create +r($custom->getFormFieldsTest($moduleName[9], $method[2])) && p('desc') && e('描述'); //测试moduleName值为testsuite,method为edit +r($custom->getFormFieldsTest($moduleName[10], $method[0])) && p('begin,end,members,report') && e('开始时间,结束时间,参与人员,总结'); //测试moduleName值为testreport,method为空 +r($custom->getFormFieldsTest($moduleName[10], $method[1])) && p('begin,end,members,report') && e('开始时间,结束时间,参与人员,总结'); //测试moduleName值为testreport,method为create +r($custom->getFormFieldsTest($moduleName[10], $method[2])) && p('begin,end,members,report') && e('开始时间,结束时间,参与人员,总结'); //测试moduleName值为testreport,method为edit +r($custom->getFormFieldsTest($moduleName[11], $method[0])) && p('desc') && e('描述'); //测试moduleName值为caselib,method为空 +r($custom->getFormFieldsTest($moduleName[11], $method[1])) && p('desc') && e('描述'); //测试moduleName值为caselib,method为create +r($custom->getFormFieldsTest($moduleName[11], $method[2])) && p('desc') && e('描述'); //测试moduleName值为caselib,method为edit +r($custom->getFormFieldsTest($moduleName[12], $method[0])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为caselib,method为空 +r($custom->getFormFieldsTest($moduleName[12], $method[1])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为testtask,method为create +r($custom->getFormFieldsTest($moduleName[12], $method[2])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为testtask,method为edit +r($custom->getFormFieldsTest($moduleName[12], $method[10])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为testtask,method为importUnit +r($custom->getFormFieldsTest($moduleName[13], $method[0])) && p('keywords,content') && e('关键字,文档正文'); //测试moduleName值为doc,method为空 +r($custom->getFormFieldsTest($moduleName[13], $method[1])) && p('keywords,content') && e('关键字,文档正文'); //测试moduleName值为doc,method为create +r($custom->getFormFieldsTest($moduleName[13], $method[2])) && p('keywords,content') && e('关键字,文档正文'); //测试moduleName值为doc,method为edit +r($custom->getFormFieldsTest($moduleName[14], $method[0])) && p() && e('0'); //测试moduleName值为user,method为空 +r($custom->getFormFieldsTest($moduleName[14], $method[1])) && p('dept,role,email,commiter') && e('部门,职位,邮箱,源代码帐号'); //测试moduleName值为user,method为create +r($custom->getFormFieldsTest($moduleName[14], $method[2])) && p('skype,qq,mobile,phone') && e('Skype,QQ,手机,电话'); //测试moduleName值为user,method为edit \ No newline at end of file diff --git a/test/model/custom/getitems.php b/test/model/custom/getitems.php new file mode 100755 index 0000000000..0099f074e6 --- /dev/null +++ b/test/model/custom/getitems.php @@ -0,0 +1,35 @@ +#!/usr/bin/env php +getItems(); +cid=1 +pid=1 + +测试参数为空 >> zh-cn,custom,URSRList,1,1,rnd +测试参数为lang >> zh-cn,custom,URSRList,1,1,rnd +测试参数为lang,module >> zh-cn,custom,URSRList,1,1,rnd +测试参数为lang,key,section >> zh-cn,custom,URSRList,1,1,rnd +测试参数为lang,key,section,module >> zh-cn,custom,URSRList,1,1,rnd +测试参数为lang,key,section,module,vision >> zh-cn,custom,URSRList,1,1,rnd + +*/ +$lang = 'lang=zh-cn'; +$module = 'module=custom'; +$section = 'section=URSRList'; +$key = 'key=1'; +$vision = 'vision=rnd'; +$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision); + +$custom = new customTest(); + +r($custom->getItemsTest($paramString[0])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为空 +r($custom->getItemsTest($paramString[1])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang +r($custom->getItemsTest($paramString[2])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,module +r($custom->getItemsTest($paramString[3])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,key,section +r($custom->getItemsTest($paramString[4])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,key,section,module +r($custom->getItemsTest($paramString[5])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,key,section,module,vision \ No newline at end of file diff --git a/test/model/custom/getrequiredfields.php b/test/model/custom/getrequiredfields.php new file mode 100755 index 0000000000..634dd5649c --- /dev/null +++ b/test/model/custom/getrequiredfields.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getRequiredFields(); +cid=1 +pid=1 + + + +*/ + +$custom = new customTest(); + +r($custom->getRequiredFieldsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/custom/getsrpairs.php b/test/model/custom/getsrpairs.php new file mode 100755 index 0000000000..5fb2ae0396 --- /dev/null +++ b/test/model/custom/getsrpairs.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getSRPairs(); +cid=1 +pid=1 + +测试正常查询 >> 软件需求,研发需求,软需,故事,需求 + +*/ + +$custom = new customTest(); + +r($custom->getSRPairsTest()) && p('1,2,3,4,5') && e('软件需求,研发需求,软需,故事,需求'); //测试正常查询 \ No newline at end of file diff --git a/test/model/custom/geturpairs.php b/test/model/custom/geturpairs.php new file mode 100755 index 0000000000..953515421e --- /dev/null +++ b/test/model/custom/geturpairs.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getURPairs(); +cid=1 +pid=1 + +测试正常查询 >> 用户需求,用户需求,用需,史诗,用户需求 + +*/ + +$custom = new customTest(); + +r($custom->getURPairsTest()) && p('1,2,3,4,5') && e('用户需求,用户需求,用需,史诗,用户需求'); //测试正常查询 \ No newline at end of file diff --git a/test/model/custom/getursrlist.php b/test/model/custom/getursrlist.php new file mode 100755 index 0000000000..aed23b69cb --- /dev/null +++ b/test/model/custom/getursrlist.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getURSRList(); +cid=1 +pid=1 + +测试正常查询 >> 软件需求,用户需求,1 + +*/ + +$custom = new customTest(); + +r($custom->getURSRListTest()) && p('1:SRName,URName,system') && e('软件需求,用户需求,1'); //测试正常查询 \ No newline at end of file diff --git a/test/model/custom/getursrpairs.php b/test/model/custom/getursrpairs.php new file mode 100755 index 0000000000..14a71e5ab8 --- /dev/null +++ b/test/model/custom/getursrpairs.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getURSRPairs(); +cid=1 +pid=1 + +测试正常查询 >> 软件需求,研发需求,软需,故事,需求 + +*/ + +$custom = new customTest(); + +r($custom->getURSRPairsTest()) && p('1,2,3,4,5') && e('软件需求,研发需求,软需,故事,需求'); //测试正常查询 \ No newline at end of file diff --git a/test/model/custom/parseitemparam.php b/test/model/custom/parseitemparam.php new file mode 100755 index 0000000000..b9f01255da --- /dev/null +++ b/test/model/custom/parseitemparam.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +parseItemParam(); +cid=1 +pid=1 + +测试参数为空 >> ,,,, +测试参数为lang >> zh-cn,,,, +测试参数为lang,module >> zh-cn,custom,,, +测试参数为lang,key,section >> zh-cn,,URSRList,1, +测试参数为lang,key,section,module >> zh-cn,custom,URSRList,1, +测试参数为lang,key,section,module,vision >> zh-cn,custom,URSRList,1,rnd + +*/ + +$lang = 'lang=zh-cn'; +$module = 'module=custom'; +$section = 'section=URSRList'; +$key = 'key=1'; +$vision = 'vision=rnd'; +$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision); + +$custom = new customTest(); + +r($custom->parseItemParamTest($paramString[0])) && p('lang,module,section,key,vision') && e(',,,,'); //测试参数为空 +r($custom->parseItemParamTest($paramString[1])) && p('lang,module,section,key,vision') && e('zh-cn,,,,'); //测试参数为lang +r($custom->parseItemParamTest($paramString[2])) && p('lang,module,section,key,vision') && e('zh-cn,custom,,,'); //测试参数为lang,module +r($custom->parseItemParamTest($paramString[3])) && p('lang,module,section,key,vision') && e('zh-cn,,URSRList,1,'); //测试参数为lang,key,section +r($custom->parseItemParamTest($paramString[4])) && p('lang,module,section,key,vision') && e('zh-cn,custom,URSRList,1,'); //测试参数为lang,key,section,module +r($custom->parseItemParamTest($paramString[5])) && p('lang,module,section,key,vision') && e('zh-cn,custom,URSRList,1,rnd'); //测试参数为lang,key,section,module,vision \ No newline at end of file diff --git a/test/model/custom/preparesql.php b/test/model/custom/preparesql.php new file mode 100755 index 0000000000..8e7964c4ee --- /dev/null +++ b/test/model/custom/preparesql.php @@ -0,0 +1,50 @@ +#!/usr/bin/env php +prepareSQL(); +cid=1 +pid=1 + +测试method为select,paramString参数为空 >> zh-cn,custom +测试method为select,paramString参数为lang >> zh-cn,custom +测试method为select,paramString参数为lang,module >> zh-cn,custom +测试method为select,paramString参数为lang,key,section >> zh-cn,custom +测试method为select,paramString参数为lang,key,section,module >> zh-cn,custom +测试method为select,paramString参数为lang,key,section,module,vision >> zh-cn,custom +测试method为delete,paramString参数为空 >> 14 +测试method为delete,paramString参数为lang >> 0 +测试method为delete,paramString参数为lang,module >> 0 +测试method为delete,paramString参数为lang,key,section >> 0 +测试method为delete,paramString参数为lang,key,section,module >> 0 +测试method为delete,paramString参数为lang,key,section,module,vision >> 0 + +*/ + +$lang = 'lang=zh-cn'; +$module = 'module=custom'; +$section = 'section=URSRList'; +$key = 'key=1'; +$vision = 'vision=rnd'; +$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision); +$method = array('select', 'delete'); + +$custom = new customTest(); + +r($custom->prepareSQLTest($paramString[0], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为空 +r($custom->prepareSQLTest($paramString[1], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang +r($custom->prepareSQLTest($paramString[2], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,module +r($custom->prepareSQLTest($paramString[3], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,key,section +r($custom->prepareSQLTest($paramString[4], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,key,section,module +r($custom->prepareSQLTest($paramString[5], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,key,section,module,vision +r($custom->prepareSQLTest($paramString[0], $method[1])) && p() && e('14'); //测试method为delete,paramString参数为空 +r($custom->prepareSQLTest($paramString[1], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang +r($custom->prepareSQLTest($paramString[2], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,module +r($custom->prepareSQLTest($paramString[3], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,key,section +r($custom->prepareSQLTest($paramString[4], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,key,section,module +r($custom->prepareSQLTest($paramString[5], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,key,section,module,vision +system("./ztest init"); \ No newline at end of file diff --git a/test/model/custom/savecustommenu.php b/test/model/custom/savecustommenu.php new file mode 100755 index 0000000000..347a96cce1 --- /dev/null +++ b/test/model/custom/savecustommenu.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +saveCustomMenu(); +cid=1 +pid=1 + + + +*/ + +$custom = new customTest(); + +r($custom->saveCustomMenuTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/custom/saverequiredfields.php b/test/model/custom/saverequiredfields.php new file mode 100755 index 0000000000..d52f33a695 --- /dev/null +++ b/test/model/custom/saverequiredfields.php @@ -0,0 +1,149 @@ +#!/usr/bin/env php +saveRequiredFields(); +cid=1 +pid=1 + +测试moduleName为product,requiredFields为空 >> name,code +测试moduleName为product,requiredFields中的create存在一个值 >> PO,name,code +测试moduleName为product,requiredFields中的create存在多个值 >> PO,RD,name,code +测试moduleName为product,requiredFields中的edit存在一个值 >> PO,name,code +测试moduleName为product,requiredFields中的edit存在多个值 >> PO,RD,name,code +测试moduleName为product,requiredFields中的create,edit各存在多个值 >> PO,RD,name,code +测试moduleName为release,requiredFields为空 >> name,date +测试moduleName为release,requiredFields中的create存在一个值 >> desc,name,date +测试moduleName为release,requiredFields中的rdit存在一个值 >> desc,name,date +测试moduleName为release,requiredFields中的create,edit各存在一个值 >> desc,name,date +测试moduleName为execution,requiredFields为空 >> name,code,begin,end +测试moduleName为execution,requiredFields中的create存在一个值 >> desc,name,code,begin,end +测试moduleName为execution,requiredFields中的create存在多个值 >> desc,days,name,code,begin,end +测试moduleName为execution,requiredFields中的edit存在一个值 >> desc,name,code,begin,end +测试moduleName为execution,requiredFields中的edit存在多个值 >> desc,days,name,code,begin,end +测试moduleName为execution,requiredFields中的create,edit各存在多个值 >> desc,days,name,code,begin,end +测试moduleName为task,requiredFields为空 >> execution,name,type +测试moduleName为task,requiredFields中的create存在一个值 >> story,execution,name,type +测试moduleName为task,requiredFields中的create存在多个值 >> story,desc,execution,name,type +测试moduleName为task,requiredFields中的edit存在一个值 >> pri,execution,name,type +测试moduleName为task,requiredFields中的edit存在多个值 >> pri,estimate,execution,name,type +测试moduleName为task,requiredFields中的activate存在一个值 >> comment,left +测试moduleName为task,requiredFields中的activate存在多个值 >> comment,assignedTo,left +测试moduleName为task,requiredFields中的create,edit各存在一个值 >> story,execution,name,type +测试moduleName为task,requiredFields中的create,edit,finsh各存在一个值 >> story,execution,name,type +测试moduleName为task,requiredFields中的create,edit,finsh,activate各存在一个值 >> story,execution,name,type +测试moduleName为bug,requiredFields为空 >> title,openedBuild +测试moduleName为bug,requiredFields中的create存在一个值 >> type,title,openedBuild +测试moduleName为bug,requiredFields中的create存在多个值 >> type,os,title,openedBuild +测试moduleName为bug,requiredFields中的edit存在一个值 >> plan,title,openedBuild +测试moduleName为bug,requiredFields中的edit存在多个值 >> plan,type,title,openedBuild +测试moduleName为bug,requiredFields中的resolve存在一个值 >> comment,resolution +测试moduleName为bug,requiredFields中的resolve存在多个值 >> comment,assignedTo,resolution +测试moduleName为bug,requiredFields中的create,edit各存在一个值 >> type,title,openedBuild +测试moduleName为bug,requiredFields中的create,edit,resolve各存在一个值 >> type,title,openedBuild +测试moduleName为testcase,requiredFields为空 >> title,type +测试moduleName为testcase,requiredFields中的create存在一个值 >> stage,title,type +测试moduleName为testcase,requiredFields中的create存在多个值 >> stage,story,title,type +测试moduleName为testcase,requiredFields中的edit存在一个值 >> stage,title,type +测试moduleName为testcase,requiredFields中的edit存在多个值 >> stage,story,title,type +测试moduleName为testcase,requiredFields中的create,edit各存在多个值 >> stage,story,title,type +测试moduleName为task,requiredFields中的finish存在一个值 >> comment,realStarted,finishedDate,currentConsumed + +*/ +$moduleName = array('product', 'release', 'execution', 'task', 'bug', 'testcase'); +$fieldsType = array('create', 'edit', 'finish', 'activate', 'resolve'); +$requiredFields = array( + 'productFields1' => array(), + 'productFields2' => array('requiredFields' => array('create' => array('PO'))), + 'productFields3' => array('requiredFields' => array('create' => array('PO', 'RD'))), + 'productFields4' => array('requiredFields' => array('edit' => array('PO'))), + 'productFields5' => array('requiredFields' => array('edit' => array('PO', 'RD'))), + 'productFields6' => array('requiredFields' => array('create' => array('PO', 'RD'), 'edit' => array('PO', 'RD'))), + 'releaseFields1' => array(), + 'releaseFields2' => array('requiredFields' => array('create' => array('desc'))), + 'releaseFields3' => array('requiredFields' => array('edit' => array('desc'))), + 'releaseFields4' => array('requiredFields' => array('create' => array('desc'), 'edit' => array('desc'))), + 'executionFields1' => array(), + 'executionFields2' => array('requiredFields' => array('create' => array('desc'))), + 'executionFields3' => array('requiredFields' => array('create' => array('desc', 'days'))), + 'executionFields4' => array('requiredFields' => array('edit' => array('desc'))), + 'executionFields5' => array('requiredFields' => array('edit' => array('desc', 'days'))), + 'executionFields6' => array('requiredFields' => array('create' => array('desc', 'days'), 'edit' => array('desc', 'days'))), + 'taskFields1' => array(), + 'taskFields2' => array('requiredFields' => array('create' => array('story'))), + 'taskFields3' => array('requiredFields' => array('create' => array('story', 'desc'))), + 'taskFields4' => array('requiredFields' => array('edit' => array('pri'))), + 'taskFields5' => array('requiredFields' => array('edit' => array('pri', 'estimate'))), + 'taskFields6' => array('requiredFields' => array('finish' => array('comment'))), + 'taskFields7' => array('requiredFields' => array('activate' => array('comment'))), + 'taskFields8' => array('requiredFields' => array('activate' => array('comment', 'assignedTo'))), + 'taskFields9' => array('requiredFields' => array('create' => array('story'), 'edit' => array('pri'))), + 'taskFields10' => array('requiredFields' => array('create' => array('story'), 'edit' => array('pri'), 'finsh' => array('comment'))), + 'taskFields11' => array('requiredFields' => array('create' => array('story'), 'edit' => array('pri'), 'finsh' => array('comment'), 'activate' => array('comment'))), + 'bugFields1' => array(), + 'bugFields2' => array('requiredFields' => array('create' => array('type'))), + 'bugFields3' => array('requiredFields' => array('create' => array('type', 'os'))), + 'bugFields4' => array('requiredFields' => array('edit' => array('plan'))), + 'bugFields5' => array('requiredFields' => array('edit' => array('plan', 'type'))), + 'bugFields6' => array('requiredFields' => array('resolve' => array('comment'))), + 'bugFields7' => array('requiredFields' => array('resolve' => array('comment', 'assignedTo'))), + 'bugFields8' => array('requiredFields' => array('create' => array('type'), 'edit' => array('plan'))), + 'bugFields9' => array('requiredFields' => array('create' => array('type'), 'edit' => array('plan'), 'resolve' => array('comment'))), + 'testcaseFields1' => array(), + 'testcaseFields2' => array('requiredFields' => array('create' => array('stage'))), + 'testcaseFields3' => array('requiredFields' => array('create' => array('stage', 'story'))), + 'testcaseFields4' => array('requiredFields' => array('edit' => array('stage'))), + 'testcaseFields5' => array('requiredFields' => array('edit' => array('stage', 'story'))), + 'testcaseFields6' => array('requiredFields' => array('create' => array('stage', 'story'), 'edit' => array('stage', 'story'))), +); + +$custom = new customTest(); + +r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields1'], $fieldsType[0])) && p('value') && e('name,code'); //测试moduleName为product,requiredFields为空 +r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields2'], $fieldsType[0])) && p('value') && e('PO,name,code'); //测试moduleName为product,requiredFields中的create存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields3'], $fieldsType[0])) && p('value') && e('PO,RD,name,code'); //测试moduleName为product,requiredFields中的create存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields4'], $fieldsType[1])) && p('value') && e('PO,name,code'); //测试moduleName为product,requiredFields中的edit存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields5'], $fieldsType[1])) && p('value') && e('PO,RD,name,code'); //测试moduleName为product,requiredFields中的edit存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields6'], $fieldsType[0])) && p('value') && e('PO,RD,name,code'); //测试moduleName为product,requiredFields中的create,edit各存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields1'], $fieldsType[0])) && p('value') && e('name,date'); //测试moduleName为release,requiredFields为空 +r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields2'], $fieldsType[0])) && p('value') && e('desc,name,date'); //测试moduleName为release,requiredFields中的create存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields3'], $fieldsType[1])) && p('value') && e('desc,name,date'); //测试moduleName为release,requiredFields中的rdit存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields4'], $fieldsType[0])) && p('value') && e('desc,name,date'); //测试moduleName为release,requiredFields中的create,edit各存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields1'], $fieldsType[0])) && p('value') && e('name,code,begin,end'); //测试moduleName为execution,requiredFields为空 +r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields2'], $fieldsType[0])) && p('value') && e('desc,name,code,begin,end'); //测试moduleName为execution,requiredFields中的create存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields3'], $fieldsType[0])) && p('value') && e('desc,days,name,code,begin,end'); //测试moduleName为execution,requiredFields中的create存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields4'], $fieldsType[1])) && p('value') && e('desc,name,code,begin,end'); //测试moduleName为execution,requiredFields中的edit存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields5'], $fieldsType[1])) && p('value') && e('desc,days,name,code,begin,end'); //测试moduleName为execution,requiredFields中的edit存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields6'], $fieldsType[0])) && p('value') && e('desc,days,name,code,begin,end'); //测试moduleName为execution,requiredFields中的create,edit各存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields1'], $fieldsType[0])) && p('value') && e('execution,name,type'); //测试moduleName为task,requiredFields为空 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields2'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields3'], $fieldsType[0])) && p('value') && e('story,desc,execution,name,type'); //测试moduleName为task,requiredFields中的create存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields4'], $fieldsType[1])) && p('value') && e('pri,execution,name,type'); //测试moduleName为task,requiredFields中的edit存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields5'], $fieldsType[1])) && p('value') && e('pri,estimate,execution,name,type'); //测试moduleName为task,requiredFields中的edit存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields7'], $fieldsType[3])) && p('value') && e('comment,left'); //测试moduleName为task,requiredFields中的activate存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields8'], $fieldsType[3])) && p('value') && e('comment,assignedTo,left'); //测试moduleName为task,requiredFields中的activate存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields9'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create,edit各存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields10'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create,edit,finsh各存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields11'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create,edit,finsh,activate各存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields1'], $fieldsType[0])) && p('value') && e('title,openedBuild'); //测试moduleName为bug,requiredFields为空 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields2'], $fieldsType[0])) && p('value') && e('type,title,openedBuild'); //测试moduleName为bug,requiredFields中的create存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields3'], $fieldsType[0])) && p('value') && e('type,os,title,openedBuild'); //测试moduleName为bug,requiredFields中的create存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields4'], $fieldsType[1])) && p('value') && e('plan,title,openedBuild'); //测试moduleName为bug,requiredFields中的edit存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields5'], $fieldsType[1])) && p('value') && e('plan,type,title,openedBuild'); //测试moduleName为bug,requiredFields中的edit存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields6'], $fieldsType[4])) && p('value') && e('comment,resolution'); //测试moduleName为bug,requiredFields中的resolve存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields7'], $fieldsType[4])) && p('value') && e('comment,assignedTo,resolution'); //测试moduleName为bug,requiredFields中的resolve存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields8'], $fieldsType[0])) && p('value') && e('type,title,openedBuild'); //测试moduleName为bug,requiredFields中的create,edit各存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields9'], $fieldsType[0])) && p('value') && e('type,title,openedBuild'); //测试moduleName为bug,requiredFields中的create,edit,resolve各存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields1'], $fieldsType[0])) && p('value') && e('title,type'); //测试moduleName为testcase,requiredFields为空 +r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields2'], $fieldsType[0])) && p('value') && e('stage,title,type'); //测试moduleName为testcase,requiredFields中的create存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields3'], $fieldsType[0])) && p('value') && e('stage,story,title,type'); //测试moduleName为testcase,requiredFields中的create存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields4'], $fieldsType[1])) && p('value') && e('stage,title,type'); //测试moduleName为testcase,requiredFields中的edit存在一个值 +r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields5'], $fieldsType[1])) && p('value') && e('stage,story,title,type'); //测试moduleName为testcase,requiredFields中的edit存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields6'], $fieldsType[0])) && p('value') && e('stage,story,title,type'); //测试moduleName为testcase,requiredFields中的create,edit各存在多个值 +r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields6'], $fieldsType[2])) && p('value') && e('comment,realStarted,finishedDate,currentConsumed');//测试moduleName为task,requiredFields中的finish存在一个值 + +system('./ztest init'); \ No newline at end of file diff --git a/test/model/custom/setconcept.php b/test/model/custom/setconcept.php new file mode 100755 index 0000000000..6f22e6e75e --- /dev/null +++ b/test/model/custom/setconcept.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +setConcept(); +cid=1 +pid=1 + +测试sprintConcept值为0,编辑为产品 - 项目 >> 45 +测试sprintConcept值为1,编辑为产品 - 迭代 >> 45 +测试sprintConcept值为2,编辑为产品 - 冲刺 >> 45 + +*/ +$sprintConcept = array('0', '1', '2'); + +$custom = new customTest(); + +r($custom->setConceptTest($sprintConcept[0])) && p('id') && e('45'); //测试sprintConcept值为0,编辑为产品 - 项目 +r($custom->setConceptTest($sprintConcept[1])) && p('id') && e('45'); //测试sprintConcept值为1,编辑为产品 - 迭代 +r($custom->setConceptTest($sprintConcept[2])) && p('id') && e('45'); //测试sprintConcept值为2,编辑为产品 - 冲刺 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/custom/setitem.php b/test/model/custom/setitem.php new file mode 100755 index 0000000000..d598e278f8 --- /dev/null +++ b/test/model/custom/setitem.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +setItem(); +cid=1 +pid=1 + +测试path中.出现的个数为0,value正常存在,不能保存 >> 0 +测试path中.出现的个数为1,value正常存在,不能保存 >> 0 +测试path中.出现的个数为2,value正常存在,能保存 >> zh-cn,story,categoryList,功能 +测试path中.出现的个数为2,value为空,能保存 >> zh-cn,story,categoryList, +测试path中.出现的个数为3,value正常存在,能保存 >> zh-cn,story,feature,功能 +测试path中.出现的个数为3,value为空,能保存 >> zh-cn,story,feature, +测试path中.出现的个数为4,value正常存在,能保存 >> zh-cn,story,feature,功能 +测试path中.出现的个数为5,value为空,能保存 >> zh-cn,story,feature, + +*/ +$path = array('zh-cn', 'zh-cn.story', 'zh-cn.story.categoryList', 'zh-cn.story.categoryList.feature', 'zh-cn.story.categoryList.feature.1'); +$value = array('功能', ''); + +$custom = new customTest(); + +r($custom->setItemTest($path[0], $value[0])) && p() && e('0'); //测试path中.出现的个数为0,value正常存在,不能保存 +r($custom->setItemTest($path[1], $value[0])) && p() && e('0'); //测试path中.出现的个数为1,value正常存在,不能保存 +r($custom->setItemTest($path[2], $value[0])) && p('lang,module,key,value') && e('zh-cn,story,categoryList,功能'); //测试path中.出现的个数为2,value正常存在,能保存 +r($custom->setItemTest($path[2], $value[1])) && p('lang,module,key,value') && e('zh-cn,story,categoryList,'); //测试path中.出现的个数为2,value为空,能保存 +r($custom->setItemTest($path[3], $value[0])) && p('lang,module,key,value') && e('zh-cn,story,feature,功能'); //测试path中.出现的个数为3,value正常存在,能保存 +r($custom->setItemTest($path[3], $value[1])) && p('lang,module,key,value') && e('zh-cn,story,feature,'); //测试path中.出现的个数为3,value为空,能保存 +r($custom->setItemTest($path[4], $value[0])) && p('lang,module,key,value') && e('zh-cn,story,feature,功能'); //测试path中.出现的个数为4,value正常存在,能保存 +r($custom->setItemTest($path[4], $value[1])) && p('lang,module,key,value') && e('zh-cn,story,feature,'); //测试path中.出现的个数为5,value为空,能保存 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/custom/setstoryrequirement.php b/test/model/custom/setstoryrequirement.php new file mode 100755 index 0000000000..93930aaffc --- /dev/null +++ b/test/model/custom/setstoryrequirement.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +setStoryRequirement(); +cid=1 +pid=1 + + + +*/ + +$custom = new customTest(); + +r($custom->setStoryRequirementTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/custom/seturandsr.php b/test/model/custom/seturandsr.php new file mode 100755 index 0000000000..6945c0d134 --- /dev/null +++ b/test/model/custom/seturandsr.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +setURAndSR(); +cid=1 +pid=1 + +测试SRName值为空 >> 1 +测试SRName值有一个 >> 1 +测试SRName值有多个 >> 1 + +*/ +$SRName = array( + '0' => array('SRName' => array('')), + '1' => array('SRName' => array('测试需求')), + '2' => array('SRName' => array('测试需求', '用户需求')) +); + +$custom = new customTest(); + +r($custom->setURAndSRTest($SRName[0])) && p() && e('1'); //测试SRName值为空 +r($custom->setURAndSRTest($SRName[1])) && p() && e('1'); //测试SRName值有一个 +r($custom->setURAndSRTest($SRName[2])) && p() && e('1'); //测试SRName值有多个 +system("./ztest init"); \ No newline at end of file diff --git a/test/model/custom/updateurandsr.php b/test/model/custom/updateurandsr.php new file mode 100755 index 0000000000..10f975e9f2 --- /dev/null +++ b/test/model/custom/updateurandsr.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +updateURAndSR(); +cid=1 +pid=1 + +测试修改key为1,SRName值更改为空 >> {"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"} +测试修改key为1,SRName值更改为软件需求 >> {"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"} +测试修改key为1,SRName值更改为软件需求1 >> {"SRName":"\u8f6f\u4ef6\u9700\u6c421","URName":"\u7528\u6237\u9700\u6c42"} +测试修改key为0,SRName值更改为空 >> 0 +测试修改key为0,SRName值更改为软件需求 >> 0 +测试修改key为0,SRName值更改为软件需求1 >> 0 + +*/ +$key = array(1, 0); +$SRName = array('', '软件需求', '软件需求1'); + +$custom = new customTest(); + +r($custom->updateURAndSRTest($key[0], $SRName[0])) && p('value') && e('{"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"}'); //测试修改key为1,SRName值更改为空 +r($custom->updateURAndSRTest($key[0], $SRName[1])) && p('value') && e('{"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"}'); //测试修改key为1,SRName值更改为软件需求 +r($custom->updateURAndSRTest($key[0], $SRName[2])) && p('value') && e('{"SRName":"\u8f6f\u4ef6\u9700\u6c421","URName":"\u7528\u6237\u9700\u6c42"}'); //测试修改key为1,SRName值更改为软件需求1 +r($custom->updateURAndSRTest($key[1], $SRName[0])) && p() && e('0'); //测试修改key为0,SRName值更改为空 +r($custom->updateURAndSRTest($key[1], $SRName[1])) && p() && e('0'); //测试修改key为0,SRName值更改为软件需求 +r($custom->updateURAndSRTest($key[1], $SRName[2])) && p() && e('0'); //测试修改key为0,SRName值更改为软件需求1 + +system("./ztest init"); \ No newline at end of file From 2bede46847f01a9259ef9d06983217dbd8723747 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Fri, 8 Apr 2022 08:51:21 +0800 Subject: [PATCH 015/181] * modify version name --- module/misc/view/about.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/misc/view/about.html.php b/module/misc/view/about.html.php index 4ec7e47751..e3ed7a5849 100644 --- a/module/misc/view/about.html.php +++ b/module/misc/view/about.html.php @@ -11,7 +11,7 @@ logoImg;?>' />

          visions, ',') == 'lite'):?> - misc->zentao->version, $config->liteVersion); ?> + liteName.$config->liteVersion; ?> misc->zentao->version, $config->version); ?> From e55a88b34b0de342487c5e8c21a4df5bebbea943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Fri, 8 Apr 2022 09:16:57 +0800 Subject: [PATCH 016/181] * Finish project test. --- test/class/project.class.php | 265 -------------------- test/model/project/checkcanchangemodel.php | 18 ++ test/model/project/close.php | 11 +- test/model/project/computerprogress.php | 23 ++ test/model/project/getdatabyproject.php | 40 --- test/model/project/getmembers2import.php | 20 ++ test/model/project/getstats.php | 26 +- test/model/project/getstats4kanban.php | 21 ++ test/model/project/getteammemberpairs.php | 16 +- test/model/project/getteammembers.php | 11 +- test/model/project/managemembers.php | 29 +++ test/model/project/unlinkmember.php | 25 ++ test/model/project/updateproductprogram.php | 28 +++ test/model/project/updateproducts.php | 29 +++ 14 files changed, 228 insertions(+), 334 deletions(-) create mode 100644 test/model/project/checkcanchangemodel.php create mode 100644 test/model/project/computerprogress.php delete mode 100755 test/model/project/getdatabyproject.php create mode 100644 test/model/project/getmembers2import.php create mode 100644 test/model/project/getstats4kanban.php create mode 100644 test/model/project/managemembers.php create mode 100644 test/model/project/unlinkmember.php create mode 100644 test/model/project/updateproductprogram.php create mode 100644 test/model/project/updateproducts.php diff --git a/test/class/project.class.php b/test/class/project.class.php index 8960264c54..dae625653c 100644 --- a/test/class/project.class.php +++ b/test/class/project.class.php @@ -15,126 +15,6 @@ class Project $this->project = $tester->loadModel('project'); } - /** - * checkStatus - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function checkStatus($projectID) - { - $oldProject = $this->project->getById($projectID); - if($oldProject->status != 'closed') return false; - - $change = $this->project->activate($projectID); - - $project = $this->project->getById($projectID); - if($project->status != 'doing') return false; - - return true; - } - - /** - * checkStatusOff - * - * @param int mixed $projectID - * @param array $closeTime - * @access public - * @return void - */ - public function checkStatusOff($projectID, $closeTime = array()) - { - $checkStatus = array(); - $closeEnd = array('realEnd' => ''); - foreach($closeEnd as $filed => $defaultValue) $_POST[$filed] = $defaultValue; - foreach($closeTime as $key => $value) $_POST[$key] = $value; - - $oldProject = $this->project->getById($projectID); - if($oldProject->status == 'suspended' or $oldProject->status == 'closed') return false; - - $change = $this->project->close($projectID); - - $project = $this->project->getById($projectID); - if($project->status != 'closed') return false; - - return true; - } - - /** - * getListByOrder - * - * @param string mixed $orderBy - * @access public - * @return void - */ - public function getListByOrder($orderBy) - { - $projects = $this->project->getOverviewList('byStatus', 'wait', $orderBy); - return checkOrder($projects, $orderBy); - } - - /** - * getByID - * - * @param mixed $projectID - * @access public - * @return void - */ - public function getByID($projectID) - { - return $this->project->getOverviewList('byID', $projectID); - } - - /** - * getTeamMemberPairs - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function getTeamMemberPairs($projectID) - { - $members = array_filter($this->project->getTeamMemberPairs($projectID)); - if(empty($members)) return false; - return count($members); - } - - /** - * checkMembers - * - * @param int mixed $members - * @param string mixed $users - * @access public - * @return void - */ - public function checkMembers($members, $users) - { - foreach($users as $user) - { - if(!isset($members[$user])) return false; - } - return true; - } - - /** - * getTeamMembers - * - * @param int mixed $projectID - * @param striong mixed $users - * @param boolean mixed $tutorial - * @access public - * @return void - */ - public function getTeamMembers($projectID, $users, $tutorial = false) - { - if($tutorial) define('TUTORIAL', true); - $members = $this->project->getTeamMembers($projectID); - if(empty($members)) return false; - if(!empty($users)) $this->checkMembers($members, $users); - return count($members); - } - /** * Test start a project. * @@ -153,137 +33,6 @@ class Project return $this->project->getById($projectID); } - /** - * checkStatusStop - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function checkStatusStop($projectID) - { - $oldProject = $this->project->getById($projectID); - if($oldProject->status == 'suspended' or $oldProject->status == 'closed') return false; - - $change = $this->project->suspend($projectID); - $project = $this->project->getById($projectID); - if($project->status != 'suspended') return false; - - return true; - } - - /** - * getExecutionData - * - * @param int mixed $projectID - * @param string $type - * @access public - * @return void - */ - public function getExecutionData($projectID, $type = '') - { - $table = 'zt_project'; - $executions = $this->project->getDataByProject($table, $projectID, $type); - if(empty($executions)) return false; - return $executions; - } - - /** - * getBuildData - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function getBuildData($projectID) - { - $builds = $this->project->getDataByProject(TABLE_BUILD, $projectID); - if(empty($builds)) return false; - return $builds; - } - - /** - * getReleaseData - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function getReleaseData($projectID) - { - $releases = $this->project->getDataByProject(TABLE_RELEASE, $projectID); - if(empty($releases)) return false; - return $releases; - } - - /** - * getByStatusExe - * - * @param string mixed $status - * @access public - * @return void - */ - public function getByStatusExe($status) - { - $executions = $this->project->getStats(0, $status); - if(empty($executions)) return false; - if($status != 'all') - { - foreach($executions as $execution) - { - if($execution->status != $status) return false; - } - } - return count($executions); - } - - /** - * getByProject - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function getByProject($projectID) - { - $executions = $this->project->getStats($projectID, 'all'); - if(empty($executions)) return false; - foreach($executions as $execution) - { - if($execution->project != $projectID) return false; - } - return count($executions); - } - - /** - * getStatData - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function getStatData($projectID) - { - $projects = $this->project->getStatData($projectID); - return $projects; - } - - /** - * getTotalStoriesByProject - * - * @param int $projectID - * @param array $productIdList - * @param string $type - * @param string $status - * @access public - * @return void - */ - public function getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all') - { - $projects = $this->project->getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all'); - return $projects; - } - /** * Test create project. * @@ -339,18 +88,4 @@ class Project return $this->project->getByIdList($data['projectIdList']); } - - /** - * saveState - * - * @param int mixed $projectID - * @access public - * @return void - */ - public function saveState($projectID) - { - $projects = $this->project->getPairsByProgram(); - $object = $this->project->saveState($projectID, $projects); - return $object; - } } diff --git a/test/model/project/checkcanchangemodel.php b/test/model/project/checkcanchangemodel.php new file mode 100644 index 0000000000..5188fb328d --- /dev/null +++ b/test/model/project/checkcanchangemodel.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +checkCanChangeModel(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); + +r($tester->project->checkCanChangeModel(11, 'scrum')) && p() && e('0'); // 查看ID为11的敏捷项目是否可切换项目管理模型 +r($tester->project->checkCanChangeModel(41, 'waterfall')) && p() && e('0'); // 查看ID为41的瀑布项目是否可切换项目管理模型 diff --git a/test/model/project/close.php b/test/model/project/close.php index 9ee0f3e5b0..5c99ab39d0 100755 --- a/test/model/project/close.php +++ b/test/model/project/close.php @@ -18,14 +18,13 @@ pid=1 global $tester; $tester->loadModel('project'); -$closeId = array(20, 26, 41); $_POST['realEnd'] = '2022-03-11'; -$changes1 = $tester->project->close(20); +$changes1 = $tester->project->close(19); $changes2 = $tester->project->close(26); -$changes3 = $tester->project->close(41); +$changes3 = $tester->project->close(33); -r($changes1) && p() && e('1'); //关闭id为20状态不是closed的项目 -r($changes2) && p() && e('0'); //关闭id为26状态是closed的项目 -r($changes3) && p() && e('0'); //关闭id为41状态是suspended的项目 +r($changes1) && p('1:field,old,new') && e('status,wait,closed'); // 关闭id为20状态不是closed的项目 +r($changes2) && p('1:field,old,new') && e('closedBy,,admin'); // 关闭id为26状态是closed的项目 +r($changes3) && p('1:field,old,new') && e('status,suspended,closed'); // 关闭id为41状态是suspended的项目 system("./ztest init"); diff --git a/test/model/project/computerprogress.php b/test/model/project/computerprogress.php new file mode 100644 index 0000000000..7bec97055a --- /dev/null +++ b/test/model/project/computerprogress.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +computerProgress(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); +$tester->loadModel('execution'); + +$executions = $tester->execution->getList(11); +$executions = $tester->project->computerProgress($executions); + +r(count($executions)) && p('') && e('7'); // 查看项目11下的所有执行的数量 +r($executions) && p('551:totalEstimate,totalConsumed,totalLeft,progress,totalReal') && e('10,3,10,23.08,13'); // 查看计算后的执行工时汇总信息 +r($executions) && p('641:totalEstimate,totalConsumed,totalLeft,progress,totalReal') && e('1,3,1,75,4'); // 查看计算后的执行工时汇总信息 diff --git a/test/model/project/getdatabyproject.php b/test/model/project/getdatabyproject.php deleted file mode 100755 index 59c46ee40b..0000000000 --- a/test/model/project/getdatabyproject.php +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env php -> 129 -获取parent为11的首个项目的id >> 130 -获取parent为11的首个项目的id >> 131 -获取parent为10000的首个项目的id >> 0 -获取parent为131的首个版本的id >> 1 -获取parent为132的首个版本的id >> 6 -获取parent为10000的首个版本的id >> 0 -获取parent为132的首个发布的id >> 1 -获取parent为132的首个发布的id >> 6 -获取parent为10000的首个发布的id >> 0 - -*/ - -/* 还有case bug testtask doc表要写,暂时表中没数据 */ - -$t = new Project('admin'); - -$PID = array(39, 40, 'sprint', 41, 'stage', 10000, 131, 132, 10000, 131, 132, 10000); - -r($t->getExecutionData($PID[0])) && p('id') && e('129'); //获取parent为11首个项目的id -r($t->getExecutionData($PID[1], $PID[2])) && p('id') && e('130'); //获取parent为11的首个项目的id -r($t->getExecutionData($PID[3], $PID[4])) && p('id') && e('131'); //获取parent为11的首个项目的id -r($t->getExecutionData($PID[5])) && p('id') && e('0'); //获取parent为10000的首个项目的id -r($t->getBuildData($PID[6])) && p('id') && e('1'); //获取parent为131的首个版本的id -r($t->getBuildData($PID[7])) && p('id') && e('6'); //获取parent为132的首个版本的id -r($t->getBuildData($PID[8])) && p('id') && e('0'); //获取parent为10000的首个版本的id -r($t->getReleaseData($PID[9])) && p('id') && e('1'); //获取parent为132的首个发布的id -r($t->getReleaseData($PID[10])) && p('id') && e('6'); //获取parent为132的首个发布的id -r($t->getReleaseData($PID[11])) && p('id') && e('0'); //获取parent为10000的首个发布的id \ No newline at end of file diff --git a/test/model/project/getmembers2import.php b/test/model/project/getmembers2import.php new file mode 100644 index 0000000000..eaa12278e9 --- /dev/null +++ b/test/model/project/getmembers2import.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php +getMembers2Import(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); + +$members = $tester->project->getMembers2Import(11, array('admin')); + +r(count($members)) && p() && e('1'); // 获取id为11的项目团队成员个数,排除admin +r($members) && p('pm92:role') && e('产品经理92'); // 获取id为11的项目团队成员的角色 diff --git a/test/model/project/getstats.php b/test/model/project/getstats.php index b182cee1b1..a6871ce083 100755 --- a/test/model/project/getstats.php +++ b/test/model/project/getstats.php @@ -1,11 +1,11 @@ #!/usr/bin/env php getStats(); cid=1 pid=1 @@ -18,13 +18,21 @@ pid=1 */ -$t = new Project('admin'); +global $tester; +$tester->loadModel('project'); $OpenImplement = array('all', 'undone', 'doing', 'wait', '11', '12'); -r($t->getByStatusExe($OpenImplement[0])) && p() && e('630'); //查看所有执行 -r($t->getByStatusExe($OpenImplement[1])) && p() && e('0'); //查看未完成的执行 -r($t->getByStatusExe($OpenImplement[2])) && p() && e('315'); //查看所有进行中的执行 -r($t->getByStatusExe($OpenImplement[3])) && p() && e('315'); //查看所有进行中的执行 -r($t->getByProject($OpenImplement[4])) && p() && e('7'); //查看id为11项目的执行 -r($t->getByProject($OpenImplement[5])) && p() && e('7'); //查看id为12项目的执行 \ No newline at end of file +$allExecutions = $tester->project->getStats(0, 'all'); +$undoneExecutions = $tester->project->getStats(0, 'undone'); +$doingExecutions = $tester->project->getStats(0, 'doing'); +$waitExecutions = $tester->project->getStats(0, 'wait'); +$project11Executions = $tester->project->getStats(11); +$project12Executions = $tester->project->getStats(12); + +r(count($allExecutions)) && p() && e('630'); // 查看所有执行数量 +r(count($undoneExecutions)) && p() && e('630'); // 查看未完成的执行数量 +r(count($doingExecutions)) && p() && e('315'); // 查看所有进行中的执行数量 +r(count($waitExecutions)) && p() && e('315'); // 查看所有进行中的执行数量 +r(count($project11Executions)) && p() && e('7'); // 查看id为11项目的执行数量 +r(count($project12Executions)) && p() && e('7'); // 查看id为12项目的执行数量 diff --git a/test/model/project/getstats4kanban.php b/test/model/project/getstats4kanban.php new file mode 100644 index 0000000000..f7cf3107a0 --- /dev/null +++ b/test/model/project/getstats4kanban.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getStats4Kanban(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); +$kanbanGroup = $tester->project->getStats4Kanban(); + +r(count($kanbanGroup['kanbanGroup'])) && p() && e('2'); //统计获取到的看板数据的分组数量 +r(count($kanbanGroup['kanbanGroup']['other'])) && p() && e('11'); //统计获取到的看板数据的其他数量 +r(count($kanbanGroup['kanbanGroup']['other'][1]['wait'])) && p() && e('3'); //统计获取到的看板数据的其他下的项目集1下的wait的项目数量 +r(count($kanbanGroup['kanbanGroup']['other'][1]['doing'])) && p() && e('4'); //统计获取到的看板数据的其他下的项目集1下的doing的项目数量 diff --git a/test/model/project/getteammemberpairs.php b/test/model/project/getteammemberpairs.php index 8b28fa1bcd..10a16437ac 100755 --- a/test/model/project/getteammemberpairs.php +++ b/test/model/project/getteammemberpairs.php @@ -1,22 +1,20 @@ #!/usr/bin/env php getTeamMemberPairs(); cid=1 pid=1 -获取id为11的项目团队成员个数 >> 2 -获取id为1的项目团队成员个数 >> 0 - */ -$project = new Project('admin'); +global $tester; +$tester->loadModel('project'); -$getIdNub = array(11, 1); +$members = $tester->project->getTeamMemberPairs(11); -r($project->getTeamMemberPairs($getIdNub[0])) && p() && e('2'); //获取id为11的项目团队成员个数 -r($project->getTeamMemberPairs($getIdNub[1])) && p() && e('0'); //获取id为1的项目团队成员个数 \ No newline at end of file +r(count($members)) && p() && e('3'); // 获取id为11的项目团队成员个数 +r($members) && p('pm92') && e('产品经理92'); // 获取id为11的项目团队成员的详细信息 diff --git a/test/model/project/getteammembers.php b/test/model/project/getteammembers.php index 17f52ad4a0..ceb40f3fb4 100755 --- a/test/model/project/getteammembers.php +++ b/test/model/project/getteammembers.php @@ -1,7 +1,7 @@ #!/usr/bin/env php loadModel('project'); -$getNu = array(11, array('admin', 'pm92'), 11, array('admin'), true); +$members = $tester->project->getTeamMembers(11); -r($project->getTeamMembers($getNu[0], $getNu[1])) && p() && e('2'); //获取id为11的项目团队成员个数 -r($project->getTeamMembers($getNu[2], $getNu[3], $getNu[4])) && p() && e('1'); //获取id为11的项目团队成员个数,开启新手引导 \ No newline at end of file +r(count($members)) && p() && e('2'); // 获取id为11的项目团队成员个数 +r($members) && p('pm92:role,totalHours,realname') && e('项目经理,343.0,产品经理92'); // 获取id为11的项目团队成员的详细信息 diff --git a/test/model/project/managemembers.php b/test/model/project/managemembers.php new file mode 100644 index 0000000000..357b1601ff --- /dev/null +++ b/test/model/project/managemembers.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +unlinkMember(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); + +$_POST['accounts'] = array('test2', 'user10', 'dev1'); +$_POST['roles'] = array('测试', '市场', '研发'); +$_POST['days'] = array('10', '12', '11'); +$_POST['hours'] = array('7.5', '8', '8.5'); +$_POST['removeExecution'] = 'no'; + +$tester->project->manageMembers(11); +$members = $tester->project->getTeamMemberPairs(11); + +r(count($members)) && p('') && e('4'); // 查看维护团队之后的成员数量 +r($members) && p('dev1') && e('开发1'); // 查看维护团队之后的成员详情 +r($members) && p('test2') && e('测试2'); // 查看维护团队之后的成员详情 +system("./ztest init"); diff --git a/test/model/project/unlinkmember.php b/test/model/project/unlinkmember.php new file mode 100644 index 0000000000..dcf098add6 --- /dev/null +++ b/test/model/project/unlinkmember.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +unlinkMember(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); + +$beforeMembers = $tester->project->getTeamMemberPairs(11); +$tester->project->unlinkMember(11, 'admin', false); +$afterMembers = $tester->project->getTeamMemberPairs(11); + +r(count($beforeMembers)) && p('') && e('3'); // 查看移除团队成员之前的ID为11的项目团队成员数量 +r(count($afterMembers)) && p('') && e('2'); // 查看移除团队成员之后的ID为11的项目团队成员数量 +r($beforeMembers) && p('pm92') && e('产品经理92'); // 查看项目ID为11的团队成员的真实姓名 +r($afterMembers) && p('pm92') && e('产品经理92'); // 查看项目ID为11的团队成员的真实姓名 +system("./ztest init"); diff --git a/test/model/project/updateproductprogram.php b/test/model/project/updateproductprogram.php new file mode 100644 index 0000000000..f8e3b50450 --- /dev/null +++ b/test/model/project/updateproductprogram.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +updateProductProgram(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); + +$productIdList = array(1, 2, 3, 4); +$tester->project->updateProductProgram(7, 1, $productIdList); + +$products = $tester->loadModel('product')->getByIdList($productIdList); + +r(count($products)) && p('') && e('4'); // 查看被更新了项目集的产品数量 +r($products) && p('1:program,name') && e('1,正常产品1'); // 查看被更新了项目集的产品详情 +r($products) && p('2:program,name') && e('1,正常产品2'); // 查看被更新了项目集的产品详情 +r($products) && p('3:program,name') && e('1,正常产品3'); // 查看被更新了项目集的产品详情 +r($products) && p('4:program,name') && e('1,正常产品4'); // 查看被更新了项目集的产品详情 +system("./ztest init"); diff --git a/test/model/project/updateproducts.php b/test/model/project/updateproducts.php new file mode 100644 index 0000000000..a874abd6c7 --- /dev/null +++ b/test/model/project/updateproducts.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +updateProducts(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('project'); +$tester->loadModel('product'); + +$beforeProducts = $tester->product->getProductPairsByProject(11); + +$productIdList = array(1, 2, 3, 4); +$tester->project->updateProducts(11, $productIdList); + +$afterProducts = $tester->product->getProductPairsByProject(11); + +r(count($beforeProducts)) && p() && e('3'); // 查看更新项目关联的产品之前的产品数量 +r(count($afterProducts)) && p() && e('4'); // 查看更新项目关联的产品之后的产品数量 +r($beforeProducts) && p('81') && e('多平台产品81'); // 查看更新项目关联的产品之前的产品名称 +r($afterProducts) && p('4') && e('正常产品4'); // 查看更新项目关联的产品之后的产品名称 +system("./ztest init"); From a6a56ea4fe863fa53fca23176d718464746ec0a3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 8 Apr 2022 09:18:27 +0800 Subject: [PATCH 017/181] * Fix bug #17175. --- module/caselib/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/caselib/model.php b/module/caselib/model.php index 43eb22f699..25bc2b146c 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -499,7 +499,7 @@ class caselibModel extends model $stepData->case = $caseID; $stepData->version = 1; $stepData->desc = htmlSpecialString($desc); - $stepData->expect = htmlSpecialString(trim($data->expect[$key][$id])); + $stepData->expect = htmlSpecialString(trim($this->post->expect[$key][$id])); $this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec(); if($stepData->type == 'group') $parentStepID = $this->dao->lastInsertID(); if($stepData->type == 'step') $parentStepID = 0; From 7c540be4d75d551a54d6366b1be571e51538b348 Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 8 Apr 2022 09:37:49 +0800 Subject: [PATCH 018/181] *Fixbug_sunjun_17344 --- module/product/lang/en.php | 1 + module/product/lang/zh-cn.php | 1 + module/product/model.php | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/module/product/lang/en.php b/module/product/lang/en.php index 5edd2eba56..64bd10635a 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -90,6 +90,7 @@ $lang->product->confirmChangeProgram = "The projects linked with this {$lang->pr $lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; $lang->product->programEmpty = 'Program should not be empty!'; $lang->product->nameIsDuplicate = "『%s』 product line already exists, please reset!"; +$lang->product->nameIsDuplicated = "『%s』『%s』 exists. Go to Admin->System->Data->Recycle Bin to restore it, if you are sure it is deleted."; $lang->product->id = 'ID'; $lang->product->program = "Program"; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 92d00b16d6..d5cea6673b 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -90,6 +90,7 @@ $lang->product->confirmChangeProgram = "如下项目既关联了该{$lang->produ $lang->product->changeProgramError = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到项目,请取消关联后再操作"; $lang->product->programEmpty = '项目集不能为空'; $lang->product->nameIsDuplicate = "『%s』产品线已经存在,请重新设置!"; +$lang->product->nameIsDuplicated = "『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。"; $lang->product->id = '编号'; $lang->product->program = "所属项目集"; diff --git a/module/product/model.php b/module/product/model.php index 187d63d63d..c115f72574 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -622,6 +622,13 @@ class productModel extends model $line->name = $this->post->lineName; $line->root = $this->config->systemMode == 'new' ? $product->program : 0; $line->order = $maxOrder; + + $lines = $this->dao->select('name')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('root')->eq($line->root)->andWhere('name')->eq($line->name)->fetch(); + if(!empty($lines)) + { + dao::$errors['lineName'] = sprintf($this->lang->product->nameIsDuplicated, $this->lang->product->line, $line->name); + return false; + } $this->dao->insert(TABLE_MODULE)->data($line)->exec(); if(!dao::isError()) From 661819769125e476eca8a236e3de2f7914bc3b3c Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 8 Apr 2022 09:48:11 +0800 Subject: [PATCH 019/181] * Fix bug#19196. --- module/task/view/create.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 40de74c6e8..52b2033e03 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -96,7 +96,7 @@ task->story;?> - task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '_blank', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?> + task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?>
          story => (empty($stories) or !isset($stories[$task->story])) ? '': $stories[$task->story]), $task->story, "class='form-control chosen' onchange='setStoryRelated();'");?> preview;?> From ff102f75c4f12927b5c68b45f240b9f75b12e7c6 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Fri, 8 Apr 2022 10:07:46 +0800 Subject: [PATCH 020/181] * Fix bug #20986. --- module/user/js/edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/user/js/edit.js b/module/user/js/edit.js index 75dd95ca6c..664049ff89 100644 --- a/module/user/js/edit.js +++ b/module/user/js/edit.js @@ -8,8 +8,8 @@ $(function() { if(!password1Encrypted && !password2Encrypted) { - var password1 = $('#password1').val(); - var password2 = $('#password2').val(); + var password1 = $('#password1').val().trim(); + var password2 = $('#password2').val().trim(); var passwordStrength = computePasswordStrength(password1); if($("form input[name=passwordStrength]").length == 0) $('#submit').after(""); From 95b2c3317a8d1b61d16dfae2658f0725e7db831a Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 8 Apr 2022 10:11:16 +0800 Subject: [PATCH 021/181] *Fixbug_sunjun_17344 --- module/product/lang/en.php | 2 +- module/product/lang/zh-cn.php | 2 +- module/product/model.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/product/lang/en.php b/module/product/lang/en.php index 64bd10635a..8372c8c887 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -90,7 +90,7 @@ $lang->product->confirmChangeProgram = "The projects linked with this {$lang->pr $lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; $lang->product->programEmpty = 'Program should not be empty!'; $lang->product->nameIsDuplicate = "『%s』 product line already exists, please reset!"; -$lang->product->nameIsDuplicated = "『%s』『%s』 exists. Go to Admin->System->Data->Recycle Bin to restore it, if you are sure it is deleted."; +$lang->product->nameIsDuplicated = "『Product Line』『%s』 exists. Go to Admin->System->Data->Recycle Bin to restore it, if you are sure it is deleted."; $lang->product->id = 'ID'; $lang->product->program = "Program"; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index d5cea6673b..5610157e88 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -90,7 +90,7 @@ $lang->product->confirmChangeProgram = "如下项目既关联了该{$lang->produ $lang->product->changeProgramError = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到项目,请取消关联后再操作"; $lang->product->programEmpty = '项目集不能为空'; $lang->product->nameIsDuplicate = "『%s』产品线已经存在,请重新设置!"; -$lang->product->nameIsDuplicated = "『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。"; +$lang->product->nameIsDuplicated = "『产品线』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。"; $lang->product->id = '编号'; $lang->product->program = "所属项目集"; diff --git a/module/product/model.php b/module/product/model.php index c115f72574..a45425cd51 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -626,7 +626,7 @@ class productModel extends model $lines = $this->dao->select('name')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('root')->eq($line->root)->andWhere('name')->eq($line->name)->fetch(); if(!empty($lines)) { - dao::$errors['lineName'] = sprintf($this->lang->product->nameIsDuplicated, $this->lang->product->line, $line->name); + dao::$errors['lineName'] = sprintf($this->lang->product->nameIsDuplicated, $line->name); return false; } $this->dao->insert(TABLE_MODULE)->data($line)->exec(); From 63761f3d23aa2752b9dad1a061baea002e86a7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 8 Apr 2022 10:13:35 +0800 Subject: [PATCH 022/181] * adjust for icon-version. --- module/index/view/index.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/index/view/index.html.php b/module/index/view/index.html.php index 30361c2c89..d6ba255b6b 100644 --- a/module/index/view/index.html.php +++ b/module/index/view/index.html.php @@ -26,6 +26,7 @@ js::set('showFeatures', $showFeatures); From 53b0cd0c5768364fd8727826cb8b703b0f919415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 8 Apr 2022 11:27:23 +0800 Subject: [PATCH 029/181] * code for bug #20133. --- module/group/lang/resource.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 54e00fc652..e40f6f4490 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1256,9 +1256,6 @@ $lang->resource->mail->browse = 'browse'; $lang->resource->mail->delete = 'delete'; $lang->resource->mail->resend = 'resendAction'; $lang->resource->mail->batchDelete = 'batchDelete'; -$lang->resource->mail->sendCloud = 'sendCloud'; -$lang->resource->mail->sendcloudUser = 'sendcloudUser'; -$lang->resource->mail->ztCloud = 'ztCloud'; $lang->mail->methodOrder[5] = 'index'; $lang->mail->methodOrder[10] = 'detect'; @@ -1270,9 +1267,6 @@ $lang->mail->methodOrder[35] = 'browse'; $lang->mail->methodOrder[40] = 'delete'; $lang->mail->methodOrder[45] = 'batchDelete'; $lang->mail->methodOrder[50] = 'resend'; -$lang->mail->methodOrder[55] = 'sendCloud'; -$lang->mail->methodOrder[60] = 'sendcloudUser'; -$lang->mail->methodOrder[65] = 'ztCloud'; /* Custom. */ $lang->resource->custom = new stdclass(); From 281ad7e876aeab1216c4f75238be3b8edbf852e1 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Fri, 8 Apr 2022 11:43:35 +0800 Subject: [PATCH 030/181] * fix search and redirect in ajax dropmenu not work as expected sometimes. --- module/execution/view/ajaxgetdropmenu.html.php | 6 +++--- module/product/view/ajaxgetdropmenu.html.php | 6 +++--- module/project/view/ajaxgetdropmenu.html.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 980945cb00..1d60bc6929 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -58,9 +58,9 @@ foreach($executions as $projectID => $projectExecutions) { $projectName = zget($projects, $projectID); - if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '
          • '; - if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '
            • '; - if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '
              • '; + if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '
                • '; + if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '
                  • '; + if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '
                    • '; } foreach($projectExecutions as $index => $execution) diff --git a/module/product/view/ajaxgetdropmenu.html.php b/module/product/view/ajaxgetdropmenu.html.php index 41fdafa825..878a715744 100644 --- a/module/product/view/ajaxgetdropmenu.html.php +++ b/module/product/view/ajaxgetdropmenu.html.php @@ -62,9 +62,9 @@ foreach($products as $programID => $programProducts) { $programName = zget($programs, $programID); - if($productCounts[$programID]['myProduct']) $myProductsHtml .= '
                      • '; - if($productCounts[$programID]['others']) $normalProductsHtml .= '
                        • '; - if($productCounts[$programID]['closed']) $closedProductsHtml .= '
                          • '; + if($productCounts[$programID]['myProduct']) $myProductsHtml .= '
                            • '; + if($productCounts[$programID]['others']) $normalProductsHtml .= '
                              • '; + if($productCounts[$programID]['closed']) $closedProductsHtml .= '
                                • '; } foreach($programProducts as $index => $product) diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index ad6392a567..0f6c265a8b 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -59,9 +59,9 @@ foreach($projects as $programID => $programProjects) { $programName = zget($programs, $programID); - if($projectCounts[$programID]['myProject']) $myProjectsHtml .= '
                                  • '; - if($projectCounts[$programID]['others']) $normalProjectsHtml .= '
                                    • '; - if($projectCounts[$programID]['closed']) $closedProjectsHtml .= '
                                      • '; + if($projectCounts[$programID]['myProject']) $myProjectsHtml .= '
                                        • '; + if($projectCounts[$programID]['others']) $normalProjectsHtml .= '
                                          • '; + if($projectCounts[$programID]['closed']) $closedProjectsHtml .= '
                                            • '; } foreach($programProjects as $index => $project) From 54d333d80073ca358d66fa110cd96039fc37ce51 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Fri, 8 Apr 2022 13:07:28 +0800 Subject: [PATCH 031/181] * change zt_file.title to varchar. --- db/update16.5.sql | 2 ++ db/zentao.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/db/update16.5.sql b/db/update16.5.sql index 960ed4667c..0d12c5d159 100644 --- a/db/update16.5.sql +++ b/db/update16.5.sql @@ -43,3 +43,5 @@ ALTER TABLE `zt_opportunity` MODIFY COLUMN `prevention` mediumtext NOT NULL; ALTER TABLE `zt_opportunity` MODIFY COLUMN `resolution` mediumtext NOT NULL; ALTER TABLE `zt_trainplan` MODIFY COLUMN `summary` mediumtext NOT NULL; ALTER TABLE `zt_gapanalysis` MODIFY COLUMN `analysis` mediumtext NOT NULL; + +ALTER TABLE `zt_file` MODIFY COLUMN `title` varchar(255) NOT NULL; diff --git a/db/zentao.sql b/db/zentao.sql index ee1094e198..29674baabc 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -570,7 +570,7 @@ CREATE TABLE IF NOT EXISTS `zt_extension` ( CREATE TABLE IF NOT EXISTS `zt_file` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `pathname` char(50) NOT NULL, - `title` char(255) NOT NULL, + `title` varchar(255) NOT NULL, `extension` char(30) NOT NULL, `size` int(10) unsigned NOT NULL default '0', `objectType` char(30) NOT NULL, From 56f05dd70ce69910078d0a1e354bba265133eed0 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 8 Apr 2022 05:27:16 +0000 Subject: [PATCH 032/181] * Fix bug #16635. --- module/testcase/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index b5293c4997..5896cf1b99 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1469,7 +1469,7 @@ class testcase extends control $row->id = $caseID; } } - if($taskID) $caseLang->statusList = $this->lang->testtask->statusList; + if($taskID) $caseLang->statusList = $this->lang->testcase->statusList; $stmt = $this->dao->select('t1.*')->from(TABLE_TESTRESULT)->alias('t1') ->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.run=t2.id') From 7afa047679b8d53553164d05294dfdeb19c80ae7 Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Fri, 8 Apr 2022 13:47:55 +0800 Subject: [PATCH 033/181] update test data --- test/data/case.yaml | 8 +- test/data/libcase.yaml | 8 +- test/data/testresult.yaml | 8 +- test/data/testrun.yaml | 10 +-- test/data/testtask.yaml | 18 +++-- test/data/unitcase.yaml | 141 ++++++++++++++++++++++++++++++++++++ test/data/zentao/config.php | 7 +- 7 files changed, 173 insertions(+), 27 deletions(-) create mode 100644 test/data/unitcase.yaml diff --git a/test/data/case.yaml b/test/data/case.yaml index cbfba84e68..0b83ec487f 100644 --- a/test/data/case.yaml +++ b/test/data/case.yaml @@ -5,7 +5,7 @@ version: "1.0" fields: - field: id note: "ID" - range: 1-10000 + range: 1-400 - field: product note: "产品ID" range: 1-100{4} @@ -32,15 +32,15 @@ fields: range: "1" - field: title note: "用例标题" - range: "1-10000" + range: "1-400" prefix: "这个是测试用例" - field: precondition note: "前置条件" - range: "1-10000" + range: "1-400" prefix: "这是前置条件" - field: keywords note: "关键词" - range: "1-10000" + range: "1-400" prefix: "这是关键词" - field: pri note: "优先级" diff --git a/test/data/libcase.yaml b/test/data/libcase.yaml index a852dfcfda..6413079fa5 100644 --- a/test/data/libcase.yaml +++ b/test/data/libcase.yaml @@ -5,7 +5,7 @@ version: "1.0" fields: - field: id note: "ID" - range: 401-10000 + range: 401-410 - field: product note: "产品ID" range: 0 @@ -32,15 +32,15 @@ fields: range: "1" - field: title note: "用例标题" - range: "1-10000" + range: "1-10" prefix: "用例库用例" - field: precondition note: "前置条件" - range: "1-10000" + range: "1-10" prefix: "这是前置条件" - field: keywords note: "关键词" - range: "1-10000" + range: "1-10" prefix: "这是关键词" - field: pri note: "优先级" diff --git a/test/data/testresult.yaml b/test/data/testresult.yaml index 014890f463..1489206cc9 100644 --- a/test/data/testresult.yaml +++ b/test/data/testresult.yaml @@ -5,21 +5,21 @@ version: "1.0" fields: - field: id note: "ID" - range: 1-40 + range: 1-70 prefix: "" postfix: "" loop: 0 format: "" - field: run note: "运行" - range: 1-40 + range: 1-70 prefix: "" postfix: "" loop: 0 format: "" - field: case note: "用例ID" - range: 1-400 + range: 1-40,411-440 prefix: "" postfix: "" loop: 0 @@ -47,7 +47,7 @@ fields: format: "" - field: caseResult note: "测试结果" - range: pass,fail + range: [pass,fail]{20!},[pass,pass,fail]{15!} prefix: "" postfix: "" loop: 0 diff --git a/test/data/testrun.yaml b/test/data/testrun.yaml index 82a0a65a09..569ea35234 100644 --- a/test/data/testrun.yaml +++ b/test/data/testrun.yaml @@ -12,14 +12,14 @@ fields: format: "" - field: task note: "测试单任务ID" - range: 1-10{4} + range: 1-10{4},51-60{3} prefix: "" postfix: "" loop: 0 format: "" - field: case note: "用例ID" - range: 1-40 + range: 1-40,411-440 prefix: "" postfix: "" loop: 0 @@ -44,7 +44,7 @@ fields: format: "" - field: lastRunner note: "最后执行人" - use: admin + range: []{40},admin{30} prefix: "" postfix: "" loop: 0 @@ -59,14 +59,14 @@ fields: format: "YYYY-MM-DD" - field: lastRunResult note: "最后执行结果" - range: pass,fail + range: [pass,fail]{20!},[pass,pass,fail]{15!} prefix: "" postfix: "" loop: 0 format: "" - field: status note: "状态" - range: normal + range: normal{40},done{30} prefix: "" postfix: "" loop: 0 diff --git a/test/data/testtask.yaml b/test/data/testtask.yaml index 6f794fa878..c4be09cd5b 100644 --- a/test/data/testtask.yaml +++ b/test/data/testtask.yaml @@ -12,34 +12,38 @@ fields: format: "" - field: name note: "测试单名称" - range: 1-10000 - prefix: "测试单" + fields: + - field: name1 + range: 测试单,单元测试 + - field: name2 + range: 1-50,1-50 + prefix: "" postfix: "" loop: 0 format: "" - field: product note: "所属产品" - range: 1-10 + range: 1-50 prefix: "" postfix: "" loop: 0 format: "" - field: project note: "所属项目" - range: 11-20 + range: 11-60 prefix: "" postfix: "" loop: 0 format: "" - field: execution note: "所属执行" - range: 101-110 + range: 101-150 prefix: "" postfix: "" loop: 0 format: "" - field: build - range: 11-20 + range: 11-20,0{40} note: "版本" prefix: "" postfix: "" @@ -105,7 +109,7 @@ fields: format: "" - field: auto note: "自动" - range: no + range: no{50},unit{50} prefix: "" postfix: "" loop: 0 diff --git a/test/data/unitcase.yaml b/test/data/unitcase.yaml new file mode 100644 index 0000000000..92ba59a6ee --- /dev/null +++ b/test/data/unitcase.yaml @@ -0,0 +1,141 @@ +title: table zt_case +desc: "测试用例" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 411-10000 + - field: product + note: "产品ID" + range: 1-50{3} + - field: branch + note: "分支ID" + range: 0 + - field: execution + note: "执行ID" + range: 0 + - field: lib + note: "所属库" + range: 0 + - field: module + note: "所属模块" + range: 0 + - field: path + note: "" + range: "0" + - field: story + note: "相关需求" + range: "0" + - field: storyVersion + note: "需求版本" + range: "1" + - field: title + note: "用例标题" + range: 登录成功,密码错误,账号过期 + prefix: "com.ngtesting.autotest.test.TestLogin" + - field: precondition + note: "前置条件" + range: [] + prefix: "" + - field: keywords + note: "关键词" + range: [] + prefix: "" + - field: pri + note: "优先级" + range: 1-4 + - field: type + note: "用例类型" + range: unit + - field: auto + note: "是否是自动化测试用例" + range: "unit" + - field: frame + note: "自动化测试框架" + range: "junit" + - field: stage + note: "适用阶段" + range: unittest + - field: howRun + note: "测试方式" + range: "" + - field: scriptedBy + note: "脚本由谁创建" + range: "" + - field: scriptedDate + note: "脚本创建日期" + from: common.date.v1.yaml + use: dateB + - field: scriptStatus + note: "脚本状态" + range: "" + - field: scriptLocation + note: "脚本地址" + range: "" + - field: status + note: "用例状态" + range: normal + - field: subStatus + note: "子状态" + range: "" + - field: color + note: "标题颜色" + range: "" + - field: frequency + note: "使用频率" + range: 1 + - field: order + note: "排序" + range: 0 + - field: openedBy + note: "由谁创建" + range: admin + prefix: "" + - field: openedDate + note: "创建日期" + range: "-:600" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: reviewedBy + note: "由谁评审" + range: "" + - field: reviewedDate + note: "评审时间" + range: "" + - field: lastEditedBy + note: "最后修改者" + range: "" + - field: lastEditedDate + note: "修改日期" + range: "" + - field: version + note: "用例版本" + range: "1" + - field: linkCase + note: "相关用例" + range: "" + - field: fromBug + note: "来源Bug" + range: 0 + - field: fromCaseID + note: "" + range: 0 + - field: fromCaseVersion + note: "" + range: 1 + - field: deleted + note: "是否删除" + range: 0 + - field: lastRunner + note: "执行人" + range: admin + prefix: "" + - field: lastRunDate + note: "执行时间" + range: "-:500" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: lastRunResult + note: "结果" + range: pass,pass,fail diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 11fc196c08..ec3f7a238f 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -35,13 +35,14 @@ $builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate' $builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson')); $builder->case = array('rows' => 400, 'extends' => array('case')); $builder->libcase = array('rows' => 10, 'extends' => array('case','libcase')); +$builder->unitcase = array('rows' => 150, 'extends' => array('case','unitcase')); $builder->casestep = array('rows' => 400, 'extends' => array('casestep')); $builder->bug = array('rows' => 300, 'extends' => array('bug')); $builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug')); -$builder->testtask = array('rows' => 10, 'extends' => array('testtask')); -$builder->testresult = array('rows' => 40, 'extends' => array('testresult')); -$builder->testrun = array('rows' => 40, 'extends' => array('testrun')); +$builder->testtask = array('rows' => 100, 'extends' => array('testtask')); +$builder->testresult = array('rows' => 70, 'extends' => array('testresult')); +$builder->testrun = array('rows' => 70, 'extends' => array('testrun')); $builder->testreport = array('rows' => 10, 'extends' => array('testreport')); $builder->testsuite = array('rows' => 201, 'extends' => array('testsuite')); $builder->suitecase = array('rows' => 400, 'extends' => array('suitecase')); From 0145f5a790407c313e0ba15568baa20556a76ec1 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Fri, 8 Apr 2022 13:50:09 +0800 Subject: [PATCH 034/181] * fix bug #21598 --- extension/lite/custom/ext/config/lite.php | 1 - 1 file changed, 1 deletion(-) diff --git a/extension/lite/custom/ext/config/lite.php b/extension/lite/custom/ext/config/lite.php index 6ca05649d1..a7dc31e411 100644 --- a/extension/lite/custom/ext/config/lite.php +++ b/extension/lite/custom/ext/config/lite.php @@ -2,7 +2,6 @@ $config->custom->requiredModules = array(); $config->custom->requiredModules[10] = 'project'; $config->custom->requiredModules[20] = 'story'; -$config->custom->requiredModules[35] = 'execution'; $config->custom->requiredModules[40] = 'task'; $config->custom->requiredModules[80] = 'doc'; $config->custom->requiredModules[85] = 'user'; From ce869a399bb15b50cbc32647c3fcd0427de566c2 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 8 Apr 2022 13:53:05 +0800 Subject: [PATCH 035/181] * Fix bug #12474. --- module/testsuite/control.php | 10 ++++------ module/testsuite/model.php | 5 +++-- module/testsuite/view/browse.html.php | 2 +- module/testsuite/view/edit.html.php | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 7d826b7982..037d25161c 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -73,16 +73,14 @@ class testsuite extends control /* Append id for secend sort. */ $sort = common::appendOrder($orderBy); - $suites = $this->testsuite->getSuites($productID, $sort, $pager); + $productName = isset($this->products[$productID]) ? $this->products[$productID] : ''; + $suites = $this->testsuite->getSuites($productID, $sort, $pager, 'all'); if(empty($suites) and $pageID > 1) { - $pager = pager::init(0, $recPerPage, 1); - $suites = $this->testsuite->getSuites($productID, $sort, $pager); + $pager = pager::init(0, $recPerPage, 1); + $suites = $this->testsuite->getSuites($productID, $sort, $pager, 'all'); } - $productName = isset($this->products[$productID]) ? $this->products[$productID] : ''; - $suites = $this->testsuite->getSuites($productID, $sort, $pager); - $this->view->title = $productName . $this->lang->testsuite->common; $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $productName); $this->view->position[] = $this->lang->testsuite->common; diff --git a/module/testsuite/model.php b/module/testsuite/model.php index ae73a101fd..a0d52b572f 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -87,16 +87,17 @@ class testsuiteModel extends model * @param int $productID * @param string $orderBy * @param object $pager + * @param string $param * @access public * @return array */ - public function getSuites($productID, $orderBy = 'id_desc', $pager = null) + public function getSuites($productID, $orderBy = 'id_desc', $pager = null, $param = '') { return $this->dao->select("*")->from(TABLE_TESTSUITE) ->where('product')->eq((int)$productID) ->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi() ->andWhere('deleted')->eq(0) - ->andWhere("(`type` = 'public' OR (`type` = 'private' and addedBy = '{$this->app->user->account}'))") + ->beginIF(strpos($param, 'all') === false)->andWhere("(`type` = 'public' OR (`type` = 'private' and addedBy = '{$this->app->user->account}'))")->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/testsuite/view/browse.html.php b/module/testsuite/view/browse.html.php index a23dd8f834..a4d24ca90e 100644 --- a/module/testsuite/view/browse.html.php +++ b/module/testsuite/view/browse.html.php @@ -57,7 +57,7 @@ id"), sprintf('%03d', $suite->id));?> - + type == 'public') echo "{$lang->testsuite->authorList['public']} ";?> type == 'private') echo "{$lang->testsuite->authorList['private']} ";?> id"), $suite->name);?> diff --git a/module/testsuite/view/edit.html.php b/module/testsuite/view/edit.html.php index 7991c10536..6b826c3510 100644 --- a/module/testsuite/view/edit.html.php +++ b/module/testsuite/view/edit.html.php @@ -28,7 +28,7 @@ desc), "rows=10 class='form-control'");?> printExtendFields($suite, 'table');?> - type != 'library'):?> + type != 'library' and $suite->type != 'unit'):?> testsuite->author;?> testsuite->authorList, $suite->type);?> From a7d7cca753931199ee06dc3569d7bcd1cad735f1 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Fri, 8 Apr 2022 14:03:21 +0800 Subject: [PATCH 036/181] * Fix bug 21591. --- api/v1/entries/storychange.php | 2 +- module/story/control.php | 2 ++ module/task/control.php | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api/v1/entries/storychange.php b/api/v1/entries/storychange.php index b46c4defa4..a9751265d5 100644 --- a/api/v1/entries/storychange.php +++ b/api/v1/entries/storychange.php @@ -22,7 +22,7 @@ class storyChangeEntry extends Entry { $oldStory = $this->loadModel('story')->getByID($storyID); - $fields = 'reviewer,comment,executions,bugs,cases,tasks'; + $fields = 'reviewer,comment,executions,bugs,cases,tasks,reviewedBy,uid'; $this->batchSetPost($fields); $fields = 'title,spec,verify'; $this->batchSetPost($fields, $oldStory); diff --git a/module/story/control.php b/module/story/control.php index 97df529782..80be7c4d96 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -988,6 +988,8 @@ class story extends control $version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version'); $files = $this->loadModel('file')->saveUpload($story->type, $storyID, $version); + if(empty($files) and $this->post->uid != '') $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); + if($this->post->comment != '' or !empty($changes) or !empty($files)) { $action = (!empty($changes) or !empty($files)) ? 'Changed' : 'Commented'; diff --git a/module/task/control.php b/module/task/control.php index f869833fb1..a6ff6fd9c6 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -459,10 +459,7 @@ class task extends control $changes = $this->task->update($taskID); if(dao::isError()) return print(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('task', $taskID); - if(empty($files) and $this->post->uid != '') - { - $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); - } + if(empty($files) and $this->post->uid != '') $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); } $task = $this->task->getById($taskID); From 63946bb2382578d77b369160c338807da3850159 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 8 Apr 2022 14:06:42 +0800 Subject: [PATCH 037/181] * Fix bug #18781. --- module/story/control.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 712dc61afa..06f8dbb177 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1016,21 +1016,7 @@ class story extends control $module = $this->app->tab == 'project' ? 'projectstory' : 'story'; - if(isonlybody()) - { - $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution' and $execution->type == 'kanban' and $this->app->tab == 'execution') - { - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); - - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); - } - else - { - return print(js::reload('parent.parent')); - } - } + if(isonlybody()) return print(js::reload('parent.parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); return print(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent')); From f69222b56e5a5a2b47605761a3fdff65746b02bb Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 8 Apr 2022 06:24:00 +0000 Subject: [PATCH 038/181] * Fix bug#20630 --- lib/scm/gitlab.class.php | 14 +++++++++----- module/gitlab/model.php | 7 +++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 1d702b267b..a94bfdc9e8 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -66,7 +66,7 @@ class gitlab } else { - $commits = $this->getCommitsByPath($file->path); + $commits = $this->getCommitsByPath($file->path, '', '', 1); if(empty($commits)) continue; $commit = $commits[0]; @@ -108,7 +108,7 @@ class gitlab $file = $this->fetch($api, $param); if(!isset($file->file_name)) return false; - $commits = $this->getCommitsByPath($path); + $commits = $this->getCommitsByPath($path, '', '', 1); $file->revision = $file->commit_id; $file->size = $this->formatBytes($file->size); @@ -636,10 +636,13 @@ class gitlab * Get commits by path. * * @param string $path + * @param string $fromRevision + * @param string $toRevision + * @param int $perPage * @access public * @return array */ - public function getCommitsByPath($path, $fromRevision = '', $toRevision = '') + public function getCommitsByPath($path, $fromRevision = '', $toRevision = '', $perPage = 0) { $path = ltrim($path, DIRECTORY_SEPARATOR); $api = "commits"; @@ -662,10 +665,11 @@ class gitlab { $since = $fromDate; } - if($since) $param->since = $since; if($until) $param->until = $until; + if($perPage) $param->per_page = $perPage; + return $this->fetch($api, $param); } @@ -742,7 +746,7 @@ class gitlab { $params = (array) $params; $params['private_token'] = $this->token; - $params['per_page'] = 100; + $params['per_page'] = isset($params['per_page']) ? $params['per_page'] : 100; $api = ltrim($api, '/'); $api = $this->root . $api . '?' . http_build_query($params); diff --git a/module/gitlab/model.php b/module/gitlab/model.php index ae76ba33bb..54ed60e29a 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -492,6 +492,7 @@ class gitlabModel extends model { /* GitLab API '/users' can only return 20 users per page in default, so we use a loop to fetch all users. */ $page = 1; + $perPage = 100; $response = array(); $apiRoot = $this->getApiRoot($gitlabID); @@ -503,12 +504,14 @@ class gitlabModel extends model while(true) { /* Also use `per_page=20` to fetch users in API. Fetch active users only. */ - $url = sprintf($apiRoot, "/users") . "&order_by={$order}&sort={$sort}&page={$page}&per_page=20&active=true"; - $result = json_decode(commonModel::http($url)); + $url = sprintf($apiRoot, "/users") . "&order_by={$order}&sort={$sort}&page={$page}&per_page={$perPage}&active=true"; + $httpData = commonModel::httpWithHeader($url); + $result = json_decode($httpData['body']); if(!empty($result)) { $response = array_merge($response, $result); $page += 1; + if($httpData['header']['X-Page'] == $httpData['header']['X-Total-Pages']) break; } else { From 664ed9bda8b435ee47f263f8961620bfd1a7701e Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 8 Apr 2022 14:30:57 +0800 Subject: [PATCH 039/181] * Fix bug #21372. --- module/product/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index ace2c4d729..85392dd0e3 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -227,8 +227,8 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; } } ?> -
        • + From 4a0897daf5fea740dff5201ca9afaeac31a4b436 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Fri, 8 Apr 2022 14:31:28 +0800 Subject: [PATCH 040/181] * fix bug #21419 --- module/file/view/export2csv.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/file/view/export2csv.html.php b/module/file/view/export2csv.html.php index 09323e1fc5..e5e6b61aad 100644 --- a/module/file/view/export2csv.html.php +++ b/module/file/view/export2csv.html.php @@ -22,4 +22,4 @@ foreach($rows as $row) } echo '"' . "\n"; } -if($this->post->kind == 'task') echo $this->lang->file->childTaskTips; +if($this->post->kind == 'task' && $config->vision != 'lite') echo $this->lang->file->childTaskTips; From 19d4f476f79b57250e452d6adcf1641e95d64d92 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Fri, 8 Apr 2022 14:45:48 +0800 Subject: [PATCH 041/181] * fix bug #21424 --- extension/lite/kanban/ext/view/view.lite.html.hook.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension/lite/kanban/ext/view/view.lite.html.hook.php b/extension/lite/kanban/ext/view/view.lite.html.hook.php index 77f9eb2951..d60adb67d8 100644 --- a/extension/lite/kanban/ext/view/view.lite.html.hook.php +++ b/extension/lite/kanban/ext/view/view.lite.html.hook.php @@ -1,3 +1,7 @@ \ No newline at end of file From ff08e7261cfd9ae22015dc3092c32125dd114d29 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 8 Apr 2022 14:53:25 +0800 Subject: [PATCH 042/181] * Adjust for license. --- .../ext/view/batchcreate.lite.html.hook.php | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 extension/lite/user/ext/view/batchcreate.lite.html.hook.php diff --git a/extension/lite/user/ext/view/batchcreate.lite.html.hook.php b/extension/lite/user/ext/view/batchcreate.lite.html.hook.php new file mode 100644 index 0000000000..e18f1365c1 --- /dev/null +++ b/extension/lite/user/ext/view/batchcreate.lite.html.hook.php @@ -0,0 +1,70 @@ + +dao->select("COUNT('*') as count")->from(TABLE_USER) + ->where('deleted')->eq(0) + ->beginIF($this->config->edition != 'open')->andWhere("visions")->ne('lite')->fi() + ->fetch('count'); +js::set('userCount', $userCount); +js::set('userMaxCount', $userMaxCount); +js::set('noticeUserCreate', str_replace('%maxcount%', $userMaxCount, $lang->user->noticeUserCreate)); + +if($this->config->edition != 'open') +{ + $liteCount = $this->dao->select("COUNT('*') as count")->from(TABLE_USER)->where('deleted')->eq(0)->andWhere("visions")->eq('lite')->fetch('count'); + $liteMaxCount = $properties['lite']['value']; + js::set('liteCount', $liteCount); + js::set('liteMaxCount', $liteMaxCount); + js::set('noticeFeedbackCreate', str_replace('%maxcount%', $liteMaxCount, $lang->user->noticeFeedbackCreate)); +} +?> + + From d31aeedc898ee11630d21080b5e216c190b2dd93 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 8 Apr 2022 15:02:08 +0800 Subject: [PATCH 043/181] * Fix bug#19709. --- module/build/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/build/model.php b/module/build/model.php index 5470d7266f..323ae85c58 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -202,6 +202,7 @@ class buildModel extends model $selectedBuilds = $this->dao->select('id, name')->from(TABLE_BUILD) ->where('id')->in($buildIdList) ->beginIF($objectType === 'execution')->andWhere('execution')->eq($objectID)->fi() + ->beginIF($objectType === 'project')->andWhere('project')->eq($objectID)->fi() ->fetchPairs(); } From b9ba1524408a083f31e216ddac850eeff75f9263 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Fri, 8 Apr 2022 15:24:17 +0800 Subject: [PATCH 044/181] * fix bug #21577 --- module/story/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 712dc61afa..b0cfc5a242 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1128,7 +1128,8 @@ class story extends control $storyID = (int)$storyID; $story = $this->story->getById($storyID, $version, true); - if(!$story) return print(js::error($this->lang->notFound) . js::locate($this->createLink('product', 'index'))); + $linkModuleName = $this->config->vision == 'lite' ? 'project' : 'product'; + if(!$story) return print(js::error($this->lang->notFound) . js::locate($this->createLink($linkModuleName, 'index'))); $story = $this->story->mergeReviewer($story, true); From 30af3cd8eee8341a557334ad2d8b7c09c529100c Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 8 Apr 2022 07:33:19 +0000 Subject: [PATCH 045/181] * Fix bug #20812. --- module/story/lang/en.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/model.php | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 78ff05105a..a1230ac20a 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -284,6 +284,7 @@ $lang->story->estimateMustBeNumber = 'Estimate value must be number.'; $lang->story->estimateMustBePlus = 'Estimated value cannot be negative'; $lang->story->confirmChangeBranch = $lang->SRCommon . ' %s is linked to the plan of its linked branch. If the branch is edited, ' . $lang->SRCommon . ' will be removed from the plan of its linked branch. Do you want to continue edit ' . $lang->SRCommon . '?'; $lang->story->confirmChangePlan = $lang->SRCommon . ' %s is linked to the branch of its plan. If the branch is edited, ' . $lang->SRCommon . ' will be removed from the plan. Do you want to continue edit branch ?'; +$lang->story->errorDuplicateStory = $lang->SRCommon . '%s not exist'; $lang->story->form = new stdclass(); $lang->story->form->area = 'Scope'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index ff0751f10c..e0303c441a 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -284,6 +284,7 @@ $lang->story->estimateMustBeNumber = '估算值必须是数字'; $lang->story->estimateMustBePlus = '估算值不能是负数'; $lang->story->confirmChangeBranch = $lang->SRCommon . '%s已关联在之前所属分支的计划中,调整分支后,' . $lang->SRCommon . '将从之前所属分支的计划中移除,请确认是否继续修改上述' . $lang->SRCommon . '的分支。'; $lang->story->confirmChangePlan = $lang->SRCommon . '%s已关联在之前计划的所属分支中,调整分支后,' . $lang->SRCommon . '将会从计划中移除,请确认是否继续修改计划的所属分支。'; +$lang->story->errorDuplicateStory = $lang->SRCommon . '%s不存在'; $lang->story->form = new stdclass(); $lang->story->form->area = "该{$lang->SRCommon}所属范围"; diff --git a/module/story/model.php b/module/story/model.php index d5eedc2706..0663530312 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1553,6 +1553,16 @@ class storyModel extends model ->removeIF($this->post->closedReason != 'subdivided', 'childStories') ->get(); + if(!empty($story->duplicateStory)) + { + $duplicateStoryID = $this->dao->select('id')->from(TABLE_STORY)->where('id')->eq($story->duplicateStory)->fetch(); + if(empty($duplicateStoryID)) + { + dao::$errors[] = sprintf($this->lang->story->errorDuplicateStory, $story->duplicateStory); + return false; + } + } + $this->lang->story->comment = $this->lang->comment; $this->dao->update(TABLE_STORY)->data($story, 'comment') ->autoCheck() From 4ff42a2f18e3bb0207467f9621b6f5747f45729a Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Fri, 8 Apr 2022 15:37:26 +0800 Subject: [PATCH 046/181] add design unittest --- test/class/design.class.php | 54 ------------------- test/data/zentao/processor.php | 1 + test/model/design/assign.php | 4 +- test/model/design/batchcreate.php | 11 +++- test/model/design/buildsearchform.php | 17 ------ test/model/design/create.php | 13 +++-- test/model/design/getaffectedscope.php | 17 ------ test/model/design/getbyid.php | 5 +- test/model/design/getbysearch.php | 18 +++++-- .../{getcommit.php => getcommit.php.bak} | 0 test/model/design/getlist.php | 43 ++++++++++++++- test/model/design/getpairs.php | 9 +++- test/model/design/printassignedhtml.php | 17 ------ test/model/design/setmenu.php | 17 ------ test/model/design/update.php | 10 +++- test/ztest | 3 ++ 16 files changed, 103 insertions(+), 136 deletions(-) mode change 100644 => 100755 test/model/design/assign.php mode change 100644 => 100755 test/model/design/batchcreate.php delete mode 100644 test/model/design/buildsearchform.php mode change 100644 => 100755 test/model/design/create.php delete mode 100644 test/model/design/getaffectedscope.php mode change 100644 => 100755 test/model/design/getbyid.php mode change 100644 => 100755 test/model/design/getbysearch.php rename test/model/design/{getcommit.php => getcommit.php.bak} (100%) mode change 100644 => 100755 test/model/design/getlist.php mode change 100644 => 100755 test/model/design/getpairs.php delete mode 100644 test/model/design/printassignedhtml.php delete mode 100644 test/model/design/setmenu.php mode change 100644 => 100755 test/model/design/update.php diff --git a/test/class/design.class.php b/test/class/design.class.php index 7e09e62658..c99db6abd5 100644 --- a/test/class/design.class.php +++ b/test/class/design.class.php @@ -157,24 +157,6 @@ class designTest return $objects; } - public function getAffectedScopeTest($design = 0) - { - $objects = $this->objectModel->getAffectedScope($design = 0); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - - public function getListTest($projectID = 0, $productID = 0, $type = 'all', $param = 0, $orderBy = 'id_desc', $pager = null) - { - $objects = $this->objectModel->getList($projectID = 0, $productID = 0, $type = 'all', $param = 0, $orderBy = 'id_desc', $pager = null); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - public function getCommitTest($designID = 0, $pager = null) { $objects = $this->objectModel->getCommit($designID = 0, $pager = null); @@ -183,40 +165,4 @@ class designTest return $objects; } - - public function getBySearchTest($projectID = 0, $productID = 0, $queryID = 0, $orderBy = 'id_desc', $pager = null) - { - $objects = $this->objectModel->getBySearch($projectID = 0, $productID = 0, $queryID = 0, $orderBy = 'id_desc', $pager = null); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - - public function setMenuTest($projectID, $products, $productID = 0) - { - $objects = $this->objectModel->setMenu($projectID, $products, $productID = 0); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - - public function buildSearchFormTest($queryID = 0, $actionURL = '') - { - $objects = $this->objectModel->buildSearchForm($queryID = 0, $actionURL = ''); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - - public function printAssignedHtmlTest($design = '', $users = '') - { - $objects = $this->objectModel->printAssignedHtml($design = '', $users = ''); - - if(dao::isError()) return dao::getError(); - - return $objects; - } } diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index 0796e8d6a9..18839c9dd7 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -344,6 +344,7 @@ class Processor $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (3, 'admin', 'user', '用户测试条件', 'a:48:{s:13:\"fieldrealname\";s:0:\"\";s:10:\"fieldemail\";s:0:\"\";s:9:\"fielddept\";s:0:\"\";s:12:\"fieldaccount\";s:0:\"\";s:9:\"fieldrole\";s:0:\"\";s:10:\"fieldphone\";s:0:\"\";s:9:\"fieldjoin\";s:0:\"\";s:12:\"fieldvisions\";s:3:\"rnd\";s:7:\"fieldid\";s:0:\"\";s:13:\"fieldcommiter\";s:1:\"0\";s:11:\"fieldgender\";s:1:\"m\";s:7:\"fieldqq\";s:0:\"\";s:10:\"fieldskype\";s:0:\"\";s:13:\"fielddingding\";s:0:\"\";s:11:\"fieldweixin\";s:0:\"\";s:10:\"fieldslack\";s:0:\"\";s:13:\"fieldwhatsapp\";s:0:\"\";s:12:\"fieldaddress\";s:0:\"\";s:12:\"fieldzipcode\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:8:\"realname\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:9:\"白名单\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:5:\"email\";s:9:\"operator2\";s:7:\"include\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:4:\"dept\";s:9:\"operator3\";s:6:\"belong\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"account\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:4:\"role\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:5:\"phone\";s:9:\"operator6\";s:7:\"include\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:4:\"user\";s:9:\"actionURL\";s:74:\"/index.php?m=company&f=browse&browseType=all¶m=myQueryID&type=bysearch\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"lite\";}', '(( 1 AND `realname` LIKE \'%白名单%\' ) AND ( 1 ))', '0');"); $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (4, 'admin', 'projectBuild', '项目版本搜索', 'a:38:{s:9:\"fieldname\";s:0:\"\";s:12:\"fieldproduct\";s:0:\"\";s:12:\"fieldscmPath\";s:0:\"\";s:13:\"fieldfilePath\";s:0:\"\";s:9:\"fielddate\";s:0:\"\";s:12:\"fieldbuilder\";s:0:\"\";s:9:\"fielddesc\";s:0:\"\";s:14:\"fieldexecution\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:4:\"name\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:8:\"版本7\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:7:\"product\";s:9:\"operator3\";s:1:\"=\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"scmPath\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:8:\"filePath\";s:9:\"operator5\";s:7:\"include\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:4:\"date\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:12:\"projectBuild\";s:9:\"actionURL\";s:73:\"/index.php?m=project&f=build&projectID=13&type=bysearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"more\";}', '(( 1 AND `name` LIKE \'%版本7%\' ) AND ( 1 ))', '0');"); $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (5, 'admin', 'executionBuild', '执行版本搜索', 'a:37:{s:9:\"fieldname\";s:0:\"\";s:12:\"fieldproduct\";s:0:\"\";s:12:\"fieldscmPath\";s:0:\"\";s:13:\"fieldfilePath\";s:0:\"\";s:9:\"fielddate\";s:0:\"\";s:12:\"fieldbuilder\";s:0:\"\";s:9:\"fielddesc\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:4:\"name\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:8:\"版本17\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:7:\"product\";s:9:\"operator3\";s:1:\"=\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"scmPath\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:8:\"filePath\";s:9:\"operator5\";s:7:\"include\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:4:\"date\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:14:\"executionBuild\";s:9:\"actionURL\";s:78:\"/index.php?m=execution&f=build&executionID=101&type=bysearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"more\";}', '(( 1 AND `name` LIKE \'%版本17%\' ) AND ( 1 ))', '0');"); + $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (6, 'admin', 'design', '设计搜索', 'a:37:{s:9:\"fieldtype\";s:0:\"\";s:9:\"fieldname\";s:0:\"\";s:11:\"fieldcommit\";s:0:\"\";s:14:\"fieldcreatedBy\";s:0:\"\";s:16:\"fieldcreatedDate\";s:0:\"\";s:15:\"fieldassignedTo\";s:0:\"\";s:10:\"fieldstory\";s:1:\"0\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:2:\"id\";s:9:\"operator1\";s:1:\"=\";s:6:\"value1\";s:0:\"\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:4:\"type\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:4:\"name\";s:9:\"operator3\";s:7:\"include\";s:6:\"value3\";s:19:\"这是一个设计1\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:6:\"commit\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:9:\"createdBy\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:11:\"createdDate\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:6:\"design\";s:9:\"actionURL\";s:86:\"/index.php?m=design&f=browse&projectID=41&productID=31&type=bySearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"more\";}', '(( 1 AND `name` LIKE \'%这是一个设计1%\' ) AND ( 1 ))', '0');"); } private function initMessage() diff --git a/test/model/design/assign.php b/test/model/design/assign.php old mode 100644 new mode 100755 index a043aaaa5e..20b22d0b0e --- a/test/model/design/assign.php +++ b/test/model/design/assign.php @@ -10,6 +10,8 @@ title=测试 designModel->assign(); cid=1 pid=1 +设置指派人 >> dev10 + */ $designID = '17'; @@ -18,4 +20,4 @@ $noAssignedTo = array('comment' => '提交信息'); $design = new designTest(); r($design->assignTest($designID, $normalAssign)) && p('0:assignedTo') && e('dev10');//设置指派人 -r($design->assignTest($designID, $noAssignedTo)) && p('0:assignedTo') && e(''); //指派人为空 +r($design->assignTest($designID, $noAssignedTo)) && p('0:assignedTo') && e(''); //指派人为空 \ No newline at end of file diff --git a/test/model/design/batchcreate.php b/test/model/design/batchcreate.php old mode 100644 new mode 100755 index c1f41e26c2..700d522b4e --- a/test/model/design/batchcreate.php +++ b/test/model/design/batchcreate.php @@ -10,6 +10,13 @@ title=测试 designModel->batchCreate(); cid=1 pid=1 +批量创建设计数量统计 >> 4 +批量创建敏捷项目设计 >> 设计一 +批量创建瀑布项目设计 >> 32 +批量创建看板项目设计 >> 41 +不输入类型 >> 『设计类型』不能为空。 +不输入名字 >> 0 + */ $projectIDList = array('12', '32', '62', '13', '71', '72', '73', '75'); $productIDList = array('1', '21', '41'); @@ -25,6 +32,7 @@ $noNameDesign = array('story' => $storys, 'type' => $types, 'desc' => $desc); $noDescDesign = array('story' => $storys, 'type' => $types, 'name' => $names); $design = new designTest(); +r(count($design->batchCreateTest($projectIDList[7], $productIDList[0], $noDescDesign))) && p() && e('4'); //批量创建设计数量统计 r($design->batchCreateTest($projectIDList[0], $productIDList[0], $normalDesign)) && p('0:name') && e('设计一'); //批量创建敏捷项目设计 r($design->batchCreateTest($projectIDList[1], $productIDList[1], $normalDesign)) && p('0:project') && e('32'); //批量创建瀑布项目设计 r($design->batchCreateTest($projectIDList[2], $productIDList[2], $normalDesign)) && p('0:product') && e('41'); //批量创建看板项目设计 @@ -32,6 +40,5 @@ r($design->batchCreateTest($projectIDList[3], $productIDList[0], $noStoryDesign) r($design->batchCreateTest($projectIDList[4], $productIDList[0], $noTypeDesign)) && p('type:0') && e('『设计类型』不能为空。');//不输入类型 r($design->batchCreateTest($projectIDList[5], $productIDList[0], $noNameDesign)) && p() && e('0'); //不输入名字 r($design->batchCreateTest($projectIDList[6], $productIDList[0], $noDescDesign)) && p('0:desc') && e(''); //不输入详情 -r(count($design->batchCreateTest($projectIDList[7], $productIDList[0], $noDescDesign))) && p() && e('4'); //批量创建设计数量统计 -system("./ztest init"); +system("./ztest init"); \ No newline at end of file diff --git a/test/model/design/buildsearchform.php b/test/model/design/buildsearchform.php deleted file mode 100644 index a3e8885051..0000000000 --- a/test/model/design/buildsearchform.php +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env php -buildSearchForm(); -cid=1 -pid=1 - -*/ - -$design = new designTest(); - -r($design->buildSearchFormTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/design/create.php b/test/model/design/create.php old mode 100644 new mode 100755 index 8422317beb..e68709721a --- a/test/model/design/create.php +++ b/test/model/design/create.php @@ -10,6 +10,13 @@ title=测试 designModel->create(); cid=1 pid=1 +不输入名称创建设计 >> 『设计名称』不能为空。 +创建hlds设计 >> hlds设计 +创建dds设计 >> 2 +创建dbds设计 >> 41 +创建ads设计 >> ADS +不输入类型创建设计 >> 『设计类型』不能为空。 + */ $projectIDList = array('11', '31', '61'); $products = array('1', '21', '41'); @@ -25,13 +32,13 @@ $noTypeDesign = array('product' => $products[0], 'story' => '1', 'name' => ' $noNameDesign = array('product' => $products[0], 'story' => '1', 'type' => $type[3]); $design = new designTest(); +r($design->createTest($projectIDList[0], $noNameDesign)) && p('name:0') && e('『设计名称』不能为空。'); //不输入名称创建设计 r($design->createTest($projectIDList[0], $hldsDesign)) && p('name') && e('hlds设计'); //创建hlds设计 r($design->createTest($projectIDList[1], $ddsDesign)) && p('story') && e('2'); //创建dds设计 -r($design->createTest($projectIDList[2], $dbdsDesign)) && p('product') && e('61'); //创建dbds设计 +r($design->createTest($projectIDList[2], $dbdsDesign)) && p('product') && e('41'); //创建dbds设计 r($design->createTest($projectIDList[0], $adsDesign)) && p('type') && e('ADS'); //创建ads设计 r($design->createTest($projectIDList[0], $noProductDesign)) && p('product') && e(''); //不输入产品创建设计 r($design->createTest($projectIDList[0], $noStoryDesign)) && p('story') && e(''); //不输入需求创建设计 r($design->createTest($projectIDList[0], $noTypeDesign)) && p('type:0') && e('『设计类型』不能为空。'); //不输入类型创建设计 -r($design->createTest($projectIDList[0], $noNameDesign)) && p('name:0') && e('『设计名称』不能为空。'); //不输入名称创建设计 -system("./ztest init"); +system("./ztest init"); \ No newline at end of file diff --git a/test/model/design/getaffectedscope.php b/test/model/design/getaffectedscope.php deleted file mode 100644 index 77926c3055..0000000000 --- a/test/model/design/getaffectedscope.php +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env php -getAffectedScope(); -cid=1 -pid=1 - -*/ - -$design = new designTest(); - -r($design->getAffectedScopeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/design/getbyid.php b/test/model/design/getbyid.php old mode 100644 new mode 100755 index 805bc16f8b..36c5dedc69 --- a/test/model/design/getbyid.php +++ b/test/model/design/getbyid.php @@ -10,6 +10,9 @@ title=测试 designModel->getByID(); cid=1 pid=1 +正常根据id查询 >> 这是一个设计1 +查询不存在的设计id >> 0 + */ global $tester; $design = $tester->loadModel('design'); @@ -17,4 +20,4 @@ $design = $tester->loadModel('design'); $designIDList = array('0', '1'); r($design->getByID($designIDList[1])) && p('name') && e('这是一个设计1');//正常根据id查询 -r($design->getByID($designIDList[0])) && p() && e('0'); //查询不存在的设计id +r($design->getByID($designIDList[0])) && p() && e('0'); //查询不存在的设计id \ No newline at end of file diff --git a/test/model/design/getbysearch.php b/test/model/design/getbysearch.php old mode 100644 new mode 100755 index 080af401ca..355a205e3f --- a/test/model/design/getbysearch.php +++ b/test/model/design/getbysearch.php @@ -1,7 +1,6 @@ #!/usr/bin/env php getBySearch(); cid=1 pid=1 +不输入产品和项目查询 >> 0 +输入项目查询 >> 0 +输入产品查询 >> 0 +正常查询条件查询 >> 这是一个设计1 + */ +global $tester; +$design = $tester->loadModel('design'); -$design = new designTest(); +$productIDList = array('0', '31'); +$projectIDList = array('0', '41'); +$queryID = array('0', '6'); +$orderBy = array('id_desc', 'name_desc'); -r($design->getBySearchTest()) && p() && e(); \ No newline at end of file +r($design->getBySearch($projectIDList[0], $productIDList[0], $queryID[0], $orderBy[0])) && p() && e('0'); //不输入产品和项目查询 +r($design->getBySearch($projectIDList[1], $productIDList[0], $queryID[0], $orderBy[0])) && p() && e('0'); //输入项目查询 +r($design->getBySearch($projectIDList[0], $productIDList[1], $queryID[0], $orderBy[0])) && p() && e('0'); //输入产品查询 +r($design->getBySearch($projectIDList[1], $productIDList[1], $queryID[1], $orderBy[1])) && p('1:name') && e('这是一个设计1');//正常查询条件查询 \ No newline at end of file diff --git a/test/model/design/getcommit.php b/test/model/design/getcommit.php.bak similarity index 100% rename from test/model/design/getcommit.php rename to test/model/design/getcommit.php.bak diff --git a/test/model/design/getlist.php b/test/model/design/getlist.php old mode 100644 new mode 100755 index 107edf2276..9b0b8af2b0 --- a/test/model/design/getlist.php +++ b/test/model/design/getlist.php @@ -10,8 +10,47 @@ title=测试 designModel->getList(); cid=1 pid=1 +默认输入查询 >> 0 +不输入产品查询 >> 0 +不输入项目查询 >> 31 +项目和产品一起输入查询 >> 41 +HLDS类型设计查询 >> HLDS +DDS类型设计查询 >> DDS +DBDS类型设计查询 >> DBDS +ADS类型设计查询 >> ADS +不存在类型设计查询 >> 0 +查询条件查询设计 >> 这是一个设计1 +不输入项目查询统计 >> 4 +项目和产品一起输入查询统计 >> 4 +HLDS类型设计查询统计 >> 1 +DDS类型设计查询统计 >> 1 +DBDS类型设计查询统计 >> 1 +ADS类型设计查询统计 >> 1 + */ +global $tester; +$design = $tester->loadModel('design'); -$design = new designTest(); +$productIDList = array('0', '31'); +$projectIDList = array('0', '41'); +$types = array('all', 'bySearch', 'HLDS', 'DDS', 'DBDS', 'ADS', 'QT'); +$param = array('0', '6'); +$orderBy = array('id_desc', 'name_desc'); -r($design->getListTest()) && p() && e(); \ No newline at end of file +r($design->getList($projectIDList[0], $productIDList[0], $types[0], $param[0], $orderBy[0])) && p() && e('0'); //默认输入查询 +r($design->getList($projectIDList[1], $productIDList[0], $types[0], $param[0], $orderBy[0])) && p() && e('0'); //不输入产品查询 +r($design->getList($projectIDList[0], $productIDList[1], $types[0], $param[0], $orderBy[0])) && p('1:product') && e('31'); //不输入项目查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[0], $param[0], $orderBy[1])) && p('1:project') && e('41'); //项目和产品一起输入查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[2], $param[0], $orderBy[0])) && p('1:type') && e('HLDS'); //HLDS类型设计查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[3], $param[0], $orderBy[0])) && p('2:type') && e('DDS'); //DDS类型设计查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[4], $param[0], $orderBy[0])) && p('3:type') && e('DBDS'); //DBDS类型设计查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[5], $param[0], $orderBy[0])) && p('4:type') && e('ADS'); //ADS类型设计查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[6], $param[0], $orderBy[0])) && p() && e('0'); //不存在类型设计查询 +r($design->getList($projectIDList[1], $productIDList[1], $types[1], $param[1], $orderBy[0])) && p('1:name') && e('这是一个设计1');//查询条件查询设计 + +r(count($design->getList($projectIDList[0], $productIDList[1], $types[0], $param[0], $orderBy[0]))) && p() && e('4'); //不输入项目查询统计 +r(count($design->getList($projectIDList[1], $productIDList[1], $types[0], $param[0], $orderBy[1]))) && p() && e('4'); //项目和产品一起输入查询统计 +r(count($design->getList($projectIDList[1], $productIDList[1], $types[2], $param[0], $orderBy[0]))) && p() && e('1'); //HLDS类型设计查询统计 +r(count($design->getList($projectIDList[1], $productIDList[1], $types[3], $param[0], $orderBy[0]))) && p() && e('1'); //DDS类型设计查询统计 +r(count($design->getList($projectIDList[1], $productIDList[1], $types[4], $param[0], $orderBy[0]))) && p() && e('1'); //DBDS类型设计查询统计 +r(count($design->getList($projectIDList[1], $productIDList[1], $types[5], $param[0], $orderBy[0]))) && p() && e('1'); //ADS类型设计查询统计 \ No newline at end of file diff --git a/test/model/design/getpairs.php b/test/model/design/getpairs.php old mode 100644 new mode 100755 index 486225b07d..e088aacd14 --- a/test/model/design/getpairs.php +++ b/test/model/design/getpairs.php @@ -10,6 +10,13 @@ title=测试 designModel->getPairs(); cid=1 pid=1 +查询不存在的产品 >> 0 +查询不存在的类型 >> 0 +查询HLDS设计 >> 1:这是一个设计1 +查询DDS设计 >> 2:这是一个设计2 +查询DBDS设计 >> 3:这是一个设计3 +查询ADS设计 >> 4:这是一个设计4 + */ global $tester; $design = $tester->loadModel('design'); @@ -22,4 +29,4 @@ r($design->getPairs($productIDList[1], $types[0])) && p() && e('0'); r($design->getPairs($productIDList[1], $types[1])) && p('1') && e('1:这是一个设计1');//查询HLDS设计 r($design->getPairs($productIDList[1], $types[2])) && p('2') && e('2:这是一个设计2');//查询DDS设计 r($design->getPairs($productIDList[1], $types[3])) && p('3') && e('3:这是一个设计3');//查询DBDS设计 -r($design->getPairs($productIDList[1], $types[4])) && p('4') && e('4:这是一个设计4');//查询ADS设计 +r($design->getPairs($productIDList[1], $types[4])) && p('4') && e('4:这是一个设计4');//查询ADS设计 \ No newline at end of file diff --git a/test/model/design/printassignedhtml.php b/test/model/design/printassignedhtml.php deleted file mode 100644 index 3a4a9f749f..0000000000 --- a/test/model/design/printassignedhtml.php +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env php -printAssignedHtml(); -cid=1 -pid=1 - -*/ - -$design = new designTest(); - -r($design->printAssignedHtmlTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/design/setmenu.php b/test/model/design/setmenu.php deleted file mode 100644 index f903541df6..0000000000 --- a/test/model/design/setmenu.php +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env php -setMenu(); -cid=1 -pid=1 - -*/ - -$design = new designTest(); - -r($design->setMenuTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/design/update.php b/test/model/design/update.php old mode 100644 new mode 100755 index 95e5386b32..c5823cc406 --- a/test/model/design/update.php +++ b/test/model/design/update.php @@ -10,6 +10,14 @@ title=测试 designModel->update(); cid=1 pid=1 +修改设计类型 >> type,HLDS,DDS +修改设计需求 >> story,0,17 +修改设计产品 >> product,31,21 +修改设计名称 >> name,这是一个设计1,修改设计 +修改设计详情 >> desc,这是设计描述1,详情修改 +设计名称不能为空 >> 『设计名称』不能为空。 +设计类型不能为空 >> 『设计类型』不能为空。 + */ $designIDList = array('1', '2', '3'); @@ -31,4 +39,4 @@ r($design->updateTest($designIDList[0],$updateDesc)) && p('0:field,old,new') r($design->updateTest($designIDList[0],$noName)) && p('name:0') && e('『设计名称』不能为空。'); //设计名称不能为空 r($design->updateTest($designIDList[0],$noType)) && p('type:0') && e('『设计类型』不能为空。'); //设计类型不能为空 -system("./ztest init"); +system("./ztest init"); \ No newline at end of file diff --git a/test/ztest b/test/ztest index 156a8839c3..121b61ec45 100755 --- a/test/ztest +++ b/test/ztest @@ -73,6 +73,9 @@ switch($argv[1]) case 'cron': ztfRun('model/cron'); break; + case 'design': + ztfRun('model/design'); + break; case 'model': ztfRun('model'); break; From 38e147b3349067bea9a1932a5a7a799609b600b8 Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Fri, 8 Apr 2022 15:41:52 +0800 Subject: [PATCH 047/181] update testtask data --- test/data/testtask.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/data/testtask.yaml b/test/data/testtask.yaml index c4be09cd5b..ea7096c970 100644 --- a/test/data/testtask.yaml +++ b/test/data/testtask.yaml @@ -14,7 +14,7 @@ fields: note: "测试单名称" fields: - field: name1 - range: 测试单,单元测试 + range: 测试单{50},单元测试{50} - field: name2 range: 1-50,1-50 prefix: "" From 8b2a7bee7607b118730d9fe422d3e791fc33f1c1 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 8 Apr 2022 15:44:22 +0800 Subject: [PATCH 048/181] * Add auto test of testcase and fix bug. --- module/testcase/model.php | 16 +- test/class/testcase.class.php | 295 +++++++++++++++++---- test/model/action/getlist.php | 72 ++--- test/model/testcase/createfromimport.php | 25 ++ test/model/testcase/getstatus.php | 32 +++ test/model/testcase/gettestcases.php | 45 ++++ test/model/testcase/importfromlib.php | 25 ++ test/model/testcase/joinstep.php | 23 ++ test/model/testcase/review.php | 49 ++++ test/model/testcase/synccase2project.php | 24 ++ test/model/testcase/update.php | 27 ++ test/model/testcase/updatecase2project.php | 31 +++ 12 files changed, 572 insertions(+), 92 deletions(-) create mode 100755 test/model/testcase/createfromimport.php create mode 100755 test/model/testcase/getstatus.php create mode 100755 test/model/testcase/gettestcases.php create mode 100755 test/model/testcase/importfromlib.php create mode 100755 test/model/testcase/joinstep.php create mode 100755 test/model/testcase/review.php create mode 100755 test/model/testcase/synccase2project.php create mode 100755 test/model/testcase/update.php create mode 100755 test/model/testcase/updatecase2project.php diff --git a/module/testcase/model.php b/module/testcase/model.php index 0fea861510..f5c10aab36 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1247,9 +1247,9 @@ class testcaseModel extends model else { /* Compare every step. */ - foreach($oldStep as $id => $oldStep) + foreach($oldStep as $id => $step) { - if(trim($oldStep->desc) != trim($steps[$id]->desc) or trim($oldStep->expect) != $steps[$id]->expect) + if(trim($step->desc) != trim($steps[$id]->desc) or trim($step->expect) != $steps[$id]->expect) { $stepChanged = true; break; @@ -1388,10 +1388,14 @@ class testcaseModel extends model if($module != 'ditto') $prevModule = $module; if($module == 'ditto') $data->module[$i] = $prevModule; } - foreach($data->branch as $i => $branch) + + if(isset($data->branch)) { - if($branch != 'ditto') $prevBranch = $branch; - if($branch == 'ditto') $data->branch[$i] = $prevBranch; + foreach($data->branch as $i => $branch) + { + if($branch != 'ditto') $prevBranch = $branch; + if($branch == 'ditto') $data->branch[$i] = $prevBranch; + } } $libCases = $this->dao->select('*')->from(TABLE_CASE)->where('deleted')->eq(0)->andWhere('id')->in($data->caseIdList)->fetchAll('id'); @@ -1889,7 +1893,7 @@ class testcaseModel extends model if($methodName == 'review') { - $status = zget($case, 'status', $status); + $status = zget($case, 'status', ''); if($this->post->result == 'pass') return 'normal'; diff --git a/test/class/testcase.class.php b/test/class/testcase.class.php index 37d196839d..b1761793be 100644 --- a/test/class/testcase.class.php +++ b/test/class/testcase.class.php @@ -51,15 +51,6 @@ class testcaseTest return $objects; } - public function getProjectCasesTest($projectID, $orderBy = 'id_desc', $pager = null, $browseType = '') - { - $objects = $this->objectModel->getProjectCases($projectID, $orderBy = 'id_desc', $pager = null, $browseType = ''); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - /** * Test get execution cases. * @@ -134,9 +125,19 @@ class testcaseTest return $objects; } - public function getTestCasesTest($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no') + /** + * Test get test cases. + * + * @param int $productID + * @param string $browseType + * @param int $queryID + * @param string $auto + * @access public + * @return array + */ + public function getTestCasesTest($productID, $browseType, $queryID, $auto = 'no') { - $objects = $this->objectModel->getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no'); + $objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, 'id_desc', null, $auto); if(dao::isError()) return dao::getError(); @@ -182,6 +183,20 @@ class testcaseTest return $objects; } + /** + * Test get cases by type. + * + * @param int $productID + * @param int $branch + * @param string $type + * @param string $status + * @param int $moduleID + * @param string $orderBy + * @param object $pager + * @param string $auto + * @access public + * @return int + */ public function getByStatusTest($productID = 0, $branch = 0, $type = 'all', $status = 'all', $moduleID = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no') { $objects = $this->objectModel->getByStatus($productID, $branch, $type, $status, $moduleID, $orderBy, $pager, $auto); @@ -191,6 +206,13 @@ class testcaseTest return count($objects); } + /** + * Test get stories' cases. + * + * @param int $storyID + * @access public + * @return array + */ public function getStoryCasesTest($storyID) { $objects = $this->objectModel->getStoryCases($storyID); @@ -216,19 +238,64 @@ class testcaseTest return $counts; } - public function updateTest($caseID) + /** + * Test update a case. + * + * @param array $param + * @access public + * @return int + */ + public function updateTest($param = array()) { - $objects = $this->objectModel->update($caseID); + $caseId = 1; + $case = $this->objectModel->getById($caseId); + + $_POST['title'] = $case->title; + $_POST['color'] = $case->color; + $_POST['precondition'] = $case->precondition; + $_POST['steps'] = array('用例步骤描述1'); + $_POST['stepType'] = array('step'); + $_POST['expects'] = array('这是用例预期结果1'); + $_POST['comment'] = ''; + $_POST['labels'] = ''; + $_POST['lastEditedDate'] = $case->lastEditedDate; + $_POST['product'] = $case->product; + $_POST['module'] = $case->module; + $_POST['story'] = $case->story; + $_POST['type'] = $case->type; + $_POST['stage'] = $case->stage; + $_POST['pri'] = $case->pri; + $_POST['status'] = $case->status; + $_POST['keywords'] = $case->keywords; + + foreach($param as $field => $value) $_POST[$field] = $value; + + $change = $this->objectModel->update('1'); + if($change == array()) $change = '没有数据更新'; + + unset($_POST); if(dao::isError()) return dao::getError(); - return $objects; + return $change; } - public function reviewTest($caseID) + /** + * Test review case. + * + * @param int $caseID + * @param object $case + * @access public + * @return array + */ + public function reviewTest($caseID, $case) { + foreach($case as $field => $value) $_POST[$field] = $value; + $objects = $this->objectModel->review($caseID); + unset($_POST); + if(dao::isError()) return dao::getError(); return $objects; @@ -251,15 +318,13 @@ class testcaseTest return $objects; } - public function getCases2LinkTest($caseID, $browseType = 'bySearch', $queryID = 0) - { - $objects = $this->objectModel->getCases2Link($caseID, $browseType = 'bySearch', $queryID = 0); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - + /** + * Test batch update cases. + * + * @param array $param + * @access public + * @return array + */ public function batchUpdateTest($param = array()) { $batchUpdateField['caseIDList'] = array('1' => 1, '2' => 2, '3' => 3, '4' => 4); @@ -343,22 +408,69 @@ class testcaseTest return $objects; } - public function joinStepTest($steps) + /** + * Test join steps to a string, thus can diff them. + * + * @param array $stepIDList + * @access public + * @return string + */ + public function joinStepTest($stepIDList) { - $objects = $this->objectModel->joinStep($steps); + global $tester; + $steps = $tester->dao->select('*')->from(TABLE_CASESTEP)->where('id')->in($stepIDList)->fetchAll(); + + $string = $this->objectModel->joinStep($steps); if(dao::isError()) return dao::getError(); - return $objects; + $string = str_replace("\n", ' ', $string); + return $string; } - public function createFromImportTest($productID, $branch = 0) + /** + * Test create from import. + * + * @param int $productID + * @param array $param + * @access public + * @return string + */ + public function createFromImportTest($productID, $param = array()) { - $objects = $this->objectModel->createFromImport($productID, $branch = 0); + global $tester; + + $_POST['product'] = array('1' => '1', '2' => '1'); + $_POST['keywords'] = array('1' => '这是关键词1', '2' => '这是关键词2'); + $_POST['title'] = array('1' => '导入测试用例1', '2' => '导入测试用例2'); + $_POST['module'] = array('1' => '0', '2' => '0'); + $_POST['story'] = array('1' => '2', '2' => '2'); + $_POST['pri'] = array('1' => '1', '2' => '2'); + $_POST['type'] = array('1' => 'performance', '2' => 'feature'); + $_POST['stage'] = array('1' => array('0' => 'feature'), '2' => array('0' => 'unittest')); + $_POST['precondition'] = array('1' => '这是前置条件1', '2' => '这是前置条件2'); + $_POST['stepType'] = array('1' => array('1' => 'step'), '2' => array('1' => 'step')); + $_POST['desc'] = array('1' => array('1' => '用例步骤描述1'), '2' => array('1' => '用例步骤描述2')); + $_POST['expect'] = array('1' => array('1' => '这是用例预期结果1'), '2' => array('1' => '这是用例预期结果2')); + $_POST['isEndPage'] = '1'; + $_POST['pagerID'] = '1'; + + foreach($param as $field => $value) $_POST[$field] = $value; + + $fileName = __DIR__ . DS . 'a.txt'; + fopen($fileName, 'a'); + $tester->session->fileImport = $fileName; + + $this->objectModel->createFromImport($productID, 0); + + + unset($_POST); if(dao::isError()) return dao::getError(); - return $objects; + $objects = $tester->dao->select('*')->from(TABLE_CASE)->where('product')->eq(1)->andWhere('lib')->eq(0)->markLeft()->andWhere('id')->gt(560)->orWhere('id')->in('1,2')->markRight()->fetchAll('title'); + $titles = implode(',', array_keys($objects)); + return $titles; } /** @@ -377,21 +489,27 @@ class testcaseTest return $object; } - public function importFromLibTest($productID) + /** + * Test import case from Lib. + * + * @param int $productID + * @param array $caseIdList + * @access public + * @return array + */ + public function importFromLibTest($productID, $caseIdList = array()) { - $objects = $this->objectModel->importFromLib($productID); + $_POST['module'] = array('410' => 0, '409' => 'ditto', '408' => 'ditto', '407' => 'ditto', '406' => 'ditto', '405' => 'ditto', '404' => 'ditto', '403' => 'ditto', '402' => 'ditto', '401' => 'ditto'); + $_POST['caseIdList'] = $caseIdList; - if(dao::isError()) return dao::getError(); + $this->objectModel->importFromLib($productID); - return $objects; - } - - public function buildSearchFormTest($productID, $products, $queryID, $actionURL, $projectID = 0) - { - $objects = $this->objectModel->buildSearchForm($productID, $products, $queryID, $actionURL, $projectID = 0); + unset($_POST); if(dao::isError()) return dao::getError(); + global $tester; + $objects = $tester->dao->select('*')->from(TABLE_CASE)->where('fromCaseID')->in($caseIdList)->orderBy('id_asc')->fetchAll(); return $objects; } @@ -427,29 +545,106 @@ class testcaseTest return $object ? 1 : 2; } - public function syncCase2ProjectTest($case, $caseID) + /** + * Test sync case to project. + * + * @param int $caseID + * @access public + * @return int + */ + public function syncCase2ProjectTest($caseID) { - $objects = $this->objectModel->syncCase2Project($case, $caseID); + global $tester; + $tester->dao->delete()->from(TABLE_PROJECTCASE)->where('`case`')->eq($caseID)->exec(); + $case = $this->objectModel->getByID($caseID); + $this->objectModel->syncCase2Project($case, $caseID); if(dao::isError()) return dao::getError(); + $objects = $tester->dao->select('*')->from(TABLE_PROJECTCASE)->where('`case`')->eq($caseID)->fetchAll(); + return count($objects); + } + + /** + * Test deal with the relationship between the case and project when edit the case. + * + * @param int $caseID + * @param string $objectType + * @param int $objectID + * @access public + * @return array + */ + public function updateCase2ProjectTest($caseID, $objectType, $objectID) + { + $oldCase = $this->objectModel->getByID($caseID); + + $case = new stdclass(); + $case->title = $oldCase->title; + $case->color = $oldCase->color; + $case->precondition = $oldCase->precondition; + $case->lastEditedDate = $oldCase->lastEditedDate; + $case->product = $objectType == 'product' ? $objectID : $oldCase->product; + $case->module = $oldCase->module; + $case->story = $objectType == 'story' ? $objectID : $oldCase->story; + $case->type = $oldCase->type; + $case->stage = $oldCase->stage; + $case->pri = $oldCase->pri; + $case->status = $oldCase->status; + $case->keywords = $oldCase->keywords; + $case->version = $oldCase->version + 1; + $case->linkCase = $oldCase->linkCase; + $case->lastEditedBy = $oldCase->lastEditedBy; + $case->branch = $oldCase->branch; + + $this->objectModel->updateCase2Project($oldCase, $case, $caseID); + + if(dao::isError()) return dao::getError(); + + global $tester; + $objects = $tester->dao->select('*')->from(TABLE_PROJECTCASE)->where('`case`')->eq($caseID)->fetchAll(); return $objects; } - public function updateCase2ProjectTest($oldCase, $case, $caseID) + /** + * Test get status for different method. + * + * @param string $methodName + * @param object $case + * @param array $param + * @access public + * @return array + */ + public function getStatusTest($methodName, $case = null, $param = array()) { - $objects = $this->objectModel->updateCase2Project($oldCase, $case, $caseID); + if($methodName == 'update') + { + $case = $this->objectModel->getByID(1); + $_POST['title'] = $case->title; + $_POST['color'] = $case->color; + $_POST['precondition'] = $case->precondition; + $_POST['steps'] = array('用例步骤描述1'); + $_POST['stepType'] = array('step'); + $_POST['expects'] = array('这是用例预期结果1'); + $_POST['comment'] = ''; + $_POST['labels'] = ''; + $_POST['lastEditedDate'] = $case->lastEditedDate; + $_POST['product'] = $case->product; + $_POST['module'] = $case->module; + $_POST['story'] = $case->story; + $_POST['type'] = $case->type; + $_POST['stage'] = $case->stage; + $_POST['pri'] = $case->pri; + $_POST['status'] = $case->status; + $_POST['keywords'] = $case->keywords; - if(dao::isError()) return dao::getError(); + foreach($param as $field => $value) $_POST[$field] = $value; + } - return $objects; - } + $objects = $this->objectModel->getStatus($methodName, $case); - public function getStatusTest($methodName, $case = null) - { - $objects = $this->objectModel->getStatus($methodName, $case = null); + unset($_POST); - if(dao::isError()) return dao::getError(); + if(dao::isError()) return dao::getError()[0]; return $objects; } diff --git a/test/model/action/getlist.php b/test/model/action/getlist.php index b5d7b47d0f..ee81c8740e 100755 --- a/test/model/action/getlist.php +++ b/test/model/action/getlist.php @@ -17,42 +17,42 @@ $objectId = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23, $action = new actionTest(); -r($action->getListTest($objectType[0], $objectId[0])) && p('id,actor,extra') && e("1,admin,1"); // 测试获取objectType product objectId 1的动态信息 -r($action->getListTest($objectType[1], $objectId[1])) && p('id,actor,extra') && e("2,dev17,1"); // 测试获取objectType story objectId 2的动态信息 -r($action->getListTest($objectType[2], $objectId[2])) && p('id,actor,extra') && e("3,test18,1"); // 测试获取objectType productplan objectId 3的动态信息 -r($action->getListTest($objectType[3], $objectId[3])) && p('id,actor,extra') && e("4,admin,1"); // 测试获取objectType release objectId 4的动态信息 -r($action->getListTest($objectType[4], $objectId[4])) && p('id,actor,extra') && e("5,dev17,11"); // 测试获取objectType project objectId 5的动态信息 -r($action->getListTest($objectType[5], $objectId[5])) && p('id,actor,extra') && e("6,test18,1"); // 测试获取objectType task objectId 6的动态信息 -r($action->getListTest($objectType[6], $objectId[6])) && p('id,actor,extra') && e("7,admin,1"); // 测试获取objectType build objectId 7的动态信息 -r($action->getListTest($objectType[7], $objectId[7])) && p('id,actor,extra') && e("8,dev17,1"); // 测试获取objectType bug objectId 8的动态信息 -r($action->getListTest($objectType[8], $objectId[8])) && p('id,actor,extra') && e("9,test18,2"); // 测试获取objectType testcase objectId 9的动态信息 -r($action->getListTest($objectType[9], $objectId[9])) && p('id,actor,extra') && e("10,admin,1"); // 测试获取objectType case objectId 10的动态信息 -r($action->getListTest($objectType[10], $objectId[10])) && p('id,actor,extra') && e("11,dev17,1"); // 测试获取objectType testtask objectId 11的动态信息 -r($action->getListTest($objectType[11], $objectId[11])) && p('id,actor,extra') && e("12,test18,1"); // 测试获取objectType user objectId 12的动态信息 -r($action->getListTest($objectType[12], $objectId[12])) && p('id,actor,extra') && e("13,admin,1"); // 测试获取objectType doc objectId 13的动态信息 -r($action->getListTest($objectType[13], $objectId[13])) && p('id,actor,extra') && e("14,dev17,1"); // 测试获取objectType doclib objectId 14的动态信息 -r($action->getListTest($objectType[14], $objectId[14])) && p('id,actor,extra') && e("15,test18,1"); // 测试获取objectType todo objectId 15的动态信息 -r($action->getListTest($objectType[15], $objectId[15])) && p('id,actor,extra') && e("16,admin,1"); // 测试获取objectType branch objectId 16的动态信息 -r($action->getListTest($objectType[16], $objectId[16])) && p('id,actor,extra') && e("17,dev17,1"); // 测试获取objectType module objectId 17的动态信息 +r($action->getListTest($objectType[0], $objectId[0])) && p('id,actor,extra') && e("1,admin,1"); // 测试获取objectType product objectId 1的动态信息 +r($action->getListTest($objectType[1], $objectId[1])) && p('id,actor,extra') && e("2,dev17,1"); // 测试获取objectType story objectId 2的动态信息 +r($action->getListTest($objectType[2], $objectId[2])) && p('id,actor,extra') && e("3,test18,1"); // 测试获取objectType productplan objectId 3的动态信息 +r($action->getListTest($objectType[3], $objectId[3])) && p('id,actor,extra') && e("4,admin,1"); // 测试获取objectType release objectId 4的动态信息 +r($action->getListTest($objectType[4], $objectId[4])) && p('id,actor,extra') && e("5,dev17,11"); // 测试获取objectType project objectId 5的动态信息 +r($action->getListTest($objectType[5], $objectId[5])) && p('id,actor,extra') && e("6,test18,1"); // 测试获取objectType task objectId 6的动态信息 +r($action->getListTest($objectType[6], $objectId[6])) && p('id,actor,extra') && e("7,admin,1"); // 测试获取objectType build objectId 7的动态信息 +r($action->getListTest($objectType[7], $objectId[7])) && p('id,actor,extra') && e("8,dev17,1"); // 测试获取objectType bug objectId 8的动态信息 +r($action->getListTest($objectType[8], $objectId[8])) && p('id,actor,extra') && e("9,test18,2"); // 测试获取objectType testcase objectId 9的动态信息 +r($action->getListTest($objectType[9], $objectId[9])) && p('id,actor,extra') && e("10,admin,1"); // 测试获取objectType case objectId 10的动态信息 +r($action->getListTest($objectType[10], $objectId[10])) && p('id,actor,extra') && e("11,dev17,1"); // 测试获取objectType testtask objectId 11的动态信息 +r($action->getListTest($objectType[11], $objectId[11])) && p('id,actor,extra') && e("12,test18,1"); // 测试获取objectType user objectId 12的动态信息 +r($action->getListTest($objectType[12], $objectId[12])) && p('id,actor,extra') && e("13,admin,1"); // 测试获取objectType doc objectId 13的动态信息 +r($action->getListTest($objectType[13], $objectId[13])) && p('id,actor,extra') && e("14,dev17,1"); // 测试获取objectType doclib objectId 14的动态信息 +r($action->getListTest($objectType[14], $objectId[14])) && p('id,actor,extra') && e("15,test18,1"); // 测试获取objectType todo objectId 15的动态信息 +r($action->getListTest($objectType[15], $objectId[15])) && p('id,actor,extra') && e("16,admin,1"); // 测试获取objectType branch objectId 16的动态信息 +r($action->getListTest($objectType[16], $objectId[16])) && p('id,actor,extra') && e("17,dev17,1"); // 测试获取objectType module objectId 17的动态信息 r($action->getListTest($objectType[17], $objectId[17])) && p('id,actor,extra') && e("18,test18,#1 项目集1"); // 测试获取objectType testsuite objectId 18的动态信息 -r($action->getListTest($objectType[18], $objectId[18])) && p('id,actor,extra') && e("19,admin,1"); // 测试获取objectType caselib objectId 19的动态信息 -r($action->getListTest($objectType[19], $objectId[19])) && p('id,actor,extra') && e("20,dev17,1"); // 测试获取objectType testreport objectId 20的动态信息 -r($action->getListTest($objectType[20], $objectId[20])) && p('id,actor,extra') && e("21,test18,1"); // 测试获取objectType entry objectId 21的动态信息 +r($action->getListTest($objectType[18], $objectId[18])) && p('id,actor,extra') && e("19,admin,1"); // 测试获取objectType caselib objectId 19的动态信息 +r($action->getListTest($objectType[19], $objectId[19])) && p('id,actor,extra') && e("20,dev17,1"); // 测试获取objectType testreport objectId 20的动态信息 +r($action->getListTest($objectType[20], $objectId[20])) && p('id,actor,extra') && e("21,test18,1"); // 测试获取objectType entry objectId 21的动态信息 r($action->getListTest($objectType[21], $objectId[21])) && p('id,actor,extra') && e("22,admin,1"); // 测试获取objectType webhook objectId 22的动态信息 -r($action->getListTest($objectType[22], $objectId[22])) && p('id,actor,extra') && e("23,dev17,1"); // 测试获取objectType review objectId 23的动态信息 -r($action->getListTest($objectType[0], $objectId[23])) && p('id,actor,extra') && e("24,test18,1"); // 测试获取objectType product objectId 24的动态信息 -r($action->getListTest($objectType[1], $objectId[24])) && p('id,actor,extra') && e("25,admin,1"); // 测试获取objectType story objectId 25的动态信息 -r($action->getListTest($objectType[2], $objectId[25])) && p('id,actor,extra') && e("26,dev17,1"); // 测试获取objectType productplan objectId 26的动态信息 -r($action->getListTest($objectType[3], $objectId[26])) && p('id,actor,extra') && e("27,test18,1"); // 测试获取objectType release objectId 27的动态信息 -r($action->getListTest($objectType[4], $objectId[27])) && p('id,actor,extra') && e("28,admin,33"); // 测试获取objectType project objectId 28的动态信息 -r($action->getListTest($objectType[5], $objectId[28])) && p('id,actor,extra') && e("29,dev17,1"); // 测试获取objectType task objectId 29的动态信息 -r($action->getListTest($objectType[6], $objectId[29])) && p('id,actor,extra') && e("30,test18,1"); // 测试获取objectType build objectId 30的动态信息 -r($action->getListTest($objectType[7], $objectId[30])) && p('id,actor,extra') && e("31,admin,1"); // 测试获取objectType bug objectId 31的动态信息 -r($action->getListTest($objectType[8], $objectId[31])) && p('id,actor,extra') && e("32,项目经理17,1"); // 测试获取objectType testcase objectId 32的动态信息 -r($action->getListTest($objectType[9], $objectId[32])) && p('id,actor,extra') && e("33,test18,1"); // 测试获取objectType case objectId 33的动态信息 -r($action->getListTest($objectType[10], $objectId[33])) && p('id,actor,extra') && e("34,admin,1"); // 测试获取objectType testtask objectId 34的动态信息 -r($action->getListTest($objectType[11], $objectId[34])) && p('id,actor,extra') && e("35,dev17,1"); // 测试获取objectType user objectId 35的动态信息 -r($action->getListTest($objectType[12], $objectId[35])) && p('id,actor,extra') && e("36,test18,1"); // 测试获取objectType doc objectId 36的动态信息 -r($action->getListTest($objectType[13], $objectId[36])) && p('id,actor,extra') && e("37,admin,1"); // 测试获取objectType doclib objectId 37的动态信息 -r($action->getListTest($objectType[14], $objectId[37])) && p('id,actor,extra') && e("38,dev17,1"); // 测试获取objectType todo objectId 38的动态信息 +r($action->getListTest($objectType[22], $objectId[22])) && p('id,actor,extra') && e("23,dev17,1"); // 测试获取objectType review objectId 23的动态信息 +r($action->getListTest($objectType[0], $objectId[23])) && p('id,actor,extra') && e("24,test18,1"); // 测试获取objectType product objectId 24的动态信息 +r($action->getListTest($objectType[1], $objectId[24])) && p('id,actor,extra') && e("25,admin,1"); // 测试获取objectType story objectId 25的动态信息 +r($action->getListTest($objectType[2], $objectId[25])) && p('id,actor,extra') && e("26,dev17,1"); // 测试获取objectType productplan objectId 26的动态信息 +r($action->getListTest($objectType[3], $objectId[26])) && p('id,actor,extra') && e("27,test18,1"); // 测试获取objectType release objectId 27的动态信息 +r($action->getListTest($objectType[4], $objectId[27])) && p('id,actor,extra') && e("28,admin,33"); // 测试获取objectType project objectId 28的动态信息 +r($action->getListTest($objectType[5], $objectId[28])) && p('id,actor,extra') && e("29,dev17,1"); // 测试获取objectType task objectId 29的动态信息 +r($action->getListTest($objectType[6], $objectId[29])) && p('id,actor,extra') && e("30,test18,1"); // 测试获取objectType build objectId 30的动态信息 +r($action->getListTest($objectType[7], $objectId[30])) && p('id,actor,extra') && e("31,admin,1"); // 测试获取objectType bug objectId 31的动态信息 +r($action->getListTest($objectType[8], $objectId[31])) && p('id,actor,extra') && e("32,项目经理17,1"); // 测试获取objectType testcase objectId 32的动态信息 +r($action->getListTest($objectType[9], $objectId[32])) && p('id,actor,extra') && e("33,test18,1"); // 测试获取objectType case objectId 33的动态信息 +r($action->getListTest($objectType[10], $objectId[33])) && p('id,actor,extra') && e("34,admin,1"); // 测试获取objectType testtask objectId 34的动态信息 +r($action->getListTest($objectType[11], $objectId[34])) && p('id,actor,extra') && e("35,dev17,1"); // 测试获取objectType user objectId 35的动态信息 +r($action->getListTest($objectType[12], $objectId[35])) && p('id,actor,extra') && e("36,test18,1"); // 测试获取objectType doc objectId 36的动态信息 +r($action->getListTest($objectType[13], $objectId[36])) && p('id,actor,extra') && e("37,admin,1"); // 测试获取objectType doclib objectId 37的动态信息 +r($action->getListTest($objectType[14], $objectId[37])) && p('id,actor,extra') && e("38,dev17,1"); // 测试获取objectType todo objectId 38的动态信息 r($action->getListTest($objectType[15], $objectId[38])) && p('id,actor,extra') && e("39,test18,项目版本版本1"); // 测试获取objectType branch objectId 39的动态信息 diff --git a/test/model/testcase/createfromimport.php b/test/model/testcase/createfromimport.php new file mode 100755 index 0000000000..0f47224321 --- /dev/null +++ b/test/model/testcase/createfromimport.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +createFromImport(); +cid=1 +pid=1 + +*/ + +$productID = 1; + +$param1 = array('id' => array('1' => 1, '2' => 2), 'title' => array('1' => '导入覆盖的用例1', '2' => '导入覆盖的用例2'), 'insert' => '0'); +$param2 = array('id' => array('1' => 1, '2' => 2), 'title' => array('1' => '导入插入的用例1', '2' => '导入插入的用例2'), 'insert' => '1'); + +$testcase = new testcaseTest(); + +r($testcase->createFromImportTest($productID)) && p() && e('这个是测试用例1,这个是测试用例2,导入测试用例1,导入测试用例2'); // 测试直接导入数据 +r($testcase->createFromImportTest($productID, $param1)) && p() && e('导入覆盖的用例1,导入覆盖的用例2,导入测试用例1,导入测试用例2'); // 测试导入数据覆盖原有数据 +r($testcase->createFromImportTest($productID, $param2)) && p() && e('导入覆盖的用例1,导入覆盖的用例2,导入测试用例1,导入测试用例2,导入插入的用例1,导入插入的用例2'); // 测试导入数据不覆盖原有数据 +system("./ztest init"); diff --git a/test/model/testcase/getstatus.php b/test/model/testcase/getstatus.php new file mode 100755 index 0000000000..63721cd77c --- /dev/null +++ b/test/model/testcase/getstatus.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getStatus(); +cid=1 +pid=1 + +*/ + +$typeList = array('create', 'review', 'update'); + +$case1 = new stdclass(); +$case1->status = 'pass'; + +$case2 = new stdclass(); +$case2->status = 'clarify'; + +$case = null; +$param1 = array('lastEditedDate' => '2022-03-04 00:00:00'); + +$testcase = new testcaseTest(); + +r($testcase->getStatusTest($typeList[0])) && p() && e('normal'); // 测试获取create的状态 +r($testcase->getStatusTest($typeList[1], $case1)) && p() && e('pass'); // 测试获取review pass 的状态 +r($testcase->getStatusTest($typeList[1], $case2)) && p() && e('clarify'); // 测试获取review clarify 的状态 +r($testcase->getStatusTest($typeList[2], $case)) && p('1') && e('wait'); // 测试获取update的状态 +r($testcase->getStatusTest($typeList[2], $case, $param1)) && p() && e('该记录可能已经被改动。请刷新页面重新编辑!'); // 测试获取update 别人变更 的状态 diff --git a/test/model/testcase/gettestcases.php b/test/model/testcase/gettestcases.php new file mode 100755 index 0000000000..aaf5649a36 --- /dev/null +++ b/test/model/testcase/gettestcases.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php +getTestCases(); +cid=1 +pid=1 + +*/ + +$productID = array('1', '2', '3', '4', '5'); +$browseType = array('all', 'wait', 'bymodule', 'needconfirm', 'bysuite'); +$suiteID = array('1', '3', '5', '7', '9'); + +$testcase = new testcaseTest(); + +r($testcase->getTestCasesTest($productID[0], $browseType[0], $suiteID[0])) && p('1:title;2:title;3:title;4:title') && e('这个是测试用例1;这个是测试用例2;这个是测试用例3;这个是测试用例4'); // 测试查询产品1 suiteID 1 browseType all 的测试用例 +r($testcase->getTestCasesTest($productID[0], $browseType[1], $suiteID[0])) && p('1:title') && e('这个是测试用例1'); // 测试查询产品1 suiteID 1 browseType wait 的测试用例 +r($testcase->getTestCasesTest($productID[0], $browseType[2], $suiteID[0])) && p('1:title;2:title;3:title;4:title') && e('这个是测试用例1;这个是测试用例2;这个是测试用例3;这个是测试用例4'); // 测试查询产品1 suiteID 1 browseType bymodule 的测试用例 +r($testcase->getTestCasesTest($productID[0], $browseType[3], $suiteID[0])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例4;这个是测试用例3;这个是测试用例2;这个是测试用例1'); // 测试查询产品1 suiteID 1 browseType needconfirm 的测试用例 +r($testcase->getTestCasesTest($productID[0], $browseType[4], $suiteID[0])) && p('1:title;2:title') && e('这个是测试用例1;这个是测试用例2'); // 测试查询产品1 suiteID 1 browseType bysuite 的测试用例 +r($testcase->getTestCasesTest($productID[1], $browseType[0], $suiteID[1])) && p('5:title;6:title;7:title;8:title') && e('这个是测试用例5;这个是测试用例6;这个是测试用例7;这个是测试用例8'); // 测试查询产品2 suiteID 3 browseType all 的测试用例 +r($testcase->getTestCasesTest($productID[1], $browseType[1], $suiteID[1])) && p('5:title') && e('这个是测试用例5'); // 测试查询产品2 suiteID 3 browseType wait 的测试用例 +r($testcase->getTestCasesTest($productID[1], $browseType[2], $suiteID[1])) && p('5:title;6:title;7:title;8:title') && e('这个是测试用例5;这个是测试用例6;这个是测试用例7;这个是测试用例8'); // 测试查询产品2 suiteID 3 browseType bymodule 的测试用例 +r($testcase->getTestCasesTest($productID[1], $browseType[3], $suiteID[1])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例8;这个是测试用例7;这个是测试用例6;这个是测试用例5'); // 测试查询产品2 suiteID 3 browseType needconfirm 的测试用例 +r($testcase->getTestCasesTest($productID[1], $browseType[4], $suiteID[1])) && p('5:title;6:title') && e('这个是测试用例5;这个是测试用例6'); // 测试查询产品2 suiteID 3 browseType bysuite 的测试用例 +r($testcase->getTestCasesTest($productID[2], $browseType[0], $suiteID[2])) && p('9:title;10:title;11:title;12:title') && e('这个是测试用例9;这个是测试用例10;这个是测试用例11;这个是测试用例12'); // 测试查询产品3 suiteID 5 browseType all 的测试用例 +r($testcase->getTestCasesTest($productID[2], $browseType[1], $suiteID[2])) && p('9:title') && e('这个是测试用例9'); // 测试查询产品3 suiteID 5 browseType wait 的测试用例 +r($testcase->getTestCasesTest($productID[2], $browseType[2], $suiteID[2])) && p('9:title;10:title;11:title;12:title') && e('这个是测试用例9;这个是测试用例10;这个是测试用例11;这个是测试用例12'); // 测试查询产品3 suiteID 5 browseType bymodule 的测试用例 +r($testcase->getTestCasesTest($productID[2], $browseType[3], $suiteID[2])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例12;这个是测试用例11;这个是测试用例10;这个是测试用例9'); // 测试查询产品3 suiteID 5 browseType needconfirm 的测试用例 +r($testcase->getTestCasesTest($productID[2], $browseType[4], $suiteID[2])) && p('9:title;10:title') && e('这个是测试用例9;这个是测试用例10'); // 测试查询产品3 suiteID 5 browseType bysuite 的测试用例 +r($testcase->getTestCasesTest($productID[3], $browseType[0], $suiteID[3])) && p('13:title;14:title;15:title;16:title') && e('这个是测试用例13;这个是测试用例14;这个是测试用例15;这个是测试用例16'); // 测试查询产品4 suiteID 7 browseType all 的测试用例 +r($testcase->getTestCasesTest($productID[3], $browseType[1], $suiteID[3])) && p('13:title') && e('这个是测试用例13'); // 测试查询产品4 suiteID 7 browseType wait 的测试用例 +r($testcase->getTestCasesTest($productID[3], $browseType[2], $suiteID[3])) && p('13:title;14:title;15:title;16:title') && e('这个是测试用例13;这个是测试用例14;这个是测试用例15;这个是测试用例16'); // 测试查询产品4 suiteID 7 browseType bymodule 的测试用例 +r($testcase->getTestCasesTest($productID[3], $browseType[3], $suiteID[3])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例16;这个是测试用例15;这个是测试用例14;这个是测试用例13'); // 测试查询产品4 suiteID 7 browseType needconfirm 的测试用例 +r($testcase->getTestCasesTest($productID[3], $browseType[4], $suiteID[3])) && p('13:title;14:title') && e('这个是测试用例13;这个是测试用例14'); // 测试查询产品4 suiteID 7 browseType bysuite 的测试用例 +r($testcase->getTestCasesTest($productID[4], $browseType[0], $suiteID[4])) && p('17:title;18:title;19:title;20:title') && e('这个是测试用例17;这个是测试用例18;这个是测试用例19;这个是测试用例20'); // 测试查询产品5 suiteID 9 browseType all 的测试用例 +r($testcase->getTestCasesTest($productID[4], $browseType[1], $suiteID[4])) && p('17:title') && e('这个是测试用例17'); // 测试查询产品5 suiteID 9 browseType wait 的测试用例 +r($testcase->getTestCasesTest($productID[4], $browseType[2], $suiteID[4])) && p('17:title;18:title;19:title;20:title') && e('这个是测试用例17;这个是测试用例18;这个是测试用例19;这个是测试用例20'); // 测试查询产品5 suiteID 9 browseType bymodule 的测试用例 +r($testcase->getTestCasesTest($productID[4], $browseType[3], $suiteID[4])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例20;这个是测试用例19;这个是测试用例18;这个是测试用例17'); // 测试查询产品5 suiteID 9 browseType needconfirm 的测试用例 +r($testcase->getTestCasesTest($productID[4], $browseType[4], $suiteID[4])) && p('17:title;18:title') && e('这个是测试用例17;这个是测试用例18'); // 测试查询产品5 suiteID 9 browseType bysuite 的测试用例 diff --git a/test/model/testcase/importfromlib.php b/test/model/testcase/importfromlib.php new file mode 100755 index 0000000000..8d4871d39f --- /dev/null +++ b/test/model/testcase/importfromlib.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +importFromLib(); +cid=1 +pid=1 + +*/ + +$productID = 1; +$caseIdList = array(array('401' => '401', '402' => '402'), array('403' => '403', '404' => '404'), array('405' => '405', '406' => '406'), array('407' => '407', '408' => '408'), array('409' => '409', '410' => '410')); + +$testcase = new testcaseTest(); + +r($testcase->importFromLibTest($productID, $caseIdList[0])) && p('0:title;1:title') && e('用例库用例1;用例库用例2'); // 测试导入用例库用例 401 402 +r($testcase->importFromLibTest($productID, $caseIdList[1])) && p('0:title;1:title') && e('用例库用例3;用例库用例4'); // 测试导入用例库用例 403 404 +r($testcase->importFromLibTest($productID, $caseIdList[2])) && p('0:title;1:title') && e('用例库用例5;用例库用例6'); // 测试导入用例库用例 405 406 +r($testcase->importFromLibTest($productID, $caseIdList[3])) && p('0:title;1:title') && e('用例库用例7;用例库用例8'); // 测试导入用例库用例 407 408 +r($testcase->importFromLibTest($productID, $caseIdList[4])) && p('0:title;1:title') && e('用例库用例9;用例库用例10'); // 测试导入用例库用例 409 410 +system("./ztest init"); diff --git a/test/model/testcase/joinstep.php b/test/model/testcase/joinstep.php new file mode 100755 index 0000000000..00240da386 --- /dev/null +++ b/test/model/testcase/joinstep.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +joinStep(); +cid=1 +pid=1 + +*/ + +$stepIDList = array('1,2', '3,4', '5,6', '7,8', '9,10'); + +$testcase = new testcaseTest(); + +r($testcase->joinStepTest($stepIDList[0])) && p() && e('用例步骤描述1 EXPECT:这是用例预期结果1 用例步骤描述2 EXPECT:这是用例预期结果2'); // 测试获取步骤 1 2 的字符串 +r($testcase->joinStepTest($stepIDList[1])) && p() && e('用例步骤描述3 EXPECT:这是用例预期结果3 用例步骤描述4 EXPECT:这是用例预期结果4'); // 测试获取步骤 3 4 的字符串 +r($testcase->joinStepTest($stepIDList[2])) && p() && e('用例步骤描述5 EXPECT:这是用例预期结果5 用例步骤描述6 EXPECT:这是用例预期结果6'); // 测试获取步骤 5 6 的字符串 +r($testcase->joinStepTest($stepIDList[3])) && p() && e('用例步骤描述7 EXPECT:这是用例预期结果7 用例步骤描述8 EXPECT:这是用例预期结果8'); // 测试获取步骤 7 8 的字符串 +r($testcase->joinStepTest($stepIDList[4])) && p() && e('用例步骤描述9 EXPECT:这是用例预期结果9 用例步骤描述10 EXPECT:这是用例预期结果10'); // 测试获取步骤 9 10 的字符串 diff --git a/test/model/testcase/review.php b/test/model/testcase/review.php new file mode 100755 index 0000000000..24367cef64 --- /dev/null +++ b/test/model/testcase/review.php @@ -0,0 +1,49 @@ +#!/usr/bin/env php +review(); +cid=1 +pid=1 + +*/ + +$caseIDList = array(1, 5, 9, 13, 17); + +$case1 = new stdclass(); +$case1->result = 'pass'; +$case1->status = 'normal'; +$case1->reviewedBy = array('test1'); + +$case2 = new stdclass(); +$case2->result = 'clarify'; +$case2->status = 'wait'; +$case2->reviewedBy = array('test2'); + +$case3 = new stdclass(); +$case3->result = 'pass'; +$case3->status = 'normal'; +$case3->reviewedBy = array('test3'); + +$case4 = new stdclass(); +$case4->result = 'clarify'; +$case4->status = 'wait'; +$case4->reviewedBy = array('test4'); + +$case5 = new stdclass(); +$case5->result = 'pass'; +$case5->status = 'normal'; +$case5->reviewedBy = array('test5'); + +$testcase = new testcaseTest(); + +r($testcase->reviewTest($caseIDList[0], $case1)) && p('0:field,old,new') && e('status,wait,normal'); // 测试评审用例 1 +r($testcase->reviewTest($caseIDList[1], $case2)) && p('0:field,old,new') && e('reviewedBy,admin,test2'); // 测试评审用例 2 +r($testcase->reviewTest($caseIDList[2], $case3)) && p('0:field,old,new') && e('status,wait,normal'); // 测试评审用例 3 +r($testcase->reviewTest($caseIDList[3], $case4)) && p('0:field,old,new') && e('reviewedBy,admin,test4'); // 测试评审用例 4 +r($testcase->reviewTest($caseIDList[4], $case5)) && p('0:field,old,new') && e('status,wait,normal'); // 测试评审用例 5 +system("./ztest init"); diff --git a/test/model/testcase/synccase2project.php b/test/model/testcase/synccase2project.php new file mode 100755 index 0000000000..71a53dddfa --- /dev/null +++ b/test/model/testcase/synccase2project.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +syncCase2Project(); +cid=1 +pid=1 + +*/ + +$caseIDList = array(1, 5, 9, 13, 17, 2); + +$testcase = new testcaseTest(); + +r($testcase->syncCase2ProjectTest($caseIDList[0])) && p() && e('2'); // 测试同步用例 1 到关联项目中 +r($testcase->syncCase2ProjectTest($caseIDList[1])) && p() && e('2'); // 测试同步用例 2 到关联项目中 +r($testcase->syncCase2ProjectTest($caseIDList[2])) && p() && e('2'); // 测试同步用例 3 到关联项目中 +r($testcase->syncCase2ProjectTest($caseIDList[3])) && p() && e('2'); // 测试同步用例 4 到关联项目中 +r($testcase->syncCase2ProjectTest($caseIDList[4])) && p() && e('2'); // 测试同步用例 5 到关联项目中 +system("./ztest init"); diff --git a/test/model/testcase/update.php b/test/model/testcase/update.php new file mode 100755 index 0000000000..7fe154abc0 --- /dev/null +++ b/test/model/testcase/update.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +update(); +cid=1 +pid=1 + +*/ + +$changeTitle = array('title' => '修改后的名称'); +$changePrecondition = array('precondition' => '修改后的前置条件'); +$changeStatus = array('status' => 'normal'); +$changePri = array('pri' => '3'); + +$testcase = new testcaseTest(); + +r($testcase->updateTest($changeTitle)) && p('0:field,old,new') && e('title,这个是测试用例1,修改后的名称'); // 测试修改标题 +r($testcase->updateTest($changeTitle)) && p('0:field,old,new') && e('没有数据更新'); // 测试重复修改标题 +r($testcase->updateTest($changePrecondition)) && p('0:field,old,new') && e('precondition,这是前置条件1,修改后的前置条件'); // 测试修改前置条件 +r($testcase->updateTest($changeStatus)) && p('0:field,old,new') && e('status,wait,normal'); // 测试修改状态 +r($testcase->updateTest($changePri)) && p('0:field,old,new') && e('pri,1,3'); // 测试修改优先级 +system("./ztest init"); diff --git a/test/model/testcase/updatecase2project.php b/test/model/testcase/updatecase2project.php new file mode 100755 index 0000000000..169881869b --- /dev/null +++ b/test/model/testcase/updatecase2project.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +updateCase2Project(); +cid=1 +pid=1 + +*/ + +$caseIDList = array('1', '3', '5', '7', '9'); +$objectTypeList = array('product', 'story'); +$objectIDList = array('2', '1', '6', '2'); + +$testcase = new testcaseTest(); + +r($testcase->updateCase2ProjectTest($caseIDList[0], $objectTypeList[0], $objectIDList[0])) && p('0:project,product,case') && e('101,2,1'); // 测试修改用例 1 产品 +r($testcase->updateCase2ProjectTest($caseIDList[0], $objectTypeList[1], $objectIDList[2])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('101,2,1;12,1,1;102,1,1'); // 测试修改用例 1 需求 +r($testcase->updateCase2ProjectTest($caseIDList[1], $objectTypeList[0], $objectIDList[0])) && p('0:project,product,case') && e('101,2,3'); // 测试修改用例 3 产品 +r($testcase->updateCase2ProjectTest($caseIDList[1], $objectTypeList[1], $objectIDList[2])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('101,2,3;12,1,3;102,1,3'); // 测试修改用例 3 需求 +r($testcase->updateCase2ProjectTest($caseIDList[2], $objectTypeList[0], $objectIDList[1])) && p('0:project,product,case') && e('102,1,5'); // 测试修改用例 5 产品 +r($testcase->updateCase2ProjectTest($caseIDList[2], $objectTypeList[1], $objectIDList[3])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('102,1,5;11,2,5;101,2,5'); // 测试修改用例 5 需求 +r($testcase->updateCase2ProjectTest($caseIDList[3], $objectTypeList[0], $objectIDList[1])) && p('0:project,product,case') && e('102,1,7'); // 测试修改用例 7 产品 +r($testcase->updateCase2ProjectTest($caseIDList[3], $objectTypeList[1], $objectIDList[3])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('102,1,7;11,2,7;101,2,7'); // 测试修改用例 7 需求 +r($testcase->updateCase2ProjectTest($caseIDList[4], $objectTypeList[0], $objectIDList[1])) && p('0:project,product,case') && e('103,1,9'); // 测试修改用例 9 产品 +r($testcase->updateCase2ProjectTest($caseIDList[4], $objectTypeList[1], $objectIDList[3])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('103,1,9;11,3,9;101,3,9'); // 测试修改用例 9 需求 +system("./ztest init"); From 0654bcc2ad82580579435602c2a3ca0938eb3984 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 8 Apr 2022 16:03:03 +0800 Subject: [PATCH 049/181] * Fix api format data bug. --- framework/api/entry.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php index 6ae1237f45..2d93b300d9 100644 --- a/framework/api/entry.class.php +++ b/framework/api/entry.class.php @@ -524,7 +524,7 @@ class baseEntry /* Format value. */ if(!$isArray) { - $object->$key = $this->cast($object->$key, $type); + $object->$key = $this->cast(trim($object->$key, ','), $type); continue; } From 9d8df16da82a8c0a819762a07eb32f9caef83e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Sat, 9 Apr 2022 15:58:16 +0800 Subject: [PATCH 050/181] * Add testtask. --- module/testtask/js/common.js | 2 +- module/testtask/model.php | 1 + test/class/testtask.class.php | 226 ++++++++++++++++++ test/model/testtask/activate.php | 17 ++ test/model/testtask/batchrun.php | 17 ++ test/model/testtask/block.php | 17 ++ test/model/testtask/close.php | 17 ++ test/model/testtask/create.php | 39 +++ test/model/testtask/createresult.php | 17 ++ test/model/testtask/getalllinkablecases.php | 30 +++ test/model/testtask/getbuginfo.php | 17 ++ test/model/testtask/getbyid.php | 20 ++ test/model/testtask/getbylist.php | 20 ++ test/model/testtask/getbyuser.php | 24 ++ .../testtask/getdataoftesttaskpermodule.php | 17 ++ .../testtask/getdataoftesttaskperrunner.php | 17 ++ .../getdataoftesttaskperrunresult.php | 17 ++ .../testtask/getdataoftesttaskpertype.php | 17 ++ test/model/testtask/getexecutiontasks.php | 25 ++ test/model/testtask/getlinkablecasesbybug.php | 17 ++ .../testtask/getlinkablecasesbystory.php | 17 ++ .../testtask/getlinkablecasesbysuite.php | 17 ++ .../testtask/getlinkablecasesbytesttask.php | 17 ++ test/model/testtask/getpairs.php | 28 +++ test/model/testtask/getproducttasks.php | 28 +++ test/model/testtask/getproductunittasks.php | 19 ++ test/model/testtask/getprojecttasks.php | 25 ++ test/model/testtask/getrelatedtesttasks.php | 17 ++ test/model/testtask/getresults.php | 17 ++ test/model/testtask/getrunbyid.php | 17 ++ test/model/testtask/getruns.php | 17 ++ test/model/testtask/gettaskcases.php | 17 ++ test/model/testtask/gettoandcclist.php | 17 ++ test/model/testtask/getuserruns.php | 17 ++ test/model/testtask/getusertesttaskpairs.php | 17 ++ test/model/testtask/importunitresult.php | 17 ++ test/model/testtask/linkcase.php | 17 ++ test/model/testtask/mergechartoption.php | 17 ++ test/model/testtask/parsecppxmlresult.php | 17 ++ test/model/testtask/parsexmlresult.php | 17 ++ test/model/testtask/parseztffuncresult.php | 17 ++ test/model/testtask/parseztfunitresult.php | 17 ++ test/model/testtask/printcell.php | 17 ++ test/model/testtask/processautoresult.php | 17 ++ test/model/testtask/start.php | 17 ++ test/model/testtask/update.php | 17 ++ 46 files changed, 1047 insertions(+), 1 deletion(-) create mode 100644 test/class/testtask.class.php create mode 100644 test/model/testtask/activate.php create mode 100644 test/model/testtask/batchrun.php create mode 100644 test/model/testtask/block.php create mode 100644 test/model/testtask/close.php create mode 100644 test/model/testtask/create.php create mode 100644 test/model/testtask/createresult.php create mode 100644 test/model/testtask/getalllinkablecases.php create mode 100644 test/model/testtask/getbuginfo.php create mode 100644 test/model/testtask/getbyid.php create mode 100644 test/model/testtask/getbylist.php create mode 100644 test/model/testtask/getbyuser.php create mode 100644 test/model/testtask/getdataoftesttaskpermodule.php create mode 100644 test/model/testtask/getdataoftesttaskperrunner.php create mode 100644 test/model/testtask/getdataoftesttaskperrunresult.php create mode 100644 test/model/testtask/getdataoftesttaskpertype.php create mode 100644 test/model/testtask/getexecutiontasks.php create mode 100644 test/model/testtask/getlinkablecasesbybug.php create mode 100644 test/model/testtask/getlinkablecasesbystory.php create mode 100644 test/model/testtask/getlinkablecasesbysuite.php create mode 100644 test/model/testtask/getlinkablecasesbytesttask.php create mode 100644 test/model/testtask/getpairs.php create mode 100644 test/model/testtask/getproducttasks.php create mode 100644 test/model/testtask/getproductunittasks.php create mode 100644 test/model/testtask/getprojecttasks.php create mode 100644 test/model/testtask/getrelatedtesttasks.php create mode 100644 test/model/testtask/getresults.php create mode 100644 test/model/testtask/getrunbyid.php create mode 100644 test/model/testtask/getruns.php create mode 100644 test/model/testtask/gettaskcases.php create mode 100644 test/model/testtask/gettoandcclist.php create mode 100644 test/model/testtask/getuserruns.php create mode 100644 test/model/testtask/getusertesttaskpairs.php create mode 100644 test/model/testtask/importunitresult.php create mode 100644 test/model/testtask/linkcase.php create mode 100644 test/model/testtask/mergechartoption.php create mode 100644 test/model/testtask/parsecppxmlresult.php create mode 100644 test/model/testtask/parsexmlresult.php create mode 100644 test/model/testtask/parseztffuncresult.php create mode 100644 test/model/testtask/parseztfunitresult.php create mode 100644 test/model/testtask/printcell.php create mode 100644 test/model/testtask/processautoresult.php create mode 100644 test/model/testtask/start.php create mode 100644 test/model/testtask/update.php diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index 18dffc8e02..98acc21e3f 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -67,7 +67,7 @@ function createBug(obj) } else { - window.open(link, '_parent'); + window.open(link, '_blank'); } config.onlybody = onlybody; diff --git a/module/testtask/model.php b/module/testtask/model.php index 76c13112a9..052fe72036 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -355,6 +355,7 @@ class testtaskModel extends model */ public function getAllLinkableCases($task, $query, $linkedCases, $pager) { + a($query); return $this->dao->select('*')->from(TABLE_CASE)->where($query) ->andWhere('id')->notIN($linkedCases) ->andWhere('status')->ne('wait') diff --git a/test/class/testtask.class.php b/test/class/testtask.class.php new file mode 100644 index 0000000000..df515abc6b --- /dev/null +++ b/test/class/testtask.class.php @@ -0,0 +1,226 @@ +objectModel = $tester->loadModel('testtask'); + } + + /** + * Test create testtask. + * + * @param int $projectID + * @param array $params + * @access public + * @return void + */ + public function create($projectID, $params) + { + $_POST = $params; + $taskID = $this->objectModel->create($projectID); + unset($_POST); + + if(dao::isError()) return dao::getError(); + + return $this->objectModel->getById($taskID); + } + + public function update($taskID) + { + $objects = $this->objectModel->update($taskID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function startTest($taskID) + { + $objects = $this->objectModel->start($taskID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function closeTest($taskID) + { + $objects = $this->objectModel->close($taskID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function blockTest($taskID) + { + $objects = $this->objectModel->block($taskID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function activateTest($taskID) + { + $objects = $this->objectModel->activate($taskID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function linkCaseTest($taskID, $type) + { + $objects = $this->objectModel->linkCase($taskID, $type); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getRunsTest($taskID, $moduleID, $orderBy, $pager = null) + { + $objects = $this->objectModel->getRuns($taskID, $moduleID, $orderBy, $pager = null); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getUserRunsTest($taskID, $user, $modules = '', $orderBy = 'id_desc', $pager = null) + { + $objects = $this->objectModel->getUserRuns($taskID, $user, $modules = '', $orderBy = 'id_desc', $pager = null); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getTaskCasesTest($productID, $browseType, $queryID, $moduleID, $sort, $pager, $task) + { + $objects = $this->objectModel->getTaskCases($productID, $browseType, $queryID, $moduleID, $sort, $pager, $task); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getUserTestTaskPairsTest($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array()) + { + $objects = $this->objectModel->getUserTestTaskPairs($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array()); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getRunByIdTest($runID) + { + $objects = $this->objectModel->getRunById($runID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function createResultTest($runID = 0) + { + $objects = $this->objectModel->createResult($runID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function batchRunTest($runCaseType = 'testcase', $taskID = 0) + { + $objects = $this->objectModel->batchRun($runCaseType = 'testcase', $taskID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getResultsTest($runID, $caseID = 0) + { + $objects = $this->objectModel->getResults($runID, $caseID = 0); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function printCellTest($col, $run, $users, $task, $branches, $mode = 'datatable') + { + $objects = $this->objectModel->printCell($col, $run, $users, $task, $branches, $mode = 'datatable'); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getToAndCcListTest($testtask) + { + $objects = $this->objectModel->getToAndCcList($testtask); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function importUnitResultTest($productID) + { + $objects = $this->objectModel->importUnitResult($productID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function processAutoResultTest($testtaskID, $productID, $suites, $cases, $results, $suiteNames = array(), $caseTitles = array(), $auto = 'unit') + { + $objects = $this->objectModel->processAutoResult($testtaskID, $productID, $suites, $cases, $results, $suiteNames = array(), $caseTitles = array(), $auto = 'unit'); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function parseCppXMLResultTest($fileName, $productID, $frame) + { + $objects = $this->objectModel->parseCppXMLResult($fileName, $productID, $frame); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function parseXMLResultTest($fileName, $productID, $frame) + { + $objects = $this->objectModel->parseXMLResult($fileName, $productID, $frame); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function parseZTFUnitResultTest($caseResults, $frame, $productID, $jobID, $compileID) + { + $objects = $this->objectModel->parseZTFUnitResult($caseResults, $frame, $productID, $jobID, $compileID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function parseZTFFuncResultTest($caseResults, $frame, $productID, $jobID, $compileID) + { + $objects = $this->objectModel->parseZTFFuncResult($caseResults, $frame, $productID, $jobID, $compileID); + + if(dao::isError()) return dao::getError(); + + return $objects; + } +} diff --git a/test/model/testtask/activate.php b/test/model/testtask/activate.php new file mode 100644 index 0000000000..b0dd7a65d7 --- /dev/null +++ b/test/model/testtask/activate.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +activate(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->activateTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/batchrun.php b/test/model/testtask/batchrun.php new file mode 100644 index 0000000000..e6432d9995 --- /dev/null +++ b/test/model/testtask/batchrun.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +batchRun(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->batchRunTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/block.php b/test/model/testtask/block.php new file mode 100644 index 0000000000..9389ae2600 --- /dev/null +++ b/test/model/testtask/block.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +block(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->blockTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/close.php b/test/model/testtask/close.php new file mode 100644 index 0000000000..6118e0e800 --- /dev/null +++ b/test/model/testtask/close.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +close(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->closeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/create.php b/test/model/testtask/create.php new file mode 100644 index 0000000000..580fe3c374 --- /dev/null +++ b/test/model/testtask/create.php @@ -0,0 +1,39 @@ +#!/usr/bin/env php +create(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +$normalTask['product'] = 1; +$normalTask['execution'] = 200; +$normalTask['build'] = 11; +$normalTask['type'] = 'system'; +$normalTask['owner'] = 'test10'; +$normalTask['pri'] = 3; +$normalTask['begin'] = '2022-03-05'; +$normalTask['end'] = '2022-09-05'; +$normalTask['status'] = 'wait'; +$normalTask['name'] = '新增测试单'; +$normalTask['desc'] = '新增测试单的描述详情'; + +$emptyNameTask = $normalTask; +$emptyNameTask['name'] = ''; + +$beginGtEndTask = $normalTask; +$beginGtEndTask['begin'] = '2022-10-05'; + +r($testtask->create(11, $normalTask)) && p('id,name,execution,product,type') && e('11,新增测试报告,200,1,system'); // 新增一个正常的测试单 +r($testtask->create(12, $emptyNameTask)) && p('name:0') && e('『名称』不能为空。'); // 新增一个名称为空的测试单 +r($testtask->create(13, $beginGtEndTask)) && p('end:0') && e('『结束日期』应当不小于『2022-10-05』。'); // 新增一个结束日期小于开始日期的测试单 + +system('./ztest init'); diff --git a/test/model/testtask/createresult.php b/test/model/testtask/createresult.php new file mode 100644 index 0000000000..86b7d104d2 --- /dev/null +++ b/test/model/testtask/createresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +createResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->createResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getalllinkablecases.php b/test/model/testtask/getalllinkablecases.php new file mode 100644 index 0000000000..d5cb3d7524 --- /dev/null +++ b/test/model/testtask/getalllinkablecases.php @@ -0,0 +1,30 @@ +#!/usr/bin/env php +getAllLinkableCases(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); +$tester->app->loadClass('pager', $static = true); + +$task1 = $tester->testtask->getById(1); +$task2 = $tester->testtask->getById(2); +$pager = new pager(0, 10, 1); + +$cases1 = $tester->testtask->getAllLinkableCases($task1, '1 = 1', '', $pager); +$cases2 = $tester->testtask->getAllLinkableCases($task2, '1 = 1', '', null); +$cases3 = $tester->testtask->getAllLinkableCases($task2, '1 = 1', '410,408', null); +$cases4 = $tester->testtask->getAllLinkableCases($task2, 'id < 100', '410,408', null); + +r(count($cases1)) && p() && e('10'); // 获取可关联到测试单1的用例列表,每页10条,查看数量 +r(count($cases2)) && p() && e('307'); // 获取可关联到测试单2的用例列表,查看数量 +r(count($cases3)) && p() && e('305'); // 获取可关联到测试单2的用例列表,传入已关联的用例ID,查看数量 +r(count($cases4)) && p() && e('74'); // 获取可关联到测试单2的用例列表,传入sql语句,查看数量 diff --git a/test/model/testtask/getbuginfo.php b/test/model/testtask/getbuginfo.php new file mode 100644 index 0000000000..403a68f025 --- /dev/null +++ b/test/model/testtask/getbuginfo.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getBugInfo(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getBugInfoTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getbyid.php b/test/model/testtask/getbyid.php new file mode 100644 index 0000000000..83b0917ed6 --- /dev/null +++ b/test/model/testtask/getbyid.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php +getById(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +r($tester->testtask->getById(0)) && p('') && e('0'); // 获取ID为0的测试单,返回空 +r($tester->testtask->getById(1)) && p('name,buildName,desc,begin,end') && e('测试单1,执行版本版本11,这是测试单描述1,2022-04-08,2022-04-15'); // 获取ID为1的测试单的详细信息 +r($tester->testtask->getById(2)) && p('name,buildName,desc,begin,end') && e('测试单2,执行版本版本12,这是测试单描述2,2022-04-08,2022-04-15'); // 获取ID为2的测试单的详细信息 +r($tester->testtask->getById(3)) && p('name,buildName,desc,begin,end') && e('测试单3,执行版本版本13,这是测试单描述3,2022-04-08,2022-04-15'); // 获取ID为3的测试单的详细信息 diff --git a/test/model/testtask/getbylist.php b/test/model/testtask/getbylist.php new file mode 100644 index 0000000000..415921da8c --- /dev/null +++ b/test/model/testtask/getbylist.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php +getByList(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$taskIdList = array(1, 2, 3, 4, 5); + +r(count($tester->testtask->getByList($taskIdList))) && p() && e('5'); // 查看按照ID列表获取的测试单的数量 +r($tester->testtask->getByList($taskIdList)) && p('1:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 查看按照ID列表获取的测试单的详情 diff --git a/test/model/testtask/getbyuser.php b/test/model/testtask/getbyuser.php new file mode 100644 index 0000000000..79f1eb22c6 --- /dev/null +++ b/test/model/testtask/getbyuser.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getByUser(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +r(count($tester->testtask->getByUser('user3'))) && p() && e('1'); // 获取用户user3的测试单数量 +r(count($tester->testtask->getByUser('user4'))) && p() && e('1'); // 获取用户user4的测试单数量 +r(count($tester->testtask->getByUser('user5'))) && p() && e('1'); // 获取用户user5的测试单数量 +r(count($tester->testtask->getByUser('user6'))) && p() && e('1'); // 获取用户user6的测试单数量 +r($tester->testtask->getByUser('user3')) && p('0:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 获取用户user3的测试单详细信息 +r($tester->testtask->getByUser('user4')) && p('0:name,type,status,begin,end') && e('测试单2,,doing,2022-04-08,2022-04-15'); // 获取用户user4的测试单详细信息 +r($tester->testtask->getByUser('user5')) && p('0:name,type,status,begin,end') && e('测试单3,,done,2022-04-08,2022-04-15'); // 获取用户user5的测试单详细信息 +r($tester->testtask->getByUser('user6')) && p('0:name,type,status,begin,end') && e('测试单4,,blocked,2022-04-08,2022-04-15'); // 获取用户user6的测试单详细信息 diff --git a/test/model/testtask/getdataoftesttaskpermodule.php b/test/model/testtask/getdataoftesttaskpermodule.php new file mode 100644 index 0000000000..3d1d01437e --- /dev/null +++ b/test/model/testtask/getdataoftesttaskpermodule.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getDataOfTestTaskPerModule(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getDataOfTestTaskPerModuleTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getdataoftesttaskperrunner.php b/test/model/testtask/getdataoftesttaskperrunner.php new file mode 100644 index 0000000000..f44ebce186 --- /dev/null +++ b/test/model/testtask/getdataoftesttaskperrunner.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getDataOfTestTaskPerRunner(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getDataOfTestTaskPerRunnerTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getdataoftesttaskperrunresult.php b/test/model/testtask/getdataoftesttaskperrunresult.php new file mode 100644 index 0000000000..fdc315b5cd --- /dev/null +++ b/test/model/testtask/getdataoftesttaskperrunresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getDataOfTestTaskPerRunResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getDataOfTestTaskPerRunResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getdataoftesttaskpertype.php b/test/model/testtask/getdataoftesttaskpertype.php new file mode 100644 index 0000000000..bea6f554d2 --- /dev/null +++ b/test/model/testtask/getdataoftesttaskpertype.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getDataOfTestTaskPerType(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getDataOfTestTaskPerTypeTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getexecutiontasks.php b/test/model/testtask/getexecutiontasks.php new file mode 100644 index 0000000000..c695907ba7 --- /dev/null +++ b/test/model/testtask/getexecutiontasks.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getExecutionTasks(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$execution101Tasks = $tester->testtask->getExecutionTasks(101); +$execution110Tasks = $tester->testtask->getExecutionTasks(110); +$execution120Tasks = $tester->testtask->getExecutionTasks(120); + +r(count($execution101Tasks)) && p() && e('1'); // 查看迭代101下的所有测试单数量 +r(count($execution110Tasks)) && p() && e('1'); // 查看迭代110下的所有测试单数量 +r(count($execution120Tasks)) && p() && e('0'); // 查看迭代120下的所有测试单数量 +r($execution101Tasks) && p('1:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 查看迭代101下的测试单1的详细信息 +r($execution110Tasks) && p('10:name,type,status,begin,end') && e('测试单10,,doing,2022-04-08,2022-04-15'); // 查看迭代110下的所有测试单10的详细信息 diff --git a/test/model/testtask/getlinkablecasesbybug.php b/test/model/testtask/getlinkablecasesbybug.php new file mode 100644 index 0000000000..72888d689d --- /dev/null +++ b/test/model/testtask/getlinkablecasesbybug.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getLinkableCasesByBug(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getLinkableCasesByBugTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getlinkablecasesbystory.php b/test/model/testtask/getlinkablecasesbystory.php new file mode 100644 index 0000000000..98573bf718 --- /dev/null +++ b/test/model/testtask/getlinkablecasesbystory.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getLinkableCasesByStory(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getLinkableCasesByStoryTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getlinkablecasesbysuite.php b/test/model/testtask/getlinkablecasesbysuite.php new file mode 100644 index 0000000000..372ac2d004 --- /dev/null +++ b/test/model/testtask/getlinkablecasesbysuite.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getLinkableCasesBySuite(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getLinkableCasesBySuiteTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getlinkablecasesbytesttask.php b/test/model/testtask/getlinkablecasesbytesttask.php new file mode 100644 index 0000000000..5e38841f50 --- /dev/null +++ b/test/model/testtask/getlinkablecasesbytesttask.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getLinkableCasesByTestTask(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getLinkableCasesByTestTaskTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getpairs.php b/test/model/testtask/getpairs.php new file mode 100644 index 0000000000..c4cfb4428c --- /dev/null +++ b/test/model/testtask/getpairs.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getPairs(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$appendIdList = array(40, 45, 50); + +$taskPairs1 = $tester->testtask->getPairs(1); +$taskPairs2 = $tester->testtask->getPairs(1, 101); +$taskPairs3 = $tester->testtask->getPairs(1, 101, $appendIdList); + +r(count($taskPairs1)) && p() && e(''); // 获取产品1下的测试单的数量 +r(count($taskPairs2)) && p() && e(''); // 获取产品1下的测试单的数量 +r(count($taskPairs3)) && p() && e(''); // 获取产品1下的测试单的数量 +r($taskPairs1) && p() && e(''); // 获取产品1下的测试单的数量 +r($taskPairs2) && p() && e(''); // 获取产品1下的测试单的数量 +r($taskPairs3) && p() && e(''); // 获取产品1下的测试单的数量 diff --git a/test/model/testtask/getproducttasks.php b/test/model/testtask/getproducttasks.php new file mode 100644 index 0000000000..59008cfa3a --- /dev/null +++ b/test/model/testtask/getproducttasks.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getProductTasks(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$localScope = array('local', 'totalstatus'); +$allScope = array('all', 'totalstatus'); + +$tasks1 = $tester->testtask->getProductTasks(1, 'all', 'id_desc', null, $localScope); +$tasks2 = $tester->testtask->getProductTasks(2, 'all', 'id_asc', null, $allScope); +$tasks3 = $tester->testtask->getProductTasks(2, 'all', 'id_asc', null, $allScope, '2023-01-01'); + +r(count($tasks1)) && p() && e('2'); // 查看产品1下的测试单的数量 +r(count($tasks2)) && p() && e('11'); // 查看系统中所有测试单的数量 +r(count($tasks3)) && p() && e('0'); // 查看系统中所有截止日期大于2023-01-01的测试单的数量 +r($tasks1) && p('11:name,type,begin,end') && e('新增测试报告,system,2022-03-05,2022-09-05'); // 查看ID为11的测试单的详细信息 +r($tasks2) && p('3:name,type,begin,end') && e('测试单3,,2022-04-08,2022-04-15'); // 查看ID为3的测试单的详细信息 diff --git a/test/model/testtask/getproductunittasks.php b/test/model/testtask/getproductunittasks.php new file mode 100644 index 0000000000..004a85bb86 --- /dev/null +++ b/test/model/testtask/getproductunittasks.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getProductUnitTasks(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$tasks = $tester->testtask->getProductUnitTasks(1, 'all'); + +r($testtask->getProductUnitTasksTest()) && p() && e(); diff --git a/test/model/testtask/getprojecttasks.php b/test/model/testtask/getprojecttasks.php new file mode 100644 index 0000000000..f712177ff5 --- /dev/null +++ b/test/model/testtask/getprojecttasks.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getProjectTasks(); +cid=1 +pid=1 + +*/ + +global $tester; +$tester->loadModel('testtask'); + +$project11Tasks = $tester->testtask->getProjectTasks(11); +$project20Tasks = $tester->testtask->getProjectTasks(20); +$project100Tasks = $tester->testtask->getProjectTasks(100); + +r(count($project11Tasks)) && p() && e('1'); // 查看项目11下的所有测试单数量 +r(count($project20Tasks)) && p() && e('1'); // 查看项目20下的所有测试单数量 +r(count($project100Tasks)) && p() && e('0'); // 查看项目100下的所有测试单数量 +r($project11Tasks) && p('1:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 查看项目11下的测试单1的详细信息 +r($project20Tasks) && p('10:name,type,status,begin,end') && e('测试单10,,doing,2022-04-08,2022-04-15'); // 查看项目20下的所有测试单10的详细信息 diff --git a/test/model/testtask/getrelatedtesttasks.php b/test/model/testtask/getrelatedtesttasks.php new file mode 100644 index 0000000000..c7eb77d9fe --- /dev/null +++ b/test/model/testtask/getrelatedtesttasks.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getRelatedTestTasks(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getRelatedTestTasksTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getresults.php b/test/model/testtask/getresults.php new file mode 100644 index 0000000000..c94bb37b9d --- /dev/null +++ b/test/model/testtask/getresults.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getResults(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getResultsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getrunbyid.php b/test/model/testtask/getrunbyid.php new file mode 100644 index 0000000000..8c0a618b55 --- /dev/null +++ b/test/model/testtask/getrunbyid.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getRunById(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getRunByIdTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getruns.php b/test/model/testtask/getruns.php new file mode 100644 index 0000000000..fd2c2f5ebc --- /dev/null +++ b/test/model/testtask/getruns.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getRuns(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getRunsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/gettaskcases.php b/test/model/testtask/gettaskcases.php new file mode 100644 index 0000000000..5bfc555b8c --- /dev/null +++ b/test/model/testtask/gettaskcases.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getTaskCases(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getTaskCasesTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/gettoandcclist.php b/test/model/testtask/gettoandcclist.php new file mode 100644 index 0000000000..83f0d44ce5 --- /dev/null +++ b/test/model/testtask/gettoandcclist.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getToAndCcList(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getToAndCcListTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getuserruns.php b/test/model/testtask/getuserruns.php new file mode 100644 index 0000000000..fa13907f6e --- /dev/null +++ b/test/model/testtask/getuserruns.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getUserRuns(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getUserRunsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/getusertesttaskpairs.php b/test/model/testtask/getusertesttaskpairs.php new file mode 100644 index 0000000000..0eba1ec5f3 --- /dev/null +++ b/test/model/testtask/getusertesttaskpairs.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getUserTestTaskPairs(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->getUserTestTaskPairsTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/importunitresult.php b/test/model/testtask/importunitresult.php new file mode 100644 index 0000000000..1bdf1f153c --- /dev/null +++ b/test/model/testtask/importunitresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +importUnitResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->importUnitResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/linkcase.php b/test/model/testtask/linkcase.php new file mode 100644 index 0000000000..945753da2c --- /dev/null +++ b/test/model/testtask/linkcase.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +linkCase(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->linkCaseTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/mergechartoption.php b/test/model/testtask/mergechartoption.php new file mode 100644 index 0000000000..ac81f6b450 --- /dev/null +++ b/test/model/testtask/mergechartoption.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +mergeChartOption(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->mergeChartOptionTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/parsecppxmlresult.php b/test/model/testtask/parsecppxmlresult.php new file mode 100644 index 0000000000..32f93a51bb --- /dev/null +++ b/test/model/testtask/parsecppxmlresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +parseCppXMLResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->parseCppXMLResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/parsexmlresult.php b/test/model/testtask/parsexmlresult.php new file mode 100644 index 0000000000..152284d716 --- /dev/null +++ b/test/model/testtask/parsexmlresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +parseXMLResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->parseXMLResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/parseztffuncresult.php b/test/model/testtask/parseztffuncresult.php new file mode 100644 index 0000000000..4b342e240d --- /dev/null +++ b/test/model/testtask/parseztffuncresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +parseZTFFuncResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->parseZTFFuncResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/parseztfunitresult.php b/test/model/testtask/parseztfunitresult.php new file mode 100644 index 0000000000..7b46b6ea48 --- /dev/null +++ b/test/model/testtask/parseztfunitresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +parseZTFUnitResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->parseZTFUnitResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/printcell.php b/test/model/testtask/printcell.php new file mode 100644 index 0000000000..8cebbe25cd --- /dev/null +++ b/test/model/testtask/printcell.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +printCell(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->printCellTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/processautoresult.php b/test/model/testtask/processautoresult.php new file mode 100644 index 0000000000..b0e87cc8e2 --- /dev/null +++ b/test/model/testtask/processautoresult.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +processAutoResult(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->processAutoResultTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/start.php b/test/model/testtask/start.php new file mode 100644 index 0000000000..7f4173178c --- /dev/null +++ b/test/model/testtask/start.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +start(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->startTest()) && p() && e(); \ No newline at end of file diff --git a/test/model/testtask/update.php b/test/model/testtask/update.php new file mode 100644 index 0000000000..089ba79348 --- /dev/null +++ b/test/model/testtask/update.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +update(); +cid=1 +pid=1 + +*/ + +$testtask = new testtaskTest(); + +r($testtask->updateTest()) && p() && e(); \ No newline at end of file From a9c203b8665604df9164eba366a8448ca853b426 Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 11 Apr 2022 08:38:13 +0800 Subject: [PATCH 051/181] * Fix bug #21616. --- module/testcase/control.php | 9 ++++++++- module/testcase/js/common.js | 27 +++++++++++++++++-------- module/testcase/model.php | 10 ++++----- module/testcase/view/batchedit.html.php | 2 ++ 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 5896cf1b99..69ae38ebc1 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -964,6 +964,10 @@ class testcase extends control $libID = $productID; $libraries = $this->loadModel('caselib')->getLibraries(); + /* Remove story custom fields from caselib */ + $this->config->testcase->customBatchEditFields = str_replace(',story', '', $this->config->testcase->customBatchEditFields); + $this->config->testcase->custom->batchEditFields = str_replace(',story', '', $this->config->testcase->custom->batchEditFields); + /* Set caselib menu. */ $this->caselib->setLibMenu($libraries, $libID); @@ -1029,11 +1033,11 @@ class testcase extends control $productIdList = array(); foreach($cases as $case) $productIdList[$case->product] = $case->product; - $branches = 0; $branchTagOption = array(); $products = $this->product->getByIdList($productIdList); foreach($products as $product) { + $branches = 0; if($product->type != 'normal') { $branches = $this->loadModel('branch')->getList($product->id, 0, 'all'); @@ -1055,6 +1059,9 @@ class testcase extends control $showSuhosinInfo = common::judgeSuhosinSetting($countInputVars); if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars); + $stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch); + $this->view->stories = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $stories; + /* Set custom. */ foreach(explode(',', $this->config->testcase->customBatchEditFields) as $field) $customFields[$field] = $this->lang->testcase->$field; $this->view->customFields = $customFields; diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index f70847fd18..5d5f4c368c 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -366,16 +366,27 @@ function loadStories(productID, moduleID, num) var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); $.get(storyLink, function(stories) { - if(!stories) modules = ''; + if(!stories) stories = ''; + if(config.currentMethod == 'batchcreate') + { for(var i = num; i < 10 ; i ++) { - if(i != num && $('#module' + i).val() != 'ditto') break; - var nowStories = stories.replaceAll('story' + num, 'story' + i); - $('#story' + i).replaceWith(nowStories); - $('#story' + i + "_chosen").remove(); - $('#story' + i).next('.picker').remove(); - $('#story' + i).attr('name', 'story[' + i + ']'); - $('#story' + i).chosen(); + if(i != num && $('#module' + i).val() != 'ditto') break; + var nowStories = stories.replaceAll('story' + num, 'story' + i); + $('#story' + i).replaceWith(nowStories); + $('#story' + i + "_chosen").remove(); + $('#story' + i).next('.picker').remove(); + $('#story' + i).attr('name', 'story[' + i + ']'); + $('#story' + i).chosen(); } + } + else + { + $('#story' + num).replaceWith(stories); + $('#story' + num + "_chosen").remove(); + $('#story' + num).next('.picker').remove(); + $('#story' + num).attr('name', 'story[' + i + ']'); + $('#story' + num).chosen(); + } }); } diff --git a/module/testcase/model.php b/module/testcase/model.php index f5c10aab36..67c27ead33 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -895,11 +895,10 @@ class testcaseModel extends model foreach($caseIDList as $caseID) { if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; - if($data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; - if($data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; - if($data->story[$caseID] == '') $data->story[$caseID] = 0; + if(isset($data->branches[$caseID]) and $data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; + if(!empty($data->story[$caseID]) and $data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; $prev['pri'] = $data->pris[$caseID]; $prev['type'] = $data->types[$caseID]; @@ -953,8 +952,9 @@ class testcaseModel extends model if(!dao::isError()) { - $isLibCase = ($oldCase->lib and empty($oldCase->product)); - $titleChanged = ($case->title != $oldCase->title); + $isLibCase = ($oldCase->lib and empty($oldCase->product)); + $titleChanged = ($case->title != $oldCase->title); + $case->product = $oldCase->product; if($isLibCase and $titleChanged) $this->dao->update(TABLE_CASE)->set('`title`')->eq($case->title)->where('`fromCaseID`')->eq($caseID)->exec(); $this->updateCase2Project($oldCase, $case, $caseID); diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index 2bbe8ce596..d58a558d58 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -52,6 +52,7 @@ testcase->branch;?> '>testcase->module;?> + '>testcase->story;?> testcase->title;?> testcase->type;?> '>testcase->precondition;?> @@ -91,6 +92,7 @@ ' style='overflow:visible'> '/')), $cases[$caseID]->module, "class='form-control chosen' onchange='loadStories($productID, this.value, $caseID)'");?> + ' style='overflow:visible'>story, "class='form-control chosen'");?>
          From ee5d43bea9a47fa159b46ca1803608b9e1b190a2 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 11 Apr 2022 08:53:28 +0800 Subject: [PATCH 052/181] * Fix bug#18080. --- module/task/model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 18acf88775..69502b6b85 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1194,6 +1194,12 @@ class taskModel extends model $task->consumed = $oldTask->consumed; $task->parent = $oldTask->parent; + if(empty($task->closedReason)) + { + if($oldTask->status == 'done') $task->closedReason = 'done'; + if($oldTask->status == 'cancel') $task->closedReason = 'cancel'; + } + if($oldTask->name != $task->name || $oldTask->estStarted != $task->estStarted || $oldTask->deadline != $task->deadline) { $task->version = $oldTask->version + 1; @@ -1335,7 +1341,6 @@ class taskModel extends model ->checkIF($task->status == 'done' and $task->closedReason, 'closedReason', 'equal', 'done') ->batchCheckIF($task->status == 'done', 'canceledBy, canceledDate', 'empty') - ->checkIF($task->status == 'closed', 'closedReason', 'notempty') ->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty') ->where('id')->eq((int)$taskID) ->exec(); From 327ff135644e0138f1bb30f19d1eb389c5d3665a Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 11 Apr 2022 09:07:38 +0800 Subject: [PATCH 053/181] * Fix bug #21616. --- module/testcase/js/common.js | 2 +- module/testcase/model.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index 5d5f4c368c..4b57ccb400 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -385,7 +385,7 @@ function loadStories(productID, moduleID, num) $('#story' + num).replaceWith(stories); $('#story' + num + "_chosen").remove(); $('#story' + num).next('.picker').remove(); - $('#story' + num).attr('name', 'story[' + i + ']'); + $('#story' + num).attr('name', 'story[' + num + ']'); $('#story' + num).chosen(); } }); diff --git a/module/testcase/model.php b/module/testcase/model.php index 67c27ead33..f545be7627 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -894,9 +894,10 @@ class testcaseModel extends model /* Process data if the value is 'ditto'. */ foreach($caseIDList as $caseID) { - if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; - if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; - if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; + if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; + if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; + if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; + if($data->story[$caseID]) == '') $data->story[$caseID] = 0; if(isset($data->branches[$caseID]) and $data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; if(!empty($data->story[$caseID]) and $data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; From 8e749be5d9c707e21f33cacd10279ec8b9c45dad Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Mon, 11 Apr 2022 09:13:11 +0800 Subject: [PATCH 054/181] update build data --- test/data/build.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/data/build.yaml b/test/data/build.yaml index ef47edb2ff..22ec785fa2 100644 --- a/test/data/build.yaml +++ b/test/data/build.yaml @@ -51,10 +51,22 @@ fields: format: "YYYY-MM-DD" - field: stories - range: '' + fields: + - field: story1 + range: 2-400:4 + prefix: "" + postfix: "," + - field: story2 + range: 4-400:4 - field: bugs - range: ' ' + fields: + - field: bug1 + range: 1-300:3 + prefix: "" + postfix: "," + - field: bug2 + range: 2-400:3 - field: builder range: 1-8 From 4a80b555403ded6ec7a4bc20fc1d102b5acd189f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 11 Apr 2022 09:16:55 +0800 Subject: [PATCH 055/181] * Fix bug #21210. --- module/testcase/js/batchedit.js | 2 +- module/testcase/js/common.js | 2 +- module/testcase/js/showimport.js | 50 +++++++++++++----------- module/testcase/view/showimport.html.php | 2 +- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/module/testcase/js/batchedit.js b/module/testcase/js/batchedit.js index 9df9b0827a..2b56dfa9a5 100644 --- a/module/testcase/js/batchedit.js +++ b/module/testcase/js/batchedit.js @@ -57,7 +57,7 @@ $(function() var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); $.get(storyLink, function(stories) { - if(!stories) modules = ''; + if(!stories) stories = ''; $('#story' + num).replaceWith(stories); $('#story' + num + "_chosen").remove(); $('#story' + num).next('.picker').remove(); diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index f70847fd18..e9c3af13eb 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -361,7 +361,7 @@ function updateStepID() */ function loadStories(productID, moduleID, num) { - var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches'; + var branchIDName = (config.currentMethod == 'batchcreate' || config.currentMethod == 'showimport') ? '#branch' : '#branches'; var branchID = $(branchIDName + num).val(); var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); $.get(storyLink, function(stories) diff --git a/module/testcase/js/showimport.js b/module/testcase/js/showimport.js index aede447892..b6490a25c1 100644 --- a/module/testcase/js/showimport.js +++ b/module/testcase/js/showimport.js @@ -1,25 +1,31 @@ -$(document).on('mouseup', '[id^=story].chosen-with-drop', function() +$("[name^='product']").each(function() { - var select = $(this).prev('select'); - var id = $(select).attr('id'); - var index = id.substring(5); - var moduleID = $('#module' + index).val(); - var branch = $('#branch' + index).length > 0 ? $('#branch' + index).val() : 0; - if(moduleID == 'ditto') + var id = $(this).attr('id'); + $(this).attr('id', 'product' + id.match(/\d+/)); +}); + +$("[name^='branch']").each(function() +{ + var id = $(this).attr('id'); + $(this).attr('id', 'branch' + id.match(/\d+/)); +}); + +$("[name^='story']").each(function() +{ + var id = $(this).attr('id'); + var num = id.substring(5); + var productID = $('#product' + num).val(); + var branchID = $('#branch' + num).val(); + var moduleID = $('#module' + num).val(); + var storyID = $("#story" + num).val(); + var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); + $.get(storyLink, function(stories) { - for(var i = index - 1; i >=0; i--) - { - if($('#module' + i).val() != 'ditto') - { - moduleID = $('#module' + i).val(); - break; - } - } - } - var link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID='+ ($(select).val() || '0') + '&onlyOption=true&status=noclosed&limit=0&type=null'); - var $story = $('#story' + index); - if($story.data('loadLink') !== link) - { - $story.load(link, function(){$story.data('loadLink', link).trigger("chosen:updated");}); - } + if(!stories) stories = ''; + $('#story' + num).replaceWith(stories); + $('#story' + num + "_chosen").remove(); + $('#story' + num).next('.picker').remove(); + $('#story' + num).attr('name', 'story[' + num + ']').chosen(); + $('#story' + num).val(storyID).trigger('chosen:updated'); + }); }); diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php index ea49c6a892..5421771f9e 100644 --- a/module/testcase/view/showimport.html.php +++ b/module/testcase/view/showimport.html.php @@ -82,7 +82,7 @@ $(function() title, ENT_QUOTES), "class='form-control'")?> branch) and $case->branch != 0) ? $modules[BRANCH_MAIN] + $modules[$case->branch] : $modules[BRANCH_MAIN];?> - module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange'")?> + module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange' onchange='loadStories($case->product, this.value, $key)'")?> story) ? $case->story : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->story : '');?> From 50fe51a2e5ad62ba3e1917285f3eedb8c8139072 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 11 Apr 2022 01:18:40 +0000 Subject: [PATCH 056/181] * Fix bug #21320. --- module/user/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php index 0ecc5415d9..9c60710678 100644 --- a/module/user/view/edit.html.php +++ b/module/user/view/edit.html.php @@ -28,7 +28,7 @@ user->basicInfo;?> user->realname;?> - realname, "class='form-control'");?> + realname, "class='form-control' disabled");?> user->role;?> user->roleList, $user->role, "class='form-control'");?> From a8d114fe3c79f6d7e000856a7e46aff9d4cc7695 Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 11 Apr 2022 09:19:19 +0800 Subject: [PATCH 057/181] * Fix bug #21616. --- module/testcase/js/common.js | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index 4b57ccb400..19d05926ee 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -361,32 +361,32 @@ function updateStepID() */ function loadStories(productID, moduleID, num) { - var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches'; - var branchID = $(branchIDName + num).val(); - var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); - $.get(storyLink, function(stories) - { - if(!stories) stories = ''; - if(config.currentMethod == 'batchcreate') - { + var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches'; + var branchID = $(branchIDName + num).val(); + var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); + $.get(storyLink, function(stories) + { + if(!stories) stories = ''; + if(config.currentMethod == 'batchcreate') + { for(var i = num; i < 10 ; i ++) { - if(i != num && $('#module' + i).val() != 'ditto') break; - var nowStories = stories.replaceAll('story' + num, 'story' + i); - $('#story' + i).replaceWith(nowStories); - $('#story' + i + "_chosen").remove(); - $('#story' + i).next('.picker').remove(); - $('#story' + i).attr('name', 'story[' + i + ']'); - $('#story' + i).chosen(); + if(i != num && $('#module' + i).val() != 'ditto') break; + var nowStories = stories.replaceAll('story' + num, 'story' + i); + $('#story' + i).replaceWith(nowStories); + $('#story' + i + "_chosen").remove(); + $('#story' + i).next('.picker').remove(); + $('#story' + i).attr('name', 'story[' + i + ']'); + $('#story' + i).chosen(); } - } - else - { + } + else + { $('#story' + num).replaceWith(stories); $('#story' + num + "_chosen").remove(); $('#story' + num).next('.picker').remove(); $('#story' + num).attr('name', 'story[' + num + ']'); $('#story' + num).chosen(); - } - }); + } + }); } From 512a7dcf785b1488e5888e211dc1736c249343ae Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 11 Apr 2022 09:29:24 +0800 Subject: [PATCH 058/181] * Fix bug #21616. --- module/testcase/js/common.js | 52 ++++++++++++++++++------------------ module/testcase/model.php | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index 19d05926ee..d48ac85f6e 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -361,32 +361,32 @@ function updateStepID() */ function loadStories(productID, moduleID, num) { - var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches'; - var branchID = $(branchIDName + num).val(); - var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); - $.get(storyLink, function(stories) - { - if(!stories) stories = ''; - if(config.currentMethod == 'batchcreate') - { - for(var i = num; i < 10 ; i ++) + var branchIDName = config.currentMethod == 'batchcreate' ? '#branch' : '#branches'; + var branchID = $(branchIDName + num).val(); + var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); + $.get(storyLink, function(stories) + { + if(!stories) stories = ''; + if(config.currentMethod == 'batchcreate') { - if(i != num && $('#module' + i).val() != 'ditto') break; - var nowStories = stories.replaceAll('story' + num, 'story' + i); - $('#story' + i).replaceWith(nowStories); - $('#story' + i + "_chosen").remove(); - $('#story' + i).next('.picker').remove(); - $('#story' + i).attr('name', 'story[' + i + ']'); - $('#story' + i).chosen(); + for(var i = num; i < 10 ; i ++) + { + if(i != num && $('#module' + i).val() != 'ditto') break; + var nowStories = stories.replaceAll('story' + num, 'story' + i); + $('#story' + i).replaceWith(nowStories); + $('#story' + i + "_chosen").remove(); + $('#story' + i).next('.picker').remove(); + $('#story' + i).attr('name', 'story[' + i + ']'); + $('#story' + i).chosen(); + } } - } - else - { - $('#story' + num).replaceWith(stories); - $('#story' + num + "_chosen").remove(); - $('#story' + num).next('.picker').remove(); - $('#story' + num).attr('name', 'story[' + num + ']'); - $('#story' + num).chosen(); - } - }); + else + { + $('#story' + num).replaceWith(stories); + $('#story' + num + "_chosen").remove(); + $('#story' + num).next('.picker').remove(); + $('#story' + num).attr('name', 'story[' + num + ']'); + $('#story' + num).chosen(); + } + }); } diff --git a/module/testcase/model.php b/module/testcase/model.php index f545be7627..3ac9e15002 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -897,7 +897,7 @@ class testcaseModel extends model if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; - if($data->story[$caseID]) == '') $data->story[$caseID] = 0; + if($data->story[$caseID] == '') $data->story[$caseID] = 0; if(isset($data->branches[$caseID]) and $data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; if(!empty($data->story[$caseID]) and $data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; From 2cdf6f1e98862a3b613f3ec62f73d50621c1ea61 Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 11 Apr 2022 09:44:40 +0800 Subject: [PATCH 059/181] * Fix bug #21616. --- 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 3ac9e15002..4948202db4 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -899,7 +899,7 @@ class testcaseModel extends model if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; if($data->story[$caseID] == '') $data->story[$caseID] = 0; if(isset($data->branches[$caseID]) and $data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; - if(!empty($data->story[$caseID]) and $data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; + if($data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; $prev['pri'] = $data->pris[$caseID]; $prev['type'] = $data->types[$caseID]; From 5e5f3c50d13e38623b70c5a5fe2a1f6b068db699 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Mon, 11 Apr 2022 09:50:59 +0800 Subject: [PATCH 060/181] * Fix bug #15146. --- module/task/control.php | 13 ++++++++++++- module/task/lang/en.php | 1 + module/task/lang/zh-cn.php | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index 943641bc5a..f5298d3508 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1455,7 +1455,11 @@ class task extends control } /* Skip parent task when batch close task. */ - if($task->parent == '-1') continue; + if(empty($parentTaskIdList) and ($task->parent == '-1')) + { + $parentTasks[$taskID] = $taskID; + continue; + } /* Skip closed task when batch close task. */ if($task->status == 'closed') continue; @@ -1474,6 +1478,13 @@ class task extends control $cancelURL = $this->server->HTTP_REFERER; return print(js::confirm(sprintf($this->lang->task->error->skipClose, $skipTasks), $confirmURL, $cancelURL, 'self', 'parent')); } + + if(isset($parentTasks) and empty($parentTaskIdList)) + { + $parentTasks = join(',', $parentTasks); + return print(js::alert(sprintf($this->lang->task->error->closeParent, $parentTasks)) . js::reload('parent')); + } + if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); } diff --git a/module/task/lang/en.php b/module/task/lang/en.php index b6eacee3be..1c6c97db04 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -237,6 +237,7 @@ $lang->task->error->left = 'Please enter "Hours Left"'; $lang->task->error->work = '"Comment" must be < %d characters.'; $lang->task->error->skipClose = 'Task: %s is not “Finished” or “Cancelled”. Do you want to close it?'; $lang->task->error->consumed = 'Task: %s hour must be < 0. Ignore changes to this task.'; +$lang->task->error->closeParent = 'Task: %s is the Parent Task, which is automatically closed after all subtasks under the Parent Task are closed and cannot be closed manually.'; $lang->task->error->assignedTo = 'Multi-user task in the current status cannot be assigned to a member who is not in the task team.'; $lang->task->error->consumedEmpty = '"Current Cost" should not be 0.'; $lang->task->error->deadlineSmall = '"Deadline" must be greater than "StartDate".'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index f1a9a910b1..d94b5b1690 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -236,6 +236,7 @@ $lang->task->error->left = '请填写"剩余"'; $lang->task->error->work = '"备注"必须小于%d个字符'; $lang->task->error->teamMember = '团队成员必须不少于2人'; $lang->task->error->skipClose = '任务:%s 不是“已完成”或“已取消”状态,确定要关闭吗?'; +$lang->task->error->closeParent = '任务:%s 是父任务,父任务在其产生的所有子任务关闭后会自动关闭,无法手动关闭。'; $lang->task->error->consumed = '任务:%s工时不能小于0,忽略该任务工时的改动'; $lang->task->error->assignedTo = '当前状态的多人任务不能指派给任务团队外的成员。'; $lang->task->error->consumedEmpty = '"本次消耗"不能为0'; From 7efe1e3726b592401d0caf9970e117002ec3e7c6 Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 11 Apr 2022 10:05:00 +0800 Subject: [PATCH 061/181] * Fix bug #16601. --- module/story/view/tasks.html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/story/view/tasks.html.php b/module/story/view/tasks.html.php index 3c9f772564..a1f9e2e247 100644 --- a/module/story/view/tasks.html.php +++ b/module/story/view/tasks.html.php @@ -55,7 +55,11 @@ include '../../common/view/chart.html.php'; estimate;?> consumed;?> left;?> -
          + +
          +
          progress;?>
          +
          + From df4c83b23a25d56183296dc03cd268bc4f5c2e76 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 11 Apr 2022 10:08:13 +0800 Subject: [PATCH 062/181] * Fix bug #21184. --- module/message/model.php | 2 +- module/release/lang/en.php | 1 + module/release/lang/zh-cn.php | 1 + module/release/model.php | 27 ++++++++++++++------------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/module/message/model.php b/module/message/model.php index 3704dcdc99..83a55e3ebb 100644 --- a/module/message/model.php +++ b/module/message/model.php @@ -183,7 +183,7 @@ class messageModel extends model { /* Get notifiy persons. */ $notifyPersons = array(); - if(!empty($object->notify)) $notifyPersons = $this->loadModel('release')->getNotifyPersons($object->notify, $object->product, $object->build, $object->id); + if(!empty($object->notify)) $notifyPersons = $this->loadModel('release')->getNotifyPersons($object); if(!empty($notifyPersons)) $toList = implode(',', $notifyPersons); } diff --git a/module/release/lang/en.php b/module/release/lang/en.php index 0e4c7114b0..5ebeea5f34 100644 --- a/module/release/lang/en.php +++ b/module/release/lang/en.php @@ -89,3 +89,4 @@ $lang->release->notifyList['QD'] = 'QA Manager'; $lang->release->notifyList['SC'] = 'Story Creator'; $lang->release->notifyList['ET'] = "{$lang->execution->common} Team Members"; $lang->release->notifyList['PT'] = "Project Team Members"; +$lang->release->notifyList['CT'] = "Copy To"; diff --git a/module/release/lang/zh-cn.php b/module/release/lang/zh-cn.php index d0f59ad659..149a5921c2 100644 --- a/module/release/lang/zh-cn.php +++ b/module/release/lang/zh-cn.php @@ -89,3 +89,4 @@ $lang->release->notifyList['QD'] = '测试负责人'; $lang->release->notifyList['SC'] = '需求提交人'; $lang->release->notifyList['ET'] = "所在{$lang->execution->common}团队成员"; $lang->release->notifyList['PT'] = "所在项目团队成员"; +$lang->release->notifyList['CT'] = "抄送给"; diff --git a/module/release/model.php b/module/release/model.php index a1360ff42a..128917fcf9 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -281,21 +281,18 @@ class releaseModel extends model /** * Get notify persons. * - * @param string $notfiyList - * @param int $productID - * @param int $buildID - * @param int $releaseID + * @param object $release * @access public * @return array */ - public function getNotifyPersons($notifyList = '', $productID = 0, $buildID = 0, $releaseID = 0) + public function getNotifyPersons($release) { - if(empty($notifyList)) return array(); + if(empty($release->notify)) return array(); /* Init vars. */ $notifyPersons = array(); $managerFields = ''; - $notifyList = explode(',', $notifyList); + $notifyList = explode(',', $release->notify); foreach($notifyList as $notify) { @@ -303,10 +300,10 @@ class releaseModel extends model { $managerFields .= $notify . ','; } - elseif($notify == 'SC' and !empty($buildID)) + elseif($notify == 'SC' and !empty($release->build)) { - $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($buildID)->fetch('stories'); - $stories .= $this->dao->select('stories')->from(TABLE_RELEASE)->where('id')->eq($releaseID)->fetch('stories'); + $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($release->build)->fetch('stories'); + $stories .= $this->dao->select('stories')->from(TABLE_RELEASE)->where('id')->eq($release->id)->fetch('stories'); $stories = trim($stories, ','); if(empty($stories)) continue; @@ -314,7 +311,7 @@ class releaseModel extends model $openedByList = $this->dao->select('openedBy')->from(TABLE_STORY)->where('id')->in($stories)->fetchPairs(); $notifyPersons += $openedByList; } - elseif(($notify == 'ET' or $notify == 'PT') and !empty($buildID)) + elseif(($notify == 'ET' or $notify == 'PT') and !empty($release->build)) { $type = $notify == 'ET' ? 'execution' : 'project'; $members = $this->dao->select('t2.account')->from(TABLE_BUILD)->alias('t1') @@ -326,12 +323,16 @@ class releaseModel extends model $notifyPersons += $members; } + elseif($notify == 'CT' and !empty($release->mailto)) + { + $notifyPersons += explode(',', trim($release->mailto, ',')); + } } if(!empty($managerFields)) { $managerFields = trim($managerFields, ','); - $managerUsers = $this->dao->select($managerFields)->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch(); + $managerUsers = $this->dao->select($managerFields)->from(TABLE_PRODUCT)->where('id')->eq($release->product)->fetch(); foreach($managerUsers as $account) { if(!isset($notifyPersons[$account])) $notifyPersons[$account] = $account; @@ -577,7 +578,7 @@ class releaseModel extends model /* Get notifiy persons. */ $notifyPersons = array(); - if(!empty($release->notify)) $notifyPersons = $this->getNotifyPersons($release->notify, $release->product, $release->build, $release->id); + if(!empty($release->notify)) $notifyPersons = $this->getNotifyPersons($release); foreach($notifyPersons as $account) { From edc9f9a75a1a688053b50489eec5e3dbe1f2f0f4 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 11 Apr 2022 10:17:52 +0800 Subject: [PATCH 063/181] * Fix bug #21631. --- module/design/control.php | 1 + module/design/js/view.js | 15 +++++++++++++++ module/design/js/viewcommit.js | 4 +--- module/design/view/view.html.php | 4 +++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/module/design/control.php b/module/design/control.php index 601a926bca..4607719e4f 100644 --- a/module/design/control.php +++ b/module/design/control.php @@ -230,6 +230,7 @@ class design extends control $this->view->stories = $this->loadModel('story')->getProductStoryPairs($design->product); $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->actions = $this->loadModel('action')->getList('design', $design->id); + $this->view->repos = $this->loadModel('repo')->getRepoPairs('project', $design->project); $this->display(); } diff --git a/module/design/js/view.js b/module/design/js/view.js index 169bc7dcd8..07bfc10662 100644 --- a/module/design/js/view.js +++ b/module/design/js/view.js @@ -1,4 +1,19 @@ $(function() { $('#subNavbar .nav li[data-id=' + type.toLowerCase() + ']').addClass('active'); + $('#linkCommit').click(function() + { + if(repos.length == 0) + { + var onlybody = config.onlybody; + config.onlybody = 'no'; + + var link = createLink('repo', 'create', 'objectID=' + projectID); + + config.onlybody = onlybody; + window.parent.$.apps.open(link, 'project'); + + return false; + } + }); }) diff --git a/module/design/js/viewcommit.js b/module/design/js/viewcommit.js index 56db3f864e..6d486b3137 100644 --- a/module/design/js/viewcommit.js +++ b/module/design/js/viewcommit.js @@ -10,9 +10,7 @@ $(function() var link = createLink('repo', 'create', 'objectID=' + projectID); config.onlybody = onlybody; - window.parent.$.apps.open(link, 'devops'); - - parent.$('#triggerModal').modal('hide'); + window.parent.$.apps.open(link, 'project'); return false; } diff --git a/module/design/view/view.html.php b/module/design/view/view.html.php index 0f723b76e8..a00c782294 100644 --- a/module/design/view/view.html.php +++ b/module/design/view/view.html.php @@ -12,6 +12,8 @@ ?> type);?> + +project);?>
          + +
          @@ -169,6 +174,26 @@ $(function() $('li.has-list div.hide-in-search').removeClass('hidden'); $('.nav-tabs li.active').find('span').show(); } - }) + if($('.form-control.search-input').val().length > 0) + { + $('#closed').attr("hidden", false); + $('#gray-line').attr("hidden", false); + } + else + { + $('#closed').attr("hidden", true); + $('#gray-line').attr("hidden", true); + } + }); + + $('#swapper #dropMenu').on('onSearchComplete', function(event, value) + { + if($('.list-group.projects').height() == 0) + { + $('#closed').attr("hidden", true); + $('#gray-line').attr("hidden", true); + } + }); + }) From 14c6b4b9dece8b13fa99c3b4300d215777080c8e Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 12 Apr 2022 14:29:29 +0800 Subject: [PATCH 139/181] * Add unit test of programplan. --- test/class/programplan.class.php | 133 +++++++++++++----- test/data/execution.yaml | 2 +- test/model/programplan/create.php | 45 ++++++ .../programplan/getmilestonebyproduct.php | 2 +- test/model/programplan/getpairs.php | 23 +++ test/model/programplan/gettotalpercent.php | 24 ++++ test/model/programplan/iscreatetask.php | 22 +++ test/model/programplan/processplan.php | 22 +++ test/model/programplan/processplans.php | 22 +++ test/model/programplan/settreepath.php | 22 +++ test/model/programplan/update.php | 38 +++++ 11 files changed, 319 insertions(+), 36 deletions(-) create mode 100755 test/model/programplan/create.php create mode 100755 test/model/programplan/getpairs.php create mode 100755 test/model/programplan/gettotalpercent.php create mode 100755 test/model/programplan/iscreatetask.php create mode 100755 test/model/programplan/processplan.php create mode 100755 test/model/programplan/processplans.php create mode 100755 test/model/programplan/settreepath.php create mode 100755 test/model/programplan/update.php diff --git a/test/class/programplan.class.php b/test/class/programplan.class.php index 6fe72f5a32..93cc06401d 100644 --- a/test/class/programplan.class.php +++ b/test/class/programplan.class.php @@ -98,27 +98,36 @@ class programplanTest return implode(',', $objects); } - public function getDataForGanttTest($executionID, $productID, $baselineID = 0, $selectCustom = '', $returnJson = false) + /** + * Test get total percent. + * + * @param int $stageID + * @param bool $parent + * @access public + * @return int + */ + public function getTotalPercentTest($stageID, $parent = false) { - $objects = $this->objectModel->getDataForGantt($executionID, $productID, $baselineID, $selectCustom, $returnJson); + $stage = $this->objectModel->getByID($stageID); + + $int = $this->objectModel->getTotalPercent($stage, $parent); if(dao::isError()) return dao::getError(); - $objects = is_string($objects) ? json_decode($objects) : $objects; - return $objects; + return $int; } - public function getTotalPercentTest($stage, $parent = false) + /** + * Test process plans. + * + * @param array $planIDList + * @access public + * @return array + */ + public function processPlansTest($planIDList) { - $objects = $this->objectModel->getTotalPercent($stage, $parent = false); + $plans = $this->objectModel->getByList($planIDList); - if(dao::isError()) return dao::getError(); - - return $objects; - } - - public function processPlansTest($plans) - { $objects = $this->objectModel->processPlans($plans); if(dao::isError()) return dao::getError(); @@ -126,13 +135,22 @@ class programplanTest return $objects; } - public function processPlanTest($plan) + /** + * Test process plan. + * + * @param int $planID + * @access public + * @return object + */ + public function processPlanTest($planID) { - $objects = $this->objectModel->processPlan($plan); + $plan = $this->objectModel->getByID($planID); + + $object = $this->objectModel->processPlan($plan); if(dao::isError()) return dao::getError(); - return $objects; + return $object; } /** @@ -162,62 +180,109 @@ class programplanTest public function createTest($param = array()) { $_POST['planIDList'] = array('131', '221', '311', '401', '491', '581', '671'); + + global $tester; + $plans = $tester->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($_POST['planIDList'])->fetchAll(); + + $_POST['names'] = array('阶段31', '阶段121', '阶段211', '阶段301', '阶段391', '阶段481', '阶段571', '', '', '', '', ''); $_POST['PM'] = array('', '', '', '', '', '', '', '', '', '', '', ''); $_POST['percents'] = array('0', '0', '0', '0', '0', '0', '0', '', '', '', '', ''); $_POST['attributes'] = array('request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request'); $_POST['acl'] = array('private', 'open', 'open', 'private', 'private', 'open', 'open', 'open', 'open', 'open', 'open', 'open'); $_POST['milestone'] = array('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); - $_POST['begin'] = array('2022-03-13', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', ''); - $_POST['end'] = array('2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', ''); + $_POST['begin'] = (isset($param['begin']) and isset($param['end'])) ? array($plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, '', '', '', '') : array($plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, '', '', '', '', ''); + $_POST['end'] = (isset($param['begin']) and isset($param['end'])) ? array($plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, '', '', '', '') : array($plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, '', '', '', '', ''); $_POST['realBegan'] = array('', '', '', '', '', '', '', '', '', '', '', ''); $_POST['realEnd'] = array('', '', '', '', '', '', '', '', '', '', '', ''); - foreach($param as $field => $value) $_POST[$field] = $value; + foreach($param as $field => $value) + { + if(count($param) == 1 or ($field != 'begin' and $field != 'end')) $_POST[$field] = $value; + } $objects = $this->objectModel->create(41, 0, 0); unset($_POST); - if(dao::isError()) return dao::getError(); + if(dao::isError()) + { + $error = dao::getError()['message'][0]; + $error = strpos($error, '所属项目的') > 0 ? preg_replace('/\d{4}-\d{2}-\d{2}/', '', $error) : $error; + return $error; + } - return $objects; + $objects = $tester->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq($plans[0]->parent)->andWhere('type')->eq('stage')->fetchAll(); + return count($objects); } + /** + * Test set stage tree path. + * + * @param int $planID + * @access public + * @return object + */ public function setTreePathTest($planID) { - $objects = $this->objectModel->setTreePath($planID); + $this->objectModel->setTreePath($planID); if(dao::isError()) return dao::getError(); - return $objects; + $object = $this->objectModel->getByID($planID); + return $object; } - public function updateTest($planID = 0, $projectID = 0) + /** + * updateTest + * + * @param int $planID + * @param int $projectID + * @param array $param + * @param string $index + * @access public + * @return array + */ + public function updateTest($planID, $projectID, $param = array(), $index = '') { - $objects = $this->objectModel->update($planID = 0, $projectID = 0); + $plan = $this->objectModel->getByID($planID); - if(dao::isError()) return dao::getError(); + $_POST['parent'] = $plan->parent; + $_POST['name'] = $plan->name; + $_POST['percent'] = $plan->percent; + $_POST['attribute'] = $plan->attribute; + $_POST['milestone'] = $plan->milestone; + $_POST['acl'] = $plan->acl; + $_POST['begin'] = $plan->begin; + $_POST['end'] = $plan->end; + $_POST['realBegan'] = $plan->realBegan; + $_POST['realEnd'] = $plan->realEnd; - return $objects; - } + foreach($param as $key => $value) $_POST[$key] = $value; - public function printCellTest($col, $plan, $users, $projectID) - { - $objects = $this->objectModel->printCell($col, $plan, $users, $projectID); + $objects = $this->objectModel->update($planID, $projectID); - if(dao::isError()) return dao::getError(); + unset($_POST); + + if(dao::isError()) return $index == 'end' ? preg_replace('/『\d{4}-\d{2}-\d{2}』/', '', dao::getError()[$index][0]) : dao::getError()[$index][0]; return $objects; } + /** + * Test is create task. + * + * @param int $planID + * @access public + * @return int + */ public function isCreateTaskTest($planID) { - $objects = $this->objectModel->isCreateTask($planID); + $object = $this->objectModel->isCreateTask($planID); if(dao::isError()) return dao::getError(); - return $objects; + return $object ? 2 : 1; } /** diff --git a/test/data/execution.yaml b/test/data/execution.yaml index f4f51a8c51..977d864988 100644 --- a/test/data/execution.yaml +++ b/test/data/execution.yaml @@ -22,7 +22,7 @@ fields: - field: status range: wait,doing - field: percent - range: 0 + range: 0{30},10{30},0{30} - field: milestone range: 0{30},1{10},0{10},1{10},0{30} - field: auth diff --git a/test/model/programplan/create.php b/test/model/programplan/create.php new file mode 100755 index 0000000000..470f8156d4 --- /dev/null +++ b/test/model/programplan/create.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php +create(); +cid=1 +pid=1 + +*/ + +$percentNumber = array('percents' => array('a', '0', '0', '0', '0', '0', '0', '', '', '', '', '')); +$emptyBegin = array('begin' => array('', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', '')); +$checkBegin = array('begin' => array('a', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', '')); +$emptyEnd = array('end' => array('', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', '')); +$checkEnd = array('end' => array('a', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', '')); +$planFinishSmall = array('end' => array('2022-03-12', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', '')); +$errorBegin = array('begin' => array('2022-01-01', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', '')); +$errorEnd = array('end' => array('2100-06-18', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', '')); +$percentOver = array('percents' => array('50', '51', '0', '0', '0', '0', '0', '', '', '', '', '')); + +$names = array('阶段31', '阶段121', '阶段211', '阶段301', '阶段391', '阶段481', '阶段571', '新增的阶段', '', '', '', ''); +$percents = array('0', '0', '0', '0', '0', '0', '0', '0', '', '', '', ''); +$begin = array(); +$end = array(); +$create = array('names' => $names, 'percents' => $percents, 'begin' => $begin, 'end' => $end); + + +$programplan = new programplanTest(); + +r($programplan->createTest($percentNumber)) && p() && e('"工作量比例"必须为数字'); // 测试创建用例 工作量占比非数字 +r($programplan->createTest($emptyBegin)) && p() && e('『计划开始』日期不能为空'); // 测试创建用例 计划开始为空 +r($programplan->createTest($checkBegin)) && p() && e('『计划开始』应当为合法的日期'); // 测试创建用例 计划开始非日期 +r($programplan->createTest($emptyEnd)) && p() && e('『计划完成』日期不能为空'); // 测试创建用例 计划完成为空 +r($programplan->createTest($checkEnd)) && p() && e('『计划完成』应当为合法的日期'); // 测试创建用例 计划完成非日期 +r($programplan->createTest($planFinishSmall)) && p() && e('"计划完成时间"必须大于"计划开始时间"'); // 测试创建用例 计划完成小于计划开始 +r($programplan->createTest($errorBegin)) && p() && e("阶段的开始时间不能小于所属项目的开始时间"); // 测试创建用例 计划开始小于项目开始日期 +r($programplan->createTest($errorEnd)) && p() && e("阶段的结束时间不能大于所属项目的结束时间"); // 测试创建用例 计划完成大于项目计划完成 +r($programplan->createTest($percentOver)) && p() && e('工作量占比累计不应当超过100%'); // 测试创建用例 工作量占比之和大于100 +r($programplan->createTest()) && p() && e('7'); // 测试正常更新阶段信息 获取阶段数量 +r($programplan->createTest($create)) && p() && e('8'); // 测试正常创建一条阶段信息 获取阶段数量 +system("./ztest init"); diff --git a/test/model/programplan/getmilestonebyproduct.php b/test/model/programplan/getmilestonebyproduct.php index 617e402db8..0ef6126ebc 100755 --- a/test/model/programplan/getmilestonebyproduct.php +++ b/test/model/programplan/getmilestonebyproduct.php @@ -16,7 +16,7 @@ $productIDList = array(21, 32, 23, 34, 25); $programplan = new programplanTest(); -r($programplan->getMilestoneByProductTest($productIDList[0], $projectIDList[0])) && p() && e('阶段301,阶段481,阶段211,阶段391,阶段571'); // 测试获取产品21 项目41的里程碑 +r($programplan->getMilestoneByProductTest($productIDList[0], $projectIDList[0])) && p() && e('阶段121,阶段301,阶段481,阶段31,阶段211,阶段391,阶段571'); // 测试获取产品21 项目41的里程碑 r($programplan->getMilestoneByProductTest($productIDList[1], $projectIDList[1])) && p() && e('0'); // 测试获取产品32 项目52的里程碑 r($programplan->getMilestoneByProductTest($productIDList[2], $projectIDList[2])) && p() && e('阶段123,阶段303,阶段483,阶段33,阶段213,阶段393,阶段573'); // 测试获取产品23 项目43的里程碑 r($programplan->getMilestoneByProductTest($productIDList[3], $projectIDList[3])) && p() && e('0'); // 测试获取产品34 项目54的里程碑 diff --git a/test/model/programplan/getpairs.php b/test/model/programplan/getpairs.php new file mode 100755 index 0000000000..3feaa421db --- /dev/null +++ b/test/model/programplan/getpairs.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +getPairs(); +cid=1 +pid=1 + +*/ +$executionIDList = array(41, 42, 43, 44, 45); +$productIDList = array(21, 22, 23, 24, 25); + +$programplan = new programplanTest(); + +r($programplan->getPairsTest($executionIDList[0], $productIDList[0])) && p() && e(',阶段31,阶段31/子阶段1,阶段121,阶段211,阶段301,阶段391,阶段481,阶段571'); // 测试获取执行41 产品21的计划键值对 +r($programplan->getPairsTest($executionIDList[1], $productIDList[1])) && p() && e(',阶段32,阶段32/子阶段2,阶段122,阶段212,阶段302,阶段392,阶段482,阶段572'); // 测试获取执行42 产品22的计划键值对 +r($programplan->getPairsTest($executionIDList[2], $productIDList[2])) && p() && e(',阶段33,阶段33/子阶段3,阶段123,阶段213,阶段303,阶段393,阶段483,阶段573'); // 测试获取执行43 产品23的计划键值对 +r($programplan->getPairsTest($executionIDList[3], $productIDList[3])) && p() && e(',阶段34,阶段34/子阶段4,阶段124,阶段214,阶段304,阶段394,阶段484,阶段574'); // 测试获取执行44 产品24的计划键值对 +r($programplan->getPairsTest($executionIDList[4], $productIDList[4])) && p() && e(',阶段35,阶段35/子阶段5,阶段125,阶段215,阶段305,阶段395,阶段485,阶段575'); // 测试获取执行45 产品25的计划键值对 diff --git a/test/model/programplan/gettotalpercent.php b/test/model/programplan/gettotalpercent.php new file mode 100755 index 0000000000..0b5f8d1ca7 --- /dev/null +++ b/test/model/programplan/gettotalpercent.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getTotalPercent(); +cid=1 +pid=1 + +*/ + +$stageIDList = array(131, 132, 133, 134, 135); + +$programplan = new programplanTest(); + +r($programplan->getTotalPercentTest($stageIDList[0])) && p() && e('60'); // 测试获取阶段131的总进度 +r($programplan->getTotalPercentTest($stageIDList[0], true)) && p() && e('0'); // 测试获取阶段131是父阶段的总进度 +r($programplan->getTotalPercentTest($stageIDList[1])) && p() && e('60'); // 测试获取阶段132的总进度 +r($programplan->getTotalPercentTest($stageIDList[2])) && p() && e('60'); // 测试获取阶段133的总进度 +r($programplan->getTotalPercentTest($stageIDList[3])) && p() && e('60'); // 测试获取阶段134的总进度 +r($programplan->getTotalPercentTest($stageIDList[4])) && p() && e('60'); // 测试获取阶段135的总进度 diff --git a/test/model/programplan/iscreatetask.php b/test/model/programplan/iscreatetask.php new file mode 100755 index 0000000000..ff13b8cf8a --- /dev/null +++ b/test/model/programplan/iscreatetask.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +isCreateTask(); +cid=1 +pid=1 + +*/ +$stageIDList = array(131, 132, 133, 134, 135); + +$programplan = new programplanTest(); + +r($programplan->isCreateTaskTest($stageIDList[0])) && p() && e('1'); // 测试阶段131下有没有任务 +r($programplan->isCreateTaskTest($stageIDList[1])) && p() && e('1'); // 测试阶段132下有没有任务 +r($programplan->isCreateTaskTest($stageIDList[2])) && p() && e('1'); // 测试阶段133下有没有任务 +r($programplan->isCreateTaskTest($stageIDList[3])) && p() && e('1'); // 测试阶段134下有没有任务 +r($programplan->isCreateTaskTest($stageIDList[4])) && p() && e('1'); // 测试阶段135下有没有任务 diff --git a/test/model/programplan/processplan.php b/test/model/programplan/processplan.php new file mode 100755 index 0000000000..12b020bd7b --- /dev/null +++ b/test/model/programplan/processplan.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +processPlan(); +cid=1 +pid=1 + +*/ +$planIDList = array(131, 132, 133, 134, 135); + +$programplan = new programplanTest(); + +r($programplan->processPlanTest($planIDList[0])) && p('id,name,productName') && e('131,阶段31,已关闭的正常产品21'); // 测试计算计划131 +r($programplan->processPlanTest($planIDList[1])) && p('id,name,productName') && e('132,阶段32,已关闭的正常产品22'); // 测试计算计划132 +r($programplan->processPlanTest($planIDList[2])) && p('id,name,productName') && e('133,阶段33,已关闭的正常产品23'); // 测试计算计划133 +r($programplan->processPlanTest($planIDList[3])) && p('id,name,productName') && e('134,阶段34,已关闭的正常产品24'); // 测试计算计划134 +r($programplan->processPlanTest($planIDList[4])) && p('id,name,productName') && e('135,阶段35,已关闭的正常产品25'); // 测试计算计划135 diff --git a/test/model/programplan/processplans.php b/test/model/programplan/processplans.php new file mode 100755 index 0000000000..1d8448c233 --- /dev/null +++ b/test/model/programplan/processplans.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +processPlans(); +cid=1 +pid=1 + +*/ +$planIDList = array(array(11, 12), array(13, 14), array(15, 16, 17), array(18, 19, 20), array(21, 22, 23, 24)); + +$programplan = new programplanTest(); + +r($programplan->processPlansTest($planIDList[0])) && p('11:name,productName;12:name,productName') && e('项目1,正常产品1;项目2,正常产品2'); // 测试获取计划 11 12的信息 +r($programplan->processPlansTest($planIDList[1])) && p('13:name,productName;14:name,productName') && e('项目3,正常产品3;项目4,正常产品4'); // 测试获取计划 13 14的信息 +r($programplan->processPlansTest($planIDList[2])) && p('15:name,productName;16:name,productName;17:name,productName') && e('项目5,正常产品5;项目6,正常产品6;项目7,正常产品7'); // 测试获取计划 15 16 17的信息 +r($programplan->processPlansTest($planIDList[3])) && p('18:name,productName;19:name,productName;20:name,productName') && e('项目8,正常产品8;项目9,正常产品9;项目10,正常产品10'); // 测试获取计划 18 19 20的信息 +r($programplan->processPlansTest($planIDList[4])) && p('21:name,productName;22:name,productName;23:name,productName;24:name,productName') && e('项目11,正常产品1;项目12,正常产品2;项目13,正常产品3;项目14,正常产品4'); // 测试获取计划 21 22 23 24的信息 diff --git a/test/model/programplan/settreepath.php b/test/model/programplan/settreepath.php new file mode 100755 index 0000000000..d9e4892a30 --- /dev/null +++ b/test/model/programplan/settreepath.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +setTreePath(); +cid=1 +pid=1 + +*/ +$planIDList = array(131, 132, 133, 134, 135); + +$programplan = new programplanTest(); + +r($programplan->setTreePathTest($planIDList[0])) && p('name;path') && e('阶段31;,41,131,'); // 测试更新计划131的路径 +r($programplan->setTreePathTest($planIDList[1])) && p('name;path') && e('阶段32;,42,132,'); // 测试更新计划132的路径 +r($programplan->setTreePathTest($planIDList[2])) && p('name;path') && e('阶段33;,43,133,'); // 测试更新计划133的路径 +r($programplan->setTreePathTest($planIDList[3])) && p('name;path') && e('阶段34;,44,134,'); // 测试更新计划134的路径 +r($programplan->setTreePathTest($planIDList[4])) && p('name;path') && e('阶段35;,45,135,'); // 测试更新计划135的路径 diff --git a/test/model/programplan/update.php b/test/model/programplan/update.php new file mode 100755 index 0000000000..7312bd196a --- /dev/null +++ b/test/model/programplan/update.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +update(); +cid=1 +pid=1 + +*/ +$planID = 131; +$projectID = 41; + +$beginNotempty = array('begin' => ''); +$endNotempty = array('end' => ''); +$percentOver = array('percent' => 90); +$endLeBegin = array('end' => '2022-01-01'); +$nameNotempty = array('name' => ''); +$changeName = array('name' => '修改后的阶段'); +$changePercent = array('percent' => '15'); +$changeBegin = array('begin' => '2022-04-01'); +$changeEnd = array('end' => '2022-04-30'); + +$programplan = new programplanTest(); + +//r($programplan->updateTest($planID, $projectID, $beginNotempty, 'begin')) && p() && e(''); // 测试修改plan的 begin 值 计划开始为空 +//r($programplan->updateTest($planID, $projectID, $endNotempty, 'end')) && p() && e(''); // 测试修改plan的 end 值 计划完成为空 +r($programplan->updateTest($planID, $projectID, $percentOver, 'percent')) && p() && e('工作量占比累计不应当超过100%'); // 测试修改plan的 percent 值 工作占比和超过100 +r($programplan->updateTest($planID, $projectID, $endLeBegin, 'end')) && p() && e('『end』应当不小于。'); // 测试修改plan的 end 值 计划完成小于计划开始 +r($programplan->updateTest($planID, $projectID, $nameNotempty, 'name')) && p() && e('『name』不能为空。'); // 测试修改plan的 name 值 名称为空 +r($programplan->updateTest($planID, $projectID, $changeName)) && p('0:field,new') && e('name,修改后的阶段'); // 测试修改plan的 name 值 +r($programplan->updateTest($planID, $projectID, $changePercent)) && p('0:field,new') && e('percent,15'); // 测试修改plan的 percent 值 +r($programplan->updateTest($planID, $projectID, $changeBegin)) && p('0:field,new') && e('begin,2022-04-01'); // 测试修改plan的 begin 值 +r($programplan->updateTest($planID, $projectID, $changeEnd)) && p('0:field,new') && e('end,2022-04-30'); // 测试修改plan的 end 值 +system("./ztest init"); From 91597abdb7d1b99cf51c62bc7db29a6bd51b1545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Tue, 12 Apr 2022 14:39:27 +0800 Subject: [PATCH 140/181] *Optimize the code. --- module/execution/view/ajaxgetdropmenu.html.php | 1 - module/project/view/ajaxgetdropmenu.html.php | 1 - 2 files changed, 2 deletions(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 2b1a1165f5..314288d1e4 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -191,6 +191,5 @@ $(function() $('#gray-line').attr("hidden", true); } }); - }) diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index e018d40d62..2f9089478a 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -194,6 +194,5 @@ $(function() $('#gray-line').attr("hidden", true); } }); - }) From 9cb5cb11341ea7a27bc21b2e448a93b7f526a4db Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 12 Apr 2022 14:40:48 +0800 Subject: [PATCH 141/181] * Add api for resolve bug. --- api/v1/entries/bugresolve.php | 40 +++++++++++++++++++++++++++++++++++ config/routes.php | 1 + module/bug/control.php | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 api/v1/entries/bugresolve.php diff --git a/api/v1/entries/bugresolve.php b/api/v1/entries/bugresolve.php new file mode 100644 index 0000000000..6b5cf64ef8 --- /dev/null +++ b/api/v1/entries/bugresolve.php @@ -0,0 +1,40 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + **/ +class bugResolveEntry extends Entry +{ + /** + * POST method. + * + * @param int $bugID + * @access public + * @return void + */ + public function post($bugID) + { + $bug = $this->loadModel('bug')->getByID($bugID); + + $fields = 'resolution,resolvedBuild,resolvedDate,assignedTo,uid,comment'; + $this->batchSetPost($fields); + + $control = $this->loadController('bug', 'resolve'); + $control->resolve($bugID); + + $data = $this->getData(); + if(!$data) return $this->send400('error'); + if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); + + $bug = $this->bug->getByID($bugID); + + $this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,resolvedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); + } +} + diff --git a/config/routes.php b/config/routes.php index c7af65ffab..283d1b11c1 100644 --- a/config/routes.php +++ b/config/routes.php @@ -63,6 +63,7 @@ $routes['/bugs/:id'] = 'bug'; $routes['/bugs/:id/close'] = 'bugClose'; $routes['/bugs/:id/assign'] = 'bugAssign'; $routes['/bugs/:id/confirm'] = 'bugConfirm'; +$routes['/bugs/:id/resolve'] = 'bugResolve'; $routes['/programs/:id/projects'] = 'projects'; $routes['/products/:id/projects'] = 'productProjects'; diff --git a/module/bug/control.php b/module/bug/control.php index f692cd8dc7..2edc808c1e 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1561,7 +1561,7 @@ class bug extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') { - return print(array('status' => 'success', 'data' => $bugID)); + return $this->send(array('status' => 'success', 'data' => $bugID)); } else { From 684196f7766942a9c2253fd61a6ddd615d25f6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Tue, 12 Apr 2022 14:43:05 +0800 Subject: [PATCH 142/181] *Optimize the code. --- module/execution/view/ajaxgetdropmenu.html.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 314288d1e4..4097d03729 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -180,7 +180,6 @@ $(function() $('#closed').attr("hidden", true); $('#gray-line').attr("hidden", true); } - }); $('#swapper #dropMenu').on('onSearchComplete', function(event, value) From 581479860a3a9c8549d4097c6ba26517bfb7e88b Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 12 Apr 2022 15:08:45 +0800 Subject: [PATCH 143/181] * Fix api . --- api/v1/entries/bugassign.php | 2 -- api/v1/entries/bugclose.php | 2 -- api/v1/entries/bugconfirm.php | 2 -- api/v1/entries/bugresolve.php | 2 -- api/v1/entries/storyactive.php | 2 -- api/v1/entries/storyassignto.php | 2 -- api/v1/entries/storyclose.php | 2 -- api/v1/entries/storyreview.php | 2 -- 8 files changed, 16 deletions(-) diff --git a/api/v1/entries/bugassign.php b/api/v1/entries/bugassign.php index 5aed6f06b6..7aa2d2557e 100644 --- a/api/v1/entries/bugassign.php +++ b/api/v1/entries/bugassign.php @@ -20,8 +20,6 @@ class bugAssignEntry extends Entry */ public function post($bugID) { - $bug = $this->loadModel('bug')->getByID($bugID); - $fields = 'assignedTo,mailto,comment'; $this->batchSetPost($fields); diff --git a/api/v1/entries/bugclose.php b/api/v1/entries/bugclose.php index b2de387493..0354297f74 100644 --- a/api/v1/entries/bugclose.php +++ b/api/v1/entries/bugclose.php @@ -20,8 +20,6 @@ class bugCloseEntry extends Entry */ public function post($bugID) { - $bug = $this->loadModel('bug')->getByID($bugID); - $fields = 'comment'; $this->batchSetPost($fields); diff --git a/api/v1/entries/bugconfirm.php b/api/v1/entries/bugconfirm.php index 91dc905ee1..6251bfb8eb 100644 --- a/api/v1/entries/bugconfirm.php +++ b/api/v1/entries/bugconfirm.php @@ -20,8 +20,6 @@ class bugConfirmEntry extends Entry **/ public function post($bugID) { - $bug = $this->loadModel('bug')->getById($bugID); - $fields = 'assignedTo,mailto,comment,pri,type'; $this->batchSetPost($fields); diff --git a/api/v1/entries/bugresolve.php b/api/v1/entries/bugresolve.php index 6b5cf64ef8..560c15541a 100644 --- a/api/v1/entries/bugresolve.php +++ b/api/v1/entries/bugresolve.php @@ -20,8 +20,6 @@ class bugResolveEntry extends Entry */ public function post($bugID) { - $bug = $this->loadModel('bug')->getByID($bugID); - $fields = 'resolution,resolvedBuild,resolvedDate,assignedTo,uid,comment'; $this->batchSetPost($fields); diff --git a/api/v1/entries/storyactive.php b/api/v1/entries/storyactive.php index d5d6189f55..59c86d27a4 100644 --- a/api/v1/entries/storyactive.php +++ b/api/v1/entries/storyactive.php @@ -21,8 +21,6 @@ class storyActiveEntry extends Entry */ public function post($storyID) { - $oldStory = $this->loadModel('story')->getByID($storyID); - $fields = 'assignedTo,status,comment'; $this->batchSetPost($fields); diff --git a/api/v1/entries/storyassignto.php b/api/v1/entries/storyassignto.php index a868427b84..62f9d81b76 100644 --- a/api/v1/entries/storyassignto.php +++ b/api/v1/entries/storyassignto.php @@ -20,8 +20,6 @@ class storyAssignToEntry extends Entry */ public function post($storyID) { - $story = $this->loadModel('story')->getByID($storyID); - $fields = 'assignedTo,comment'; $this->batchSetPost($fields); diff --git a/api/v1/entries/storyclose.php b/api/v1/entries/storyclose.php index a83948232e..28f5b5ebe1 100644 --- a/api/v1/entries/storyclose.php +++ b/api/v1/entries/storyclose.php @@ -20,8 +20,6 @@ class storyCloseEntry extends Entry */ public function post($storyID) { - $story = $this->loadModel('story')->getByID($storyID); - $fields = 'closedReason,duplicateStory,childStories,comment'; $this->batchSetPost($fields); diff --git a/api/v1/entries/storyreview.php b/api/v1/entries/storyreview.php index 887f23cf8a..d2bbef826d 100644 --- a/api/v1/entries/storyreview.php +++ b/api/v1/entries/storyreview.php @@ -21,8 +21,6 @@ class storyReviewEntry extends Entry */ public function post($storyID) { - $oldStory = $this->loadModel('story')->getByID($storyID); - $fields = 'reviewedDate,result,closedReason,pri,estimate,comment'; $this->batchSetPost($fields); From 07a887f62c6f3b07e135b2e392ebabbea211bb4f Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 12 Apr 2022 15:10:20 +0800 Subject: [PATCH 144/181] * Fix bug #17974 for objectlibs method. --- module/doc/js/objectlibs.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/doc/js/objectlibs.js b/module/doc/js/objectlibs.js index 8830c91235..080e036379 100644 --- a/module/doc/js/objectlibs.js +++ b/module/doc/js/objectlibs.js @@ -1,6 +1,13 @@ $(function() { if($.cookie('isFullScreen') == 1) fullScreen(); + + $('.menu-actions > a').click(function() + { + $(this).parent().hasClass('open') ? $(this).css('background', 'none') : $(this).css('background', '#f1f1f1'); + }) + + $('.menu-actions > a').blur(function() {$(this).css('background', 'none');}) }) /** From e1df1915781d96cecce8e4927187388ab5223726 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 12 Apr 2022 15:12:45 +0800 Subject: [PATCH 145/181] * Fix bug #17280. --- module/testcase/view/showimport.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php index 5421771f9e..636397f18e 100644 --- a/module/testcase/view/showimport.html.php +++ b/module/testcase/view/showimport.html.php @@ -82,7 +82,7 @@ $(function() title, ENT_QUOTES), "class='form-control'")?> branch) and $case->branch != 0) ? $modules[BRANCH_MAIN] + $modules[$case->branch] : $modules[BRANCH_MAIN];?> - module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange' onchange='loadStories($case->product, this.value, $key)'")?> + module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange' onchange='loadStories($productID, this.value, $key)'")?> story) ? $case->story : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->story : '');?> From b0e5f808c44a2c289400168bb5b9c4bd33a2a7db Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 12 Apr 2022 15:13:15 +0800 Subject: [PATCH 146/181] * Modify the default value of a function. --- module/testcase/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index a39c3980dd..66e8848b54 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -684,7 +684,7 @@ class testcaseModel extends model * @access public * @return void */ - public function update($caseID, $testtasks = '') + public function update($caseID, $testtasks = array()) { $now = helper::now(); $oldCase = $this->getById($caseID); @@ -897,7 +897,7 @@ class testcaseModel extends model * @access public * @return array */ - public function batchUpdate($testtasks = '') + public function batchUpdate($testtasks = array()) { $cases = array(); $allChanges = array(); From 0ccd5bf9b7aca9f0898c9aa35913c82f56b50716 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 12 Apr 2022 07:19:36 +0000 Subject: [PATCH 147/181] * Fix bug#21002 --- lib/phpthumb/GdThumb.inc.php | 447 ++++++++++++++++++----------------- 1 file changed, 224 insertions(+), 223 deletions(-) diff --git a/lib/phpthumb/GdThumb.inc.php b/lib/phpthumb/GdThumb.inc.php index c185f6e1a3..76d5875eb8 100644 --- a/lib/phpthumb/GdThumb.inc.php +++ b/lib/phpthumb/GdThumb.inc.php @@ -1,18 +1,18 @@ * Copyright (c) 2009, Ian Selby/Gen X Design - * + * * Author(s): Ian Selby - * + * * Licensed under the MIT License * Redistributions of files must retain the above copyright notice. - * + * * @author Ian Selby * @copyright Copyright (c) 2009 Gen X Design * @link http://phpthumb.gxdlabs.com @@ -24,9 +24,9 @@ /** * GdThumb Class Definition - * + * * This is the GD Implementation of the PHP Thumb library. - * + * * @package PhpThumb * @subpackage Core */ @@ -34,74 +34,74 @@ class GdThumb extends ThumbBase { /** * The prior image (before manipulation) - * + * * @var resource */ protected $oldImage; /** * The working image (used during manipulation) - * + * * @var resource */ protected $workingImage; /** * The current dimensions of the image - * + * * @var array */ protected $currentDimensions; /** * The new, calculated dimensions of the image - * + * * @var array */ protected $newDimensions; /** * The options for this class - * + * * This array contains various options that determine the behavior in - * various functions throughout the class. Functions note which specific + * various functions throughout the class. Functions note which specific * option key / values are used in their documentation - * + * * @var array */ protected $options; /** * The maximum width an image can be after resizing (in pixels) - * + * * @var int */ protected $maxWidth; /** * The maximum height an image can be after resizing (in pixels) - * + * * @var int */ protected $maxHeight; /** * The percentage to resize the image by - * + * * @var int */ protected $percent; - + /** * Class Constructor - * - * @return GdThumb + * + * @return GdThumb * @param string $fileName */ public function __construct ($fileName, $options = array(), $isDataStream = false) { parent::__construct($fileName, $isDataStream); - + $this->determineFormat(); - + if ($this->isDataStream === false) { $this->verifyFormatCompatiblity(); } - + switch ($this->format) { case 'GIF': @@ -117,21 +117,21 @@ class GdThumb extends ThumbBase $this->oldImage = imagecreatefromstring($this->fileName); break; } - + $this->currentDimensions = array ( 'width' => imagesx($this->oldImage), 'height' => imagesy($this->oldImage) ); - + $this->setOptions($options); - + // TODO: Port gatherImageMeta to a separate function that can be called to extract exif data } - + /** * Class Destructor - * + * */ public function __destruct () { @@ -139,24 +139,24 @@ class GdThumb extends ThumbBase { imagedestroy($this->oldImage); } - + if (is_resource($this->workingImage)) { imagedestroy($this->workingImage); } } - + ############################## # ----- API FUNCTIONS ------ # ############################## - + /** * Resizes an image to be no larger than $maxWidth or $maxHeight - * + * * If either param is set to zero, then that dimension will not be considered as a part of the resize. * Additionally, if $this->options['resizeUp'] is set to true (false by default), then this function will * also scale the image up to the maximum dimensions provided. - * + * * @param int $maxWidth The maximum width of the image in pixels * @param int $maxHeight The maximum height of the image in pixels * @return GdThumb @@ -168,12 +168,12 @@ class GdThumb extends ThumbBase { throw new InvalidArgumentException('$maxWidth must be numeric'); } - + if (!is_numeric($maxHeight)) { throw new InvalidArgumentException('$maxHeight must be numeric'); } - + // make sure we're not exceeding our image size if we're not supposed to if ($this->options['resizeUp'] === false) { @@ -185,10 +185,10 @@ class GdThumb extends ThumbBase $this->maxHeight = intval($maxHeight); $this->maxWidth = intval($maxWidth); } - + // get the new dimensions... $this->calcImageSize($this->currentDimensions['width'], $this->currentDimensions['height']); - + // create the working image if (function_exists('imagecreatetruecolor')) { @@ -198,9 +198,9 @@ class GdThumb extends ThumbBase { $this->workingImage = imagecreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); } - - $this->preserveAlpha(); - + + $this->preserveAlpha(); + // and create the newly sized image imagecopyresampled ( @@ -220,16 +220,16 @@ class GdThumb extends ThumbBase $this->oldImage = $this->workingImage; $this->currentDimensions['width'] = $this->newDimensions['newWidth']; $this->currentDimensions['height'] = $this->newDimensions['newHeight']; - + return $this; } - + /** * Adaptively Resizes the Image - * - * This function attempts to get the image to as close to the provided dimensions as possible, and then crops the + * + * This function attempts to get the image to as close to the provided dimensions as possible, and then crops the * remaining overflow (from the center) to get the image to be the size specified - * + * * @param int $maxWidth * @param int $maxHeight * @return GdThumb @@ -241,12 +241,12 @@ class GdThumb extends ThumbBase { throw new InvalidArgumentException('$width must be numeric and greater than zero'); } - + if (!is_numeric($height) || $height == 0) { throw new InvalidArgumentException('$height must be numeric and greater than zero'); } - + // make sure we're not exceeding our image size if we're not supposed to if ($this->options['resizeUp'] === false) { @@ -258,12 +258,12 @@ class GdThumb extends ThumbBase $this->maxHeight = intval($height); $this->maxWidth = intval($width); } - + $this->calcImageSizeStrict($this->currentDimensions['width'], $this->currentDimensions['height']); - + // resize the image to be close to our desired dimensions $this->resize($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - + // reset the max dimensions... if ($this->options['resizeUp'] === false) { @@ -275,7 +275,7 @@ class GdThumb extends ThumbBase $this->maxHeight = intval($height); $this->maxWidth = intval($width); } - + // create the working image if (function_exists('imagecreatetruecolor')) { @@ -285,14 +285,14 @@ class GdThumb extends ThumbBase { $this->workingImage = imagecreate($this->maxWidth, $this->maxHeight); } - + $this->preserveAlpha(); - + $cropWidth = $this->maxWidth; $cropHeight = $this->maxHeight; $cropX = 0; $cropY = 0; - + // now, figure out how to crop the rest of the image... if ($this->currentDimensions['width'] > $this->maxWidth) { @@ -302,7 +302,7 @@ class GdThumb extends ThumbBase { $cropY = intval(($this->currentDimensions['height'] - $this->maxHeight) / 2); } - + imagecopyresampled ( $this->workingImage, @@ -316,20 +316,20 @@ class GdThumb extends ThumbBase $cropWidth, $cropHeight ); - + // update all the variables and resources to be correct $this->oldImage = $this->workingImage; $this->currentDimensions['width'] = $this->maxWidth; $this->currentDimensions['height'] = $this->maxHeight; - + return $this; } - + /** * Resizes an image by a given percent uniformly - * + * * Percentage should be whole number representation (i.e. 1-100) - * + * * @param int $percent * @return GdThumb */ @@ -339,11 +339,11 @@ class GdThumb extends ThumbBase { throw new InvalidArgumentException ('$percent must be numeric'); } - + $this->percent = intval($percent); - + $this->calcImageSizePercent($this->currentDimensions['width'], $this->currentDimensions['height']); - + if (function_exists('imagecreatetruecolor')) { $this->workingImage = imagecreatetruecolor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); @@ -352,9 +352,9 @@ class GdThumb extends ThumbBase { $this->workingImage = imagecreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); } - + $this->preserveAlpha(); - + ImageCopyResampled( $this->workingImage, $this->oldImage, @@ -371,15 +371,15 @@ class GdThumb extends ThumbBase $this->oldImage = $this->workingImage; $this->currentDimensions['width'] = $this->newDimensions['newWidth']; $this->currentDimensions['height'] = $this->newDimensions['newHeight']; - + return $this; } - + /** * Crops an image from the center with provided dimensions - * + * * If no height is given, the width will be used as a height, thus creating a square crop - * + * * @param int $cropWidth * @param int $cropHeight * @return GdThumb @@ -390,31 +390,31 @@ class GdThumb extends ThumbBase { throw new InvalidArgumentException('$cropWidth must be numeric'); } - + if ($cropHeight !== null && !is_numeric($cropHeight)) { throw new InvalidArgumentException('$cropHeight must be numeric'); } - + if ($cropHeight === null) { $cropHeight = $cropWidth; } - + $cropWidth = ($this->currentDimensions['width'] < $cropWidth) ? $this->currentDimensions['width'] : $cropWidth; $cropHeight = ($this->currentDimensions['height'] < $cropHeight) ? $this->currentDimensions['height'] : $cropHeight; - + $cropX = intval(($this->currentDimensions['width'] - $cropWidth) / 2); $cropY = intval(($this->currentDimensions['height'] - $cropHeight) / 2); - + $this->crop($cropX, $cropY, $cropWidth, $cropHeight); - + return $this; } - + /** * Vanilla Cropping - Crops from x,y with specified width and height - * + * * @param int $startX * @param int $startY * @param int $cropWidth @@ -428,48 +428,48 @@ class GdThumb extends ThumbBase { throw new InvalidArgumentException('$startX must be numeric'); } - + if (!is_numeric($startY)) { throw new InvalidArgumentException('$startY must be numeric'); } - + if (!is_numeric($cropWidth)) { throw new InvalidArgumentException('$cropWidth must be numeric'); } - + if (!is_numeric($cropHeight)) { throw new InvalidArgumentException('$cropHeight must be numeric'); } - + // do some calculations $cropWidth = ($this->currentDimensions['width'] < $cropWidth) ? $this->currentDimensions['width'] : $cropWidth; $cropHeight = ($this->currentDimensions['height'] < $cropHeight) ? $this->currentDimensions['height'] : $cropHeight; - + // ensure everything's in bounds if (($startX + $cropWidth) > $this->currentDimensions['width']) { $startX = ($this->currentDimensions['width'] - $cropWidth); - + } - + if (($startY + $cropHeight) > $this->currentDimensions['height']) { $startY = ($this->currentDimensions['height'] - $cropHeight); } - - if ($startX < 0) + + if ($startX < 0) { $startX = 0; } - - if ($startY < 0) + + if ($startY < 0) { $startY = 0; } - + // create the working image if (function_exists('imagecreatetruecolor')) { @@ -479,9 +479,9 @@ class GdThumb extends ThumbBase { $this->workingImage = imagecreate($cropWidth, $cropHeight); } - + $this->preserveAlpha(); - + imagecopyresampled ( $this->workingImage, @@ -495,37 +495,37 @@ class GdThumb extends ThumbBase $cropWidth, $cropHeight ); - + $this->oldImage = $this->workingImage; $this->currentDimensions['width'] = $cropWidth; $this->currentDimensions['height'] = $cropHeight; - + return $this; } - + /** * Rotates image either 90 degrees clockwise or counter-clockwise - * + * * @param string $direction * @retunrn GdThumb */ - public function rotateImage ($direction = 'CW') + public function rotateImage ($direction = 'CW') { - if ($direction == 'CW') + if ($direction == 'CW') { $this->rotateImageNDegrees(90); } - else + else { $this->rotateImageNDegrees(-90); } - + return $this; } - + /** * Rotates image specified number of degrees - * + * * @param int $degrees * @return GdThumb */ @@ -535,69 +535,69 @@ class GdThumb extends ThumbBase { throw new InvalidArgumentException('$degrees must be numeric'); } - + if (!function_exists('imagerotate')) { throw new RuntimeException('Your version of GD does not support image rotation.'); } - + $this->workingImage = imagerotate($this->oldImage, $degrees, 0); - + $newWidth = $this->currentDimensions['height']; $newHeight = $this->currentDimensions['width']; $this->oldImage = $this->workingImage; $this->currentDimensions['width'] = $newWidth; $this->currentDimensions['height'] = $newHeight; - + return $this; } - + /** * Shows an image - * + * * This function will show the current image by first sending the appropriate header - * for the format, and then outputting the image data. If headers have already been sent, - * a runtime exception will be thrown - * + * for the format, and then outputting the image data. If headers have already been sent, + * a runtime exception will be thrown + * * @param bool $rawData Whether or not the raw image stream should be output * @return GdThumb */ - public function show ($rawData = false) + public function show ($rawData = false) { if (headers_sent()) { throw new RuntimeException('Cannot show image, headers have already been sent'); } - - switch ($this->format) + + switch ($this->format) { case 'GIF': - if ($rawData === false) - { - header('Content-type: image/gif'); + if ($rawData === false) + { + header('Content-type: image/gif'); } imagegif($this->oldImage); break; case 'JPG': - if ($rawData === false) - { - header('Content-type: image/jpeg'); + if ($rawData === false) + { + header('Content-type: image/jpeg'); } imagejpeg($this->oldImage, null, $this->options['jpegQuality']); break; case 'PNG': case 'STRING': - if ($rawData === false) - { - header('Content-type: image/png'); + if ($rawData === false) + { + header('Content-type: image/png'); } imagepng($this->oldImage); break; } - + return $this; } - + /** * Returns the Working Image as a String * @@ -613,21 +613,21 @@ class GdThumb extends ThumbBase $this->show(true); $data = ob_get_contents(); ob_end_clean(); - + return $data; } - + /** * Saves an image - * + * * This function will make sure the target directory is writeable, and then save the image. - * + * * If the target directory is not writeable, the function will try to correct the permissions (if allowed, this * is set as an option ($this->options['correctPermissions']). If the target cannot be made writeable, then a * RuntimeException is thrown. - * + * * TODO: Create additional paramter for color matte when saving images with alpha to non-alpha formats (i.e. PNG => JPG) - * + * * @param string $fileName The full path and filename of the image to save * @param string $format The format to save the image in (optional, must be one of [GIF,JPG,PNG] * @return GdThumb @@ -636,12 +636,12 @@ class GdThumb extends ThumbBase { $validFormats = array('GIF', 'JPG', 'PNG'); $format = ($format !== null) ? strtoupper($format) : $this->format; - + if (!in_array($format, $validFormats)) { throw new InvalidArgumentException ('Invalid format type specified in save function: ' . $format); } - + // make sure the directory is writeable if (!is_writeable(dirname($fileName))) { @@ -649,7 +649,7 @@ class GdThumb extends ThumbBase if ($this->options['correctPermissions'] === true) { @chmod(dirname($fileName), 0777); - + // throw an exception if not writeable if (!is_writeable(dirname($fileName))) { @@ -662,8 +662,8 @@ class GdThumb extends ThumbBase throw new RuntimeException ('File not writeable: ' . $fileName); } } - - switch ($format) + + switch ($format) { case 'GIF': imagegif($this->oldImage, $fileName); @@ -675,17 +675,17 @@ class GdThumb extends ThumbBase imagepng($this->oldImage, $fileName); break; } - + return $this; } - + ################################# # ----- GETTERS / SETTERS ----- # ################################# - + /** * Sets $this->options to $options - * + * * @param array $options */ public function setOptions ($options = array()) @@ -695,17 +695,17 @@ class GdThumb extends ThumbBase { $this->options = array(); } - + // make sure we've gotten a proper argument if (!is_array($options)) { throw new InvalidArgumentException ('setOptions requires an array'); } - + // we've yet to init the default options, so create them here if (sizeof($this->options) == 0) { - $defaultOptions = array + $defaultOptions = array ( 'resizeUp' => false, 'jpegQuality' => 100, @@ -721,10 +721,10 @@ class GdThumb extends ThumbBase { $defaultOptions = $this->options; } - + $this->options = array_merge($defaultOptions, $options); } - + /** * Returns $currentDimensions. * @@ -734,7 +734,7 @@ class GdThumb extends ThumbBase { return $this->currentDimensions; } - + /** * Sets $currentDimensions. * @@ -745,7 +745,7 @@ class GdThumb extends ThumbBase { $this->currentDimensions = $currentDimensions; } - + /** * Returns $maxHeight. * @@ -755,7 +755,7 @@ class GdThumb extends ThumbBase { return $this->maxHeight; } - + /** * Sets $maxHeight. * @@ -766,7 +766,7 @@ class GdThumb extends ThumbBase { $this->maxHeight = $maxHeight; } - + /** * Returns $maxWidth. * @@ -776,7 +776,7 @@ class GdThumb extends ThumbBase { return $this->maxWidth; } - + /** * Sets $maxWidth. * @@ -787,7 +787,7 @@ class GdThumb extends ThumbBase { $this->maxWidth = $maxWidth; } - + /** * Returns $newDimensions. * @@ -797,7 +797,7 @@ class GdThumb extends ThumbBase { return $this->newDimensions; } - + /** * Sets $newDimensions. * @@ -808,7 +808,7 @@ class GdThumb extends ThumbBase { $this->newDimensions = $newDimensions; } - + /** * Returns $options. * @@ -818,7 +818,7 @@ class GdThumb extends ThumbBase { return $this->options; } - + /** * Returns $percent. * @@ -828,7 +828,7 @@ class GdThumb extends ThumbBase { return $this->percent; } - + /** * Sets $percent. * @@ -838,8 +838,8 @@ class GdThumb extends ThumbBase public function setPercent ($percent) { $this->percent = $percent; - } - + } + /** * Returns $oldImage. * @@ -849,7 +849,7 @@ class GdThumb extends ThumbBase { return $this->oldImage; } - + /** * Sets $oldImage. * @@ -860,7 +860,7 @@ class GdThumb extends ThumbBase { $this->oldImage = $oldImage; } - + /** * Returns $workingImage. * @@ -870,7 +870,7 @@ class GdThumb extends ThumbBase { return $this->workingImage; } - + /** * Sets $workingImage. * @@ -880,17 +880,17 @@ class GdThumb extends ThumbBase public function setWorkingImage ($workingImage) { $this->workingImage = $workingImage; - } - - + } + + ################################# # ----- UTILITY FUNCTIONS ----- # ################################# - + /** * Calculates a new width and height for the image based on $this->maxWidth and the provided dimensions - * - * @return array + * + * @return array * @param int $width * @param int $height */ @@ -898,18 +898,18 @@ class GdThumb extends ThumbBase { $newWidthPercentage = (100 * $this->maxWidth) / $width; $newHeight = ($height * $newWidthPercentage) / 100; - + return array ( 'newWidth' => intval($this->maxWidth), 'newHeight' => intval($newHeight) ); } - + /** * Calculates a new width and height for the image based on $this->maxWidth and the provided dimensions - * - * @return array + * + * @return array * @param int $width * @param int $height */ @@ -917,18 +917,18 @@ class GdThumb extends ThumbBase { $newHeightPercentage = (100 * $this->maxHeight) / $height; $newWidth = ($width * $newHeightPercentage) / 100; - + return array ( 'newWidth' => ceil($newWidth), 'newHeight' => ceil($this->maxHeight) ); } - + /** * Calculates a new width and height for the image based on $this->percent and the provided dimensions - * - * @return array + * + * @return array * @param int $width * @param int $height */ @@ -936,19 +936,19 @@ class GdThumb extends ThumbBase { $newWidth = ($width * $this->percent) / 100; $newHeight = ($height * $this->percent) / 100; - - return array + + return array ( 'newWidth' => ceil($newWidth), 'newHeight' => ceil($newHeight) ); } - + /** * Calculates the new image dimensions - * + * * These calculations are based on both the provided dimensions and $this->maxWidth and $this->maxHeight - * + * * @param int $width * @param int $height */ @@ -959,33 +959,33 @@ class GdThumb extends ThumbBase 'newWidth' => $width, 'newHeight' => $height ); - + if ($this->maxWidth > 0) { $newSize = $this->calcWidth($width, $height); - + if ($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) { $newSize = $this->calcHeight($newSize['newWidth'], $newSize['newHeight']); } } - + if ($this->maxHeight > 0) { $newSize = $this->calcHeight($width, $height); - + if ($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) { $newSize = $this->calcWidth($newSize['newWidth'], $newSize['newHeight']); } } - + $this->newDimensions = $newSize; } - + /** - * Calculates new image dimensions, not allowing the width and height to be less than either the max width or height - * + * Calculates new image dimensions, not allowing the width and height to be less than either the max width or height + * * @param int $width * @param int $height */ @@ -998,7 +998,7 @@ class GdThumb extends ThumbBase if ($width > $height) { $newDimensions = $this->calcHeight($width, $height); - + if ($newDimensions['newWidth'] < $this->maxWidth) { $newDimensions = $this->calcWidth($width, $height); @@ -1007,7 +1007,7 @@ class GdThumb extends ThumbBase elseif ($height >= $width) { $newDimensions = $this->calcWidth($width, $height); - + if ($newDimensions['newHeight'] < $this->maxHeight) { $newDimensions = $this->calcHeight($width, $height); @@ -1019,7 +1019,7 @@ class GdThumb extends ThumbBase if ($width >= $height) { $newDimensions = $this->calcWidth($width, $height); - + if ($newDimensions['newHeight'] < $this->maxHeight) { $newDimensions = $this->calcHeight($width, $height); @@ -1028,20 +1028,20 @@ class GdThumb extends ThumbBase elseif ($height > $width) { $newDimensions = $this->calcHeight($width, $height); - + if ($newDimensions['newWidth'] < $this->maxWidth) { $newDimensions = $this->calcWidth($width, $height); } } } - + $this->newDimensions = $newDimensions; } - + /** * Calculates new dimensions based on $this->percent and the provided dimensions - * + * * @param int $width * @param int $height */ @@ -1052,12 +1052,12 @@ class GdThumb extends ThumbBase $this->newDimensions = $this->calcPercent($width, $height); } } - + /** * Determines the file format by mime-type - * + * * This function will throw exceptions for invalid images / mime-types - * + * */ protected function determineFormat () { @@ -1066,9 +1066,9 @@ class GdThumb extends ThumbBase $this->format = 'STRING'; return; } - + $formatInfo = getimagesize($this->fileName); - + // non-image files will return false if ($formatInfo === false) { @@ -1080,19 +1080,20 @@ class GdThumb extends ThumbBase { $this->triggerError('File is not a valid image: ' . $this->fileName); } - + // make sure we really stop execution return; } - + $mimeType = isset($formatInfo['mime']) ? $formatInfo['mime'] : null; - + switch ($mimeType) { case 'image/gif': $this->format = 'GIF'; break; case 'image/jpeg': + case 'image/x-ms-bmp': $this->format = 'JPG'; break; case 'image/png': @@ -1102,16 +1103,16 @@ class GdThumb extends ThumbBase $this->triggerError('Image format not supported: ' . $mimeType); } } - + /** * Makes sure the correct GD implementation exists for the file type - * + * */ protected function verifyFormatCompatiblity () { $isCompatible = true; $gdInfo = gd_info(); - + switch ($this->format) { case 'GIF': @@ -1126,44 +1127,44 @@ class GdThumb extends ThumbBase default: $isCompatible = false; } - + if (!$isCompatible) { // one last check for "JPEG" instead $isCompatible = $gdInfo['JPEG Support']; - + if (!$isCompatible) { $this->triggerError('Your GD installation does not support ' . $this->format . ' image types'); } } } - + /** * Preserves the alpha or transparency for PNG and GIF files - * + * * Alpha / transparency will not be preserved if the appropriate options are set to false. - * Also, the GIF transparency is pretty skunky (the results aren't awesome), but it works like a + * Also, the GIF transparency is pretty skunky (the results aren't awesome), but it works like a * champ... that's the nature of GIFs tho, so no huge surprise. - * + * * This functionality was originally suggested by commenter Aimi (no links / site provided) - Thanks! :) - * + * */ protected function preserveAlpha () { if ($this->format == 'PNG' && $this->options['preserveAlpha'] === true) { imagealphablending($this->workingImage, false); - + $colorTransparent = imagecolorallocatealpha ( - $this->workingImage, - $this->options['alphaMaskColor'][0], - $this->options['alphaMaskColor'][1], - $this->options['alphaMaskColor'][2], + $this->workingImage, + $this->options['alphaMaskColor'][0], + $this->options['alphaMaskColor'][1], + $this->options['alphaMaskColor'][2], 0 ); - + imagefill($this->workingImage, 0, 0, $colorTransparent); imagesavealpha($this->workingImage, true); } @@ -1172,14 +1173,14 @@ class GdThumb extends ThumbBase { $colorTransparent = imagecolorallocate ( - $this->workingImage, - $this->options['transparencyMaskColor'][0], - $this->options['transparencyMaskColor'][1], - $this->options['transparencyMaskColor'][2] + $this->workingImage, + $this->options['transparencyMaskColor'][0], + $this->options['transparencyMaskColor'][1], + $this->options['transparencyMaskColor'][2] ); - + imagecolortransparent($this->workingImage, $colorTransparent); imagetruecolortopalette($this->workingImage, true, 256); } } -} \ No newline at end of file +} From 69be820156e56b7d175f7b0b10ef65728308c153 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 12 Apr 2022 15:19:39 +0800 Subject: [PATCH 148/181] * Restore code. --- module/personnel/model.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/personnel/model.php b/module/personnel/model.php index a083478c44..14456461f9 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -797,7 +797,7 @@ class personnelModel extends model */ public function deleteExecutionWhitelist($executionID, $account = '') { - $execution = $this->dao->select('id,whitelist,project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch(); + $execution = $this->dao->select('id,whitelist')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch(); if(empty($execution)) return false; $result = $this->dao->delete()->from(TABLE_ACL) @@ -816,7 +816,6 @@ class personnelModel extends model $viewExecutions = $this->dao->select('sprints')->from(TABLE_USERVIEW)->where('account')->eq($account)->fetch('sprints'); $newViewExecutions = trim(str_replace(",$executionID,", '', ",$viewExecutions,"), ','); $this->dao->update(TABLE_USERVIEW)->set('sprints')->eq($newViewExecutions)->where('account')->eq($account)->exec(); - $this->deleteProjectWhitelist($execution->project, $account); } } From a13a8ce57028377fe43352230280b50ab1af027d Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 12 Apr 2022 15:23:31 +0800 Subject: [PATCH 149/181] * Fix api. --- api/v1/entries/bugassign.php | 2 +- api/v1/entries/bugclose.php | 3 +-- api/v1/entries/bugconfirm.php | 2 +- api/v1/entries/bugresolve.php | 2 +- api/v1/entries/storyassignto.php | 2 +- api/v1/entries/storyclose.php | 2 +- config/routes.php | 1 + 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/v1/entries/bugassign.php b/api/v1/entries/bugassign.php index 7aa2d2557e..3b505d0a12 100644 --- a/api/v1/entries/bugassign.php +++ b/api/v1/entries/bugassign.php @@ -30,7 +30,7 @@ class bugAssignEntry extends Entry if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - $bug = $this->bug->getByID($bugID); + $bug = $this->loadModel('bug')->getByID($bugID); $this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); } diff --git a/api/v1/entries/bugclose.php b/api/v1/entries/bugclose.php index 0354297f74..4a95bbda36 100644 --- a/api/v1/entries/bugclose.php +++ b/api/v1/entries/bugclose.php @@ -29,8 +29,7 @@ class bugCloseEntry extends Entry $data = $this->getData(); if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - - $bug = $this->bug->getByID($bugID); + $bug = $this->loadModel('bug')->getByID($bugID); $this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); } diff --git a/api/v1/entries/bugconfirm.php b/api/v1/entries/bugconfirm.php index 6251bfb8eb..c9875aaeda 100644 --- a/api/v1/entries/bugconfirm.php +++ b/api/v1/entries/bugconfirm.php @@ -30,7 +30,7 @@ class bugConfirmEntry extends Entry if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - $bug = $this->bug->getById($bugID); + $bug = this->loadModel('bug')->getByID($bugID); $this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); } diff --git a/api/v1/entries/bugresolve.php b/api/v1/entries/bugresolve.php index 560c15541a..e8c699c784 100644 --- a/api/v1/entries/bugresolve.php +++ b/api/v1/entries/bugresolve.php @@ -30,7 +30,7 @@ class bugResolveEntry extends Entry if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - $bug = $this->bug->getByID($bugID); + $bug = $this->loadModel('bug')->getByID($bugID); $this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,resolvedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); } diff --git a/api/v1/entries/storyassignto.php b/api/v1/entries/storyassignto.php index 62f9d81b76..e101cb17e1 100644 --- a/api/v1/entries/storyassignto.php +++ b/api/v1/entries/storyassignto.php @@ -30,7 +30,7 @@ class storyAssignToEntry extends Entry if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - $story = $this->story->getByID($storyID); + $story = $this->loadModel('story')->getByID($storyID); $this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); } diff --git a/api/v1/entries/storyclose.php b/api/v1/entries/storyclose.php index 28f5b5ebe1..4d4141b88a 100644 --- a/api/v1/entries/storyclose.php +++ b/api/v1/entries/storyclose.php @@ -30,7 +30,7 @@ class storyCloseEntry extends Entry if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - $story = $this->story->getByID($storyID); + $story = $this->loadModel('story')->getByID($storyID); $this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); } diff --git a/config/routes.php b/config/routes.php index 283d1b11c1..fbd3fdb26a 100644 --- a/config/routes.php +++ b/config/routes.php @@ -64,6 +64,7 @@ $routes['/bugs/:id/close'] = 'bugClose'; $routes['/bugs/:id/assign'] = 'bugAssign'; $routes['/bugs/:id/confirm'] = 'bugConfirm'; $routes['/bugs/:id/resolve'] = 'bugResolve'; +$routes['/bugs/:id/active'] = 'bugActive'; $routes['/programs/:id/projects'] = 'projects'; $routes['/products/:id/projects'] = 'productProjects'; From 4aaefa9fb7914c7660930b7c055bf467c9c957fa Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 12 Apr 2022 15:24:47 +0800 Subject: [PATCH 150/181] * Fix bug #18065. --- module/bug/config.php | 1 + module/bug/control.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index e906790f76..b73dec9c3e 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -37,6 +37,7 @@ $config->bug->list->exportFields = 'id, product, branch, module, project, execut case, lastEditedBy, lastEditedDate, files'; +if($config->systemMode == 'classic') $config->bug->list->exportFields = str_replace(' project,', '', $config->bug->list->exportFields); $config->bug->list->customCreateFields = 'execution,story,task,pri,severity,os,browser,deadline,mailto,keywords'; $config->bug->list->customBatchCreateFields = 'execution,steps,type,pri,deadline,severity,os,browser,keywords'; diff --git a/module/bug/control.php b/module/bug/control.php index c799e7d6e6..7d55a0a81e 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2045,8 +2045,6 @@ class bug extends control */ public function export($productID, $orderBy, $browseType = '', $executionID = 0) { - if($this->config->systemMode == 'classic') $this->config->bug->list->exportFields = str_replace(' project,', '', $this->config->bug->list->exportFields); - if($_POST) { $this->loadModel('file'); From 0909c6602be31b2660a8325502f3ed65c5d3dff8 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 12 Apr 2022 15:25:04 +0800 Subject: [PATCH 151/181] * Add api for active bug. --- api/v1/entries/bugactive.php | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 api/v1/entries/bugactive.php diff --git a/api/v1/entries/bugactive.php b/api/v1/entries/bugactive.php new file mode 100644 index 0000000000..d9029fa978 --- /dev/null +++ b/api/v1/entries/bugactive.php @@ -0,0 +1,38 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + **/ +class bugActiveEntry extends Entry +{ + /** + * POST method. + * + * @param int $bugID + * @access public + * @return void + */ + public function post($bugID) + { + $fields = 'assignedTo,uid,resolvedBuild,comment'; + $this->batchSetPost($fields); + + $control = $this->loadController('bug', 'activate'); + $control->activate($bugID); + + $data = $this->getData(); + if(!$data) return $this->send400('error'); + if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); + + $bug = $this->loadModel('bug')->getByID($bugID); + + $this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); + } +} + From e7314a8343e09690ca588f8bc756ae95eff4279e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 12 Apr 2022 15:27:51 +0800 Subject: [PATCH 152/181] * Fix bug#19625. --- module/execution/model.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index b78e43efea..bfe6908a0b 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3315,8 +3315,6 @@ class executionModel extends model ->page($pager) ->fetchAll('id'); - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task'); - if($tasks) return $this->loadModel('task')->processTasks($tasks); return array(); } From 95e6a143a86d7bf2807a944697602ade9840a673 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Tue, 12 Apr 2022 15:37:55 +0800 Subject: [PATCH 153/181] * Move doc lang. --- module/doc/lang/en.php | 66 +++++++++++++++++++-------------------- module/doc/lang/zh-cn.php | 66 +++++++++++++++++++-------------------- module/doc/lang/zh-tw.php | 64 ++++++++++++++++++------------------- 3 files changed, 98 insertions(+), 98 deletions(-) diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 5830a1b3bb..7fa62b2cd8 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -9,6 +9,39 @@ * @version $Id: en.php 824 2010-05-02 15:32:06Z wwccss $ * @link http://www.zentao.net */ +$lang->doclib = new stdclass(); +$lang->doclib->name = 'Name'; +$lang->doclib->control = 'Access Control'; +$lang->doclib->group = 'Group'; +$lang->doclib->user = 'User'; +$lang->doclib->files = 'Attachments'; +$lang->doclib->all = 'All Libraries'; +$lang->doclib->select = 'Select'; +$lang->doclib->execution = $lang->executionCommon . ' Library'; +$lang->doclib->product = $lang->productCommon . ' Library'; +$lang->doclib->apiLibName = 'Api Library Name'; + +$lang->doclib->aclListA['default'] = 'Default'; +$lang->doclib->aclListA['custom'] = 'Custom'; + +$lang->doclib->aclListB['open'] = 'Public'; +$lang->doclib->aclListB['custom'] = 'Custom'; +$lang->doclib->aclListB['private'] = 'Private'; + +$lang->doclib->create['product'] = 'Create ' . $lang->productCommon . ' Library'; +$lang->doclib->create['execution'] = 'Create ' . $lang->executionCommon . ' Library'; +$lang->doclib->create['custom'] = 'Create Custom Library'; + +$lang->doclib->main['product'] = 'Primary Library'; +$lang->doclib->main['project'] = 'Primary Library'; +$lang->doclib->main['execution'] = 'Primary Library'; + +$lang->doclib->tabList['product'] = $lang->productCommon; +$lang->doclib->tabList['execution'] = $lang->executionCommon; +$lang->doclib->tabList['custom'] = 'Custom'; + +$lang->doclib->nameList['custom'] = 'Custom Name'; + /* Fields. */ $lang->doc->common = 'Document'; $lang->doc->id = 'ID'; @@ -229,36 +262,3 @@ $lang->doc->placeholder->url = 'URL'; $lang->doc->summary = "Total files on this page: %s , total size: %s, %s."; $lang->doc->ge = ':'; $lang->doc->point = '.'; - -$lang->doclib = new stdclass(); -$lang->doclib->name = 'Name'; -$lang->doclib->control = 'Access Control'; -$lang->doclib->group = 'Group'; -$lang->doclib->user = 'User'; -$lang->doclib->files = 'Attachments'; -$lang->doclib->all = 'All Libraries'; -$lang->doclib->select = 'Select'; -$lang->doclib->execution = $lang->executionCommon . ' Library'; -$lang->doclib->product = $lang->productCommon . ' Library'; -$lang->doclib->apiLibName = 'Api Library Name'; - -$lang->doclib->aclListA['default'] = 'Default'; -$lang->doclib->aclListA['custom'] = 'Custom'; - -$lang->doclib->aclListB['open'] = 'Public'; -$lang->doclib->aclListB['custom'] = 'Custom'; -$lang->doclib->aclListB['private'] = 'Private'; - -$lang->doclib->create['product'] = 'Create ' . $lang->productCommon . ' Library'; -$lang->doclib->create['execution'] = 'Create ' . $lang->executionCommon . ' Library'; -$lang->doclib->create['custom'] = 'Create Custom Library'; - -$lang->doclib->main['product'] = 'Primary Library'; -$lang->doclib->main['project'] = 'Primary Library'; -$lang->doclib->main['execution'] = 'Primary Library'; - -$lang->doclib->tabList['product'] = $lang->productCommon; -$lang->doclib->tabList['execution'] = $lang->executionCommon; -$lang->doclib->tabList['custom'] = 'Custom'; - -$lang->doclib->nameList['custom'] = 'Custom Name'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 3434c59ccb..c850ff1b94 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -9,6 +9,39 @@ * @version $Id: zh-cn.php 824 2010-05-02 15:32:06Z wwccss $ * @link http://www.zentao.net */ +$lang->doclib = new stdclass(); +$lang->doclib->name = '文档库名称'; +$lang->doclib->control = '访问控制'; +$lang->doclib->group = '分组'; +$lang->doclib->user = '用户'; +$lang->doclib->files = '附件库'; +$lang->doclib->all = '所有文档库'; +$lang->doclib->select = '选择文档库'; +$lang->doclib->execution = $lang->executionCommon . '库'; +$lang->doclib->product = $lang->productCommon . '库'; +$lang->doclib->apiLibName = '接口库名称'; + +$lang->doclib->aclListA['default'] = '默认'; +$lang->doclib->aclListA['custom'] = '自定义'; + +$lang->doclib->aclListB['open'] = '公开'; +$lang->doclib->aclListB['custom'] = '自定义'; +$lang->doclib->aclListB['private'] = '私有'; + +$lang->doclib->create['product'] = '创建' . $lang->productCommon . '文档库'; +$lang->doclib->create['execution'] = '创建' . $lang->executionCommon . '文档库'; +$lang->doclib->create['custom'] = '创建自定义文档库'; + +$lang->doclib->main['product'] = $lang->productCommon . '主库'; +$lang->doclib->main['project'] = '项目主库'; +$lang->doclib->main['execution'] = $lang->executionCommon . '主库'; + +$lang->doclib->tabList['product'] = $lang->productCommon; +$lang->doclib->tabList['execution'] = $lang->executionCommon; +$lang->doclib->tabList['custom'] = '自定义'; + +$lang->doclib->nameList['custom'] = '自定义文档库名称'; + /* 字段列表。*/ $lang->doc->common = '文档'; $lang->doc->id = '编号'; @@ -229,36 +262,3 @@ $lang->doc->placeholder->url = '相应的链接地址'; $lang->doc->summary = "本页共 %s 个附件,共计 %s,其中%s。"; $lang->doc->ge = '个'; $lang->doc->point = '、'; - -$lang->doclib = new stdclass(); -$lang->doclib->name = '文档库名称'; -$lang->doclib->control = '访问控制'; -$lang->doclib->group = '分组'; -$lang->doclib->user = '用户'; -$lang->doclib->files = '附件库'; -$lang->doclib->all = '所有文档库'; -$lang->doclib->select = '选择文档库'; -$lang->doclib->execution = $lang->executionCommon . '库'; -$lang->doclib->product = $lang->productCommon . '库'; -$lang->doclib->apiLibName = '接口库名称'; - -$lang->doclib->aclListA['default'] = '默认'; -$lang->doclib->aclListA['custom'] = '自定义'; - -$lang->doclib->aclListB['open'] = '公开'; -$lang->doclib->aclListB['custom'] = '自定义'; -$lang->doclib->aclListB['private'] = '私有'; - -$lang->doclib->create['product'] = '创建' . $lang->productCommon . '文档库'; -$lang->doclib->create['execution'] = '创建' . $lang->executionCommon . '文档库'; -$lang->doclib->create['custom'] = '创建自定义文档库'; - -$lang->doclib->main['product'] = $lang->productCommon . '主库'; -$lang->doclib->main['project'] = '项目主库'; -$lang->doclib->main['execution'] = $lang->executionCommon . '主库'; - -$lang->doclib->tabList['product'] = $lang->productCommon; -$lang->doclib->tabList['execution'] = $lang->executionCommon; -$lang->doclib->tabList['custom'] = '自定义'; - -$lang->doclib->nameList['custom'] = '自定义文档库名称'; diff --git a/module/doc/lang/zh-tw.php b/module/doc/lang/zh-tw.php index 70e9bf911b..2e9ea61fdc 100644 --- a/module/doc/lang/zh-tw.php +++ b/module/doc/lang/zh-tw.php @@ -9,6 +9,38 @@ * @version $Id: zh-tw.php 824 2010-05-02 15:32:06Z wwccss $ * @link http://www.zentao.net */ +$lang->doclib = new stdclass(); +$lang->doclib->name = '文檔庫名稱'; +$lang->doclib->control = '訪問控制'; +$lang->doclib->group = '分組'; +$lang->doclib->user = '用戶'; +$lang->doclib->files = '附件庫'; +$lang->doclib->all = '所有文檔庫'; +$lang->doclib->select = '選擇文檔庫'; +$lang->doclib->execution = $lang->executionCommon . '庫'; +$lang->doclib->product = $lang->productCommon . '庫'; + +$lang->doclib->aclListA['default'] = '預設'; +$lang->doclib->aclListA['custom'] = '自定義'; + +$lang->doclib->aclListB['open'] = '公開'; +$lang->doclib->aclListB['custom'] = '自定義'; +$lang->doclib->aclListB['private'] = '私有'; + +$lang->doclib->create['product'] = '創建' . $lang->productCommon . '文檔庫'; +$lang->doclib->create['execution'] = '創建' . $lang->executionCommon . '文檔庫'; +$lang->doclib->create['custom'] = '創建自定義文檔庫'; + +$lang->doclib->main['product'] = $lang->productCommon . '主庫'; +$lang->doclib->main['project'] = '項目主庫'; +$lang->doclib->main['execution'] = $lang->executionCommon . '主庫'; + +$lang->doclib->tabList['product'] = $lang->productCommon; +$lang->doclib->tabList['execution'] = $lang->executionCommon; +$lang->doclib->tabList['custom'] = '自定義'; + +$lang->doclib->nameList['custom'] = '自定義文檔庫名稱'; + /* 欄位列表。*/ $lang->doc->common = '文檔'; $lang->doc->id = '編號'; @@ -223,35 +255,3 @@ $lang->doc->placeholder->url = '相應的連結地址'; $lang->doc->summary = "本頁共 %s 個附件,共計 %s,其中%s。"; $lang->doc->ge = '個'; $lang->doc->point = '、'; - -$lang->doclib = new stdclass(); -$lang->doclib->name = '文檔庫名稱'; -$lang->doclib->control = '訪問控制'; -$lang->doclib->group = '分組'; -$lang->doclib->user = '用戶'; -$lang->doclib->files = '附件庫'; -$lang->doclib->all = '所有文檔庫'; -$lang->doclib->select = '選擇文檔庫'; -$lang->doclib->execution = $lang->executionCommon . '庫'; -$lang->doclib->product = $lang->productCommon . '庫'; - -$lang->doclib->aclListA['default'] = '預設'; -$lang->doclib->aclListA['custom'] = '自定義'; - -$lang->doclib->aclListB['open'] = '公開'; -$lang->doclib->aclListB['custom'] = '自定義'; -$lang->doclib->aclListB['private'] = '私有'; - -$lang->doclib->create['product'] = '創建' . $lang->productCommon . '文檔庫'; -$lang->doclib->create['execution'] = '創建' . $lang->executionCommon . '文檔庫'; -$lang->doclib->create['custom'] = '創建自定義文檔庫'; - -$lang->doclib->main['product'] = $lang->productCommon . '主庫'; -$lang->doclib->main['project'] = '項目主庫'; -$lang->doclib->main['execution'] = $lang->executionCommon . '主庫'; - -$lang->doclib->tabList['product'] = $lang->productCommon; -$lang->doclib->tabList['execution'] = $lang->executionCommon; -$lang->doclib->tabList['custom'] = '自定義'; - -$lang->doclib->nameList['custom'] = '自定義文檔庫名稱'; From 125fa381fcac7c1d31996761a413a8dd139ad1c0 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 12 Apr 2022 07:40:28 +0000 Subject: [PATCH 154/181] * Fix bug #21374. --- module/product/view/browse.html.php | 2 -- module/story/control.php | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 61b03db2a5..26c870a36a 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -143,7 +143,6 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; ?>
          - - diff --git a/module/story/control.php b/module/story/control.php index abfe4b164f..8c9bb6ad70 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -229,7 +229,9 @@ class story extends control /* Set products, users and module. */ if($objectID != 0) { - $products = $this->product->getProductPairsByProject($objectID); + global $config; + $onlyNoClosed = empty($config->CRProduct) ? 'noclosed' : ''; + $products = $this->product->getProductPairsByProject($objectID, $onlyNoClosed); $productID = empty($productID) ? key($products) : $productID; $product = $this->product->getById(($productID and array_key_exists($productID, $products)) ? $productID : key($products)); $productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID) : array(); From 3c807bf30aa6ed8719bcd5f6e58fcbb32cf688e9 Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Tue, 12 Apr 2022 15:40:40 +0800 Subject: [PATCH 155/181] add stage data --- test/data/stage.yaml | 26 ++++++++++++++++++++++++++ test/data/zentao/config.php | 1 + 2 files changed, 27 insertions(+) create mode 100644 test/data/stage.yaml diff --git a/test/data/stage.yaml b/test/data/stage.yaml new file mode 100644 index 0000000000..a5caa9bf28 --- /dev/null +++ b/test/data/stage.yaml @@ -0,0 +1,26 @@ +title: table zt_stage +desc: "" +author: automated export +version: "1.0" +fields: + - field: id + range: 1-6 + - field: name + range: 需求,设计,开发,测试,发布,总结评审 + - field: percent + range: 10{2},50,15,10,5 + - field: type + range: request,design,dev,qa,release,review + - field: createdBy + range: admin + - field: createdDate + range: "" + prefix: "2018-02-12 12:00:00" + postfix: "" + - field: editedBy + range: admin + - field: editedDate + range: "" + prefix: "2020-02-12 13:50:27" + - field: deleted + range: "0" diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index ec3f7a238f..b2bdd5ae41 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -89,6 +89,7 @@ $builder->release = array('rows' => 10, 'extends' => array('release')); $builder->design = array('rows' => 120, 'extends' => array('design')); $builder->designspec = array('rows' => 120, 'extends' => array('designspec')); +$builder->stage = array('rows' => 6, 'extends' => array('stage')); $builder->webhook = array('rows' => 7, 'extends' => array('webhook')); $builder->entry = array('rows' => 1, 'extends' => array('entry')); From 6c85c8f49c70214618d7311ae40e29ebce401562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Tue, 12 Apr 2022 15:47:01 +0800 Subject: [PATCH 156/181] *Beautify the interface. --- module/execution/view/ajaxgetdropmenu.html.php | 4 ++-- module/product/view/ajaxgetdropmenu.html.php | 4 ++-- module/project/view/ajaxgetdropmenu.html.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 4097d03729..b06368138c 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -24,7 +24,7 @@ #swapper .tree li>.list-toggle {top: -1px;} #closed {width: 90px; height: 25px; line-height: 25px; background-color: #ddd; color: #3c495c; text-align: center; margin-left: 15px; border-radius: 2px;} -#gray-line {height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} +#gray-line {width: 230px;height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} '; execution->doneExecutions;?> -
          +
          diff --git a/module/product/view/ajaxgetdropmenu.html.php b/module/product/view/ajaxgetdropmenu.html.php index 5f193d2015..722dacb0c8 100644 --- a/module/product/view/ajaxgetdropmenu.html.php +++ b/module/product/view/ajaxgetdropmenu.html.php @@ -27,7 +27,7 @@ #subHeader .tree ul {display: block;} #closed {width: 90px; height: 25px; line-height: 25px; background-color: #ddd; color: #3c495c; text-align: center; margin-left: 15px; border-radius: 2px;} -#gray-line {height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} +#gray-line {width: 230px; height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} '; product->closed?>
          -
          +
          diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index 2f9089478a..83ccf41231 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -25,7 +25,7 @@ #swapper .tree li>.list-toggle {top: -1px;} #closed {width: 90px; height: 25px; line-height: 25px; background-color: #ddd; color: #3c495c; text-align: center; margin-left: 15px; border-radius: 2px;} -#gray-line {height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} +#gray-line {width:230px; height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} Date: Tue, 12 Apr 2022 15:51:06 +0800 Subject: [PATCH 157/181] * Add unit test of stage. --- test/class/stage.class.php | 98 ++++++++++++++++++++++++++++++++ test/model/stage/batchcreate.php | 41 +++++++++++++ test/model/stage/create.php | 59 +++++++++++++++++++ test/model/stage/getbyid.php | 24 ++++++++ test/model/stage/getpairs.php | 22 +++++++ test/model/stage/getstages.php | 22 +++++++ test/model/stage/update.php | 27 +++++++++ test/ztest | 3 + 8 files changed, 296 insertions(+) create mode 100644 test/class/stage.class.php create mode 100755 test/model/stage/batchcreate.php create mode 100755 test/model/stage/create.php create mode 100755 test/model/stage/getbyid.php create mode 100755 test/model/stage/getpairs.php create mode 100755 test/model/stage/getstages.php create mode 100755 test/model/stage/update.php diff --git a/test/class/stage.class.php b/test/class/stage.class.php new file mode 100644 index 0000000000..2e15e06386 --- /dev/null +++ b/test/class/stage.class.php @@ -0,0 +1,98 @@ +objectModel = $tester->loadModel('stage'); + } + + /** + * Test create a stage. + * + * @param object $stage + * @access public + * @return object + */ + public function createTest($stage) + { + foreach($stage as $key => $value) $_POST[$key] = $value; + + $objectID = $this->objectModel->create(); + + unset($_POST); + + if(dao::isError()) return dao::getError(); + + $object = $this->objectModel->getByID($objectID); + return $object; + } + + /** + * Test batch create stages. + * + * @param array $param + * @access public + * @return int + */ + public function batchCreateTest($param) + { + foreach($param as $key => $value) $_POST[$key] = $value; + + $this->objectModel->batchCreate(); + + unset($_POST); + + if(dao::isError()) return dao::getError(); + + $objects = $this->objectModel->getStages(); + return count($objects); + } + + public function updateTest($stageID, $param) + { + foreach($param as $key => $value) $_POST[$key] = $value; + + $objects = $this->objectModel->update($stageID); + + unset($_POST); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getStagesTest($orderBy = 'id_desc') + { + $objects = $this->objectModel->getStages($orderBy = 'id_desc'); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + public function getPairsTest() + { + $objects = $this->objectModel->getPairs(); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Test get a stage by id. + * + * @param int $stageID + * @access public + * @return object + */ + public function getByIDTest($stageID) + { + $object = $this->objectModel->getByID($stageID); + + if(dao::isError()) return dao::getError(); + + return $object; + } +} diff --git a/test/model/stage/batchcreate.php b/test/model/stage/batchcreate.php new file mode 100755 index 0000000000..cfe58e2b5f --- /dev/null +++ b/test/model/stage/batchcreate.php @@ -0,0 +1,41 @@ +#!/usr/bin/env php +batchCreate(); +cid=1 +pid=1 + +*/ +$name1 = array('1' => '批量创建的需求', '2' => '批量创建的设计', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$percent1 = array('1' => '1', '2' => '2', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$type1 = array('1' => 'request', '2' => 'design', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); + +$name2 = array('1' => '批量创建的开发', '2' => '批量创建的测试', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$percent2 = array('1' => '3', '2' => '4', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$type2 = array('1' => 'dev', '2' => 'qa', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); + +$name3 = array('1' => '批量创建的发布', '2' => '批量创建的总结评审', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$percent3 = array('1' => '5', '2' => '6', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$type3 = array('1' => 'release', '2' => 'review', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); + +$name4 = array('1' => '', '2' => '批量创建的其他', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$percent4 = array('1' => '1', '2' => '7', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); +$type4 = array('1' => 'request', '2' => 'other', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => ''); + +$param1 = array('name' => $name1, 'percent' => $percent1, 'type' => $type1); +$param2 = array('name' => $name2, 'percent' => $percent2, 'type' => $type2); +$param3 = array('name' => $name3, 'percent' => $percent3, 'type' => $type3); +$param4 = array('name' => $name4, 'percent' => $percent4, 'type' => $type4); + +$stage = new stageTest(); + +r($stage->batchCreateTest($param1)) && p() && e('8'); // 测试批量创建阶段 1 +r($stage->batchCreateTest($param2)) && p() && e('10'); // 测试批量创建阶段 2 +r($stage->batchCreateTest($param3)) && p() && e('12'); // 测试批量创建阶段 3 +r($stage->batchCreateTest($param4)) && p() && e('13'); // 测试批量创建阶段 4 +system("./ztest init"); diff --git a/test/model/stage/create.php b/test/model/stage/create.php new file mode 100755 index 0000000000..f36b638153 --- /dev/null +++ b/test/model/stage/create.php @@ -0,0 +1,59 @@ +#!/usr/bin/env php +create(); +cid=1 +pid=1 + +*/ + +$stage1 = new stdclass(); +$stage1->name = '新建的需求'; +$stage1->percent = 1; +$stage1->type = 'request'; + +$stage2 = new stdclass(); +$stage2->name = '新建的设计'; +$stage2->percent = 2; +$stage2->type = 'design'; + +$stage3 = new stdclass(); +$stage3->name = '新建的开发'; +$stage3->percent = 3; +$stage3->type = 'dev'; + +$stage4 = new stdclass(); +$stage4->name = '新建的测试'; +$stage4->percent = 4; +$stage4->type = 'qa'; + +$stage5 = new stdclass(); +$stage5->name = '新建的发布'; +$stage5->percent = 5; +$stage5->type = 'release'; + +$stage6 = new stdclass(); +$stage6->name = '新建的总结评审'; +$stage6->percent = 6; +$stage6->type = 'review'; + +$stage7 = new stdclass(); +$stage7->name = '新建的其他'; +$stage7->percent = 7; +$stage7->type = 'other'; + +$stage = new stageTest(); + +r($stage->createTest($stage1)) && p('name,percent,type') && e('新建的需求,1,request'); // 测试新建一个需求阶段 +r($stage->createTest($stage2)) && p('name,percent,type') && e('新建的设计,2,design'); // 测试新建一个设计阶段 +r($stage->createTest($stage3)) && p('name,percent,type') && e('新建的开发,3,dev'); // 测试新建一个开发阶段 +r($stage->createTest($stage4)) && p('name,percent,type') && e('新建的测试,4,qa'); // 测试新建一个测试阶段 +r($stage->createTest($stage5)) && p('name,percent,type') && e('新建的发布,5,release'); // 测试新建一个发布阶段 +r($stage->createTest($stage6)) && p('name,percent,type') && e('新建的总结评审,6,review'); // 测试新建一个总结评审阶段 +r($stage->createTest($stage7)) && p('name,percent,type') && e('新建的其他,7,other'); // 测试新建一个其他阶段 +system("./ztest init"); diff --git a/test/model/stage/getbyid.php b/test/model/stage/getbyid.php new file mode 100755 index 0000000000..bf6743d703 --- /dev/null +++ b/test/model/stage/getbyid.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getByID(); +cid=1 +pid=1 + +*/ + +$stageIDList = array(1, 2, 3, 4, 5, 6); + +$stage = new stageTest(); + +r($stage->getByIDTest($stageIDList[0])) && p('name,percent,type') && e('需求,10,request'); // 测试获取阶段 1 +r($stage->getByIDTest($stageIDList[1])) && p('name,percent,type') && e('设计,10,design'); // 测试获取阶段 2 +r($stage->getByIDTest($stageIDList[2])) && p('name,percent,type') && e('开发,50,dev'); // 测试获取阶段 3 +r($stage->getByIDTest($stageIDList[3])) && p('name,percent,type') && e('测试,15,qa'); // 测试获取阶段 4 +r($stage->getByIDTest($stageIDList[4])) && p('name,percent,type') && e('发布,10,release'); // 测试获取阶段 5 +r($stage->getByIDTest($stageIDList[5])) && p('name,percent,type') && e('总结评审,5,review'); // 测试获取阶段 6 diff --git a/test/model/stage/getpairs.php b/test/model/stage/getpairs.php new file mode 100755 index 0000000000..b1c4e34e73 --- /dev/null +++ b/test/model/stage/getpairs.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +getPairs(); +cid=1 +pid=1 + +*/ + +$stage = new stageTest(); + +r($stage->getPairsTest()) && p('1') && e('需求'); // 测试获取阶段 1 +r($stage->getPairsTest()) && p('2') && e('设计'); // 测试获取阶段 2 +r($stage->getPairsTest()) && p('3') && e('开发'); // 测试获取阶段 3 +r($stage->getPairsTest()) && p('4') && e('测试'); // 测试获取阶段 4 +r($stage->getPairsTest()) && p('5') && e('发布'); // 测试获取阶段 5 +r($stage->getPairsTest()) && p('6') && e('总结评审'); // 测试获取阶段 6 diff --git a/test/model/stage/getstages.php b/test/model/stage/getstages.php new file mode 100755 index 0000000000..d58f5146f5 --- /dev/null +++ b/test/model/stage/getstages.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +getStages(); +cid=1 +pid=1 + +*/ + +$stage = new stageTest(); + +r($stage->getStagesTest()) && p('1:name,percent,type') && e('需求,10,request'); // 测试获取阶段 1 +r($stage->getStagesTest()) && p('2:name,percent,type') && e('设计,10,design'); // 测试获取阶段 2 +r($stage->getStagesTest()) && p('3:name,percent,type') && e('开发,50,dev'); // 测试获取阶段 3 +r($stage->getStagesTest()) && p('4:name,percent,type') && e('测试,15,qa'); // 测试获取阶段 4 +r($stage->getStagesTest()) && p('5:name,percent,type') && e('发布,10,release'); // 测试获取阶段 5 +r($stage->getStagesTest()) && p('6:name,percent,type') && e('总结评审,5,review'); // 测试获取阶段 6 diff --git a/test/model/stage/update.php b/test/model/stage/update.php new file mode 100755 index 0000000000..e52ea89cb5 --- /dev/null +++ b/test/model/stage/update.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +update(); +cid=1 +pid=1 + +*/ + +$stageID = 1; + +$changeName = array('name' => '修改后的需求'); +$changePercent = array('percent' => '15'); +$changeType = array('type' => 'other'); + +$stage = new stageTest(); + +r($stage->updateTest($stageID, $changeName)) && p('0:field,old,new') && e('name,需求,修改后的需求'); // 测试修改名称 +r($stage->updateTest($stageID, $changePercent)) && p('0:field,old,new') && e('percent,10,15'); // 测试修改工作量占比 +r($stage->updateTest($stageID, $changeType)) && p('0:field,old,new') && e('type,request,other'); // 测试修改阶段分类 +system("./ztest init"); + diff --git a/test/ztest b/test/ztest index a03d2f0b42..4b11c90231 100755 --- a/test/ztest +++ b/test/ztest @@ -76,6 +76,9 @@ switch($argv[1]) case 'cron': ztfRun('model/cron'); break; + case 'stage': + ztfRun('model/stage'); + break; case 'design': ztfRun('model/design'); break; From 6cdeacd9ac677f66b47880287c23681d1860ea34 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 12 Apr 2022 07:51:55 +0000 Subject: [PATCH 158/181] * Fix bug #21374. --- module/story/control.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 8c9bb6ad70..d2b43529cb 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -229,8 +229,7 @@ class story extends control /* Set products, users and module. */ if($objectID != 0) { - global $config; - $onlyNoClosed = empty($config->CRProduct) ? 'noclosed' : ''; + $onlyNoClosed = empty($this->config->CRProduct) ? 'noclosed' : ''; $products = $this->product->getProductPairsByProject($objectID, $onlyNoClosed); $productID = empty($productID) ? key($products) : $productID; $product = $this->product->getById(($productID and array_key_exists($productID, $products)) ? $productID : key($products)); From bdb910be616499de6584c5eb1747ff173f804cab Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 12 Apr 2022 15:54:15 +0800 Subject: [PATCH 159/181] * Add unit test of stage. --- test/class/stage.class.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/class/stage.class.php b/test/class/stage.class.php index 2e15e06386..55d04a9e87 100644 --- a/test/class/stage.class.php +++ b/test/class/stage.class.php @@ -49,6 +49,14 @@ class stageTest return count($objects); } + /** + * Test update a stage. + * + * @param int $stageID + * @param array $param + * @access public + * @return array + */ public function updateTest($stageID, $param) { foreach($param as $key => $value) $_POST[$key] = $value; @@ -62,6 +70,13 @@ class stageTest return $objects; } + /** + * Test get stages. + * + * @param string $orderBy + * @access public + * @return array + */ public function getStagesTest($orderBy = 'id_desc') { $objects = $this->objectModel->getStages($orderBy = 'id_desc'); @@ -71,6 +86,12 @@ class stageTest return $objects; } + /** + * Test get pairs of stage. + * + * @access public + * @return array + */ public function getPairsTest() { $objects = $this->objectModel->getPairs(); From 7e1a3564d150f0d260dbfbd2e7782ffdbcafd441 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 12 Apr 2022 17:02:48 +0800 Subject: [PATCH 160/181] * Fix bug #21614. --- module/testcase/css/showimport.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/testcase/css/showimport.css b/module/testcase/css/showimport.css index e8af63e74a..8abde8f1e0 100644 --- a/module/testcase/css/showimport.css +++ b/module/testcase/css/showimport.css @@ -5,3 +5,5 @@ .c-stage {width: 160px;} .c-step {width: 300px;} .form-actions .btn {margin-right: 20px;} +.table td textarea {height: 32px;} +sub {vertical-align: baseline !important;} From 92e13b052a2f6d1e35b60cd9aa3b0941f1e62ca2 Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Tue, 12 Apr 2022 17:07:03 +0800 Subject: [PATCH 161/181] add module data --- test/data/module.yaml | 13 +++--- test/data/storymodule.yaml | 12 ++++-- test/data/storymoduleson.yaml | 78 +++++++++++++++++++++++++++++++++++ test/data/taskmodule.yaml | 13 +++--- test/data/taskmoduleson.yaml | 78 +++++++++++++++++++++++++++++++++++ test/data/zentao/config.php | 44 ++++++++++---------- 6 files changed, 203 insertions(+), 35 deletions(-) create mode 100644 test/data/storymoduleson.yaml create mode 100644 test/data/taskmoduleson.yaml diff --git a/test/data/module.yaml b/test/data/module.yaml index d5db97e006..6dbb21392f 100644 --- a/test/data/module.yaml +++ b/test/data/module.yaml @@ -40,11 +40,14 @@ fields: format: "" - field: path note: "ID路径" - range: 1-10000 - prefix: "," - postfix: "," - loop: 0 - format: "" + fields: + - field: path1 + range: 1-1000 + prefix: "," + postfix: "," + - field: path2 + range: [] + postfix: "" - field: grade note: "等级" range: 1 diff --git a/test/data/storymodule.yaml b/test/data/storymodule.yaml index b2be3f4949..6b4f5c9b66 100644 --- a/test/data/storymodule.yaml +++ b/test/data/storymodule.yaml @@ -40,10 +40,14 @@ fields: format: "" - field: path note: "ID路径" - range: 1821-10000 - prefix: "," - postfix: "," - loop: 0 + fields: + - field: path1 + range: 1821-2620 + prefix: "," + postfix: "," + - field: path2 + range: [] + postfix: "" format: "" - field: grade note: "等级" diff --git a/test/data/storymoduleson.yaml b/test/data/storymoduleson.yaml new file mode 100644 index 0000000000..a17c8fb846 --- /dev/null +++ b/test/data/storymoduleson.yaml @@ -0,0 +1,78 @@ +title: table zt_module +desc: "模块" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 2621-10000 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: root + note: "根目录" + range: 1-100{2} + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: branch + note: "分支" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: name + note: "模块名称" + range: 1-10000 + prefix: "产品子模块" + postfix: "" + loop: 0 + format: "" + - field: parent + note: "父ID" + range: 1821-2620:4{2} + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: path + note: "ID路径" + fields: + - field: path1 + range: 1821-2620:4{2} + prefix: "," + postfix: "," + - field: path2 + range: 2621-10000 + postfix: "," + - field: grade + note: "等级" + range: 2 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: order + note: "排序" + range: 10-100:10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: type + note: "对象类型" + range: story + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: deleted + note: "是否删除" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/taskmodule.yaml b/test/data/taskmodule.yaml index 041b3313f8..10f8f183a2 100644 --- a/test/data/taskmodule.yaml +++ b/test/data/taskmodule.yaml @@ -40,11 +40,14 @@ fields: format: "" - field: path note: "ID路径" - range: 21-10000 - prefix: "," - postfix: "," - loop: 0 - format: "" + fields: + - field: path1 + range: 21-1820 + prefix: "," + postfix: "," + - field: path2 + range: [] + postfix: "" - field: grade note: "等级" range: 1 diff --git a/test/data/taskmoduleson.yaml b/test/data/taskmoduleson.yaml new file mode 100644 index 0000000000..da3d4b7d20 --- /dev/null +++ b/test/data/taskmoduleson.yaml @@ -0,0 +1,78 @@ +title: table zt_module +desc: "模块" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 3021-3620 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: root + note: "根目录" + range: 101-700{1} + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: branch + note: "分支" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: name + note: "模块名称" + range: 1-10000 + prefix: "执行子模块" + postfix: "" + loop: 0 + format: "" + - field: parent + note: "父ID" + range: 21-1820:2 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: path + note: "ID路径" + fields: + - field: path1 + range: 21-1820:2 + prefix: "," + postfix: "," + - field: path2 + range: 3021-3620 + postfix: "" + - field: grade + note: "等级" + range: 2 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: order + note: "排序" + range: 10-100:10 + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: type + note: "对象类型" + range: task + prefix: "" + postfix: "" + loop: 0 + format: "" + - field: deleted + note: "是否删除" + range: 0 + prefix: "" + postfix: "" + loop: 0 + format: "" diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index b2bdd5ae41..584924ae97 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -18,27 +18,29 @@ $builder->project = array('rows' => 90, 'extends' => array('project', 'proj $builder->projectalone = array('rows' => 20, 'extends' => array('project', 'projectalone')); $builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution')); -$builder->story = array('rows' => 400, 'extends' => array('story')); -$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory')); -$builder->storyreview = array('rows' => 100, 'extends' => array('storyreview')); -$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule')); -$builder->storyplan = array('rows' => 400, 'extends' => array('planstory')); -$builder->storystage = array('rows' => 450, 'extends' => array('storystage')); -$builder->storyspec = array('rows' => 570, 'extends' => array('storyspec')); -$builder->storyestimate = array('rows' => 6, 'extends' => array('storyestimate')); -$builder->relation = array('rows' => 12, 'extends' => array('relation')); -$builder->task = array('rows' => 600, 'extends' => array('task','task')); -$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask')); -$builder->taskspec = array('rows' => 600, 'extends' => array('taskspec')); -$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule')); -$builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate')); -$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson')); -$builder->case = array('rows' => 400, 'extends' => array('case')); -$builder->libcase = array('rows' => 10, 'extends' => array('case','libcase')); -$builder->unitcase = array('rows' => 150, 'extends' => array('case','unitcase')); -$builder->casestep = array('rows' => 400, 'extends' => array('casestep')); -$builder->bug = array('rows' => 300, 'extends' => array('bug')); -$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug')); +$builder->story = array('rows' => 400, 'extends' => array('story')); +$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory')); +$builder->storyreview = array('rows' => 100, 'extends' => array('storyreview')); +$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule')); +$builder->storymoduleson = array('rows' => 400, 'extends' => array('module','storymoduleson')); +$builder->storyplan = array('rows' => 400, 'extends' => array('planstory')); +$builder->storystage = array('rows' => 450, 'extends' => array('storystage')); +$builder->storyspec = array('rows' => 570, 'extends' => array('storyspec')); +$builder->storyestimate = array('rows' => 6, 'extends' => array('storyestimate')); +$builder->relation = array('rows' => 12, 'extends' => array('relation')); +$builder->task = array('rows' => 600, 'extends' => array('task','task')); +$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask')); +$builder->taskspec = array('rows' => 600, 'extends' => array('taskspec')); +$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule')); +$builder->taskmoduleson = array('rows' => 600, 'extends' => array('module','taskmoduleson')); +$builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate')); +$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson')); +$builder->case = array('rows' => 400, 'extends' => array('case')); +$builder->libcase = array('rows' => 10, 'extends' => array('case','libcase')); +$builder->unitcase = array('rows' => 150, 'extends' => array('case','unitcase')); +$builder->casestep = array('rows' => 400, 'extends' => array('casestep')); +$builder->bug = array('rows' => 300, 'extends' => array('bug')); +$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug')); $builder->testtask = array('rows' => 100, 'extends' => array('testtask')); $builder->testresult = array('rows' => 70, 'extends' => array('testresult')); From 41b48ac200169b3ee3fb9f35029a8866af579bc1 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 13 Apr 2022 09:13:50 +0800 Subject: [PATCH 162/181] * Fix bug of create test case. --- module/testcase/model.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index a39c3980dd..003e8cc7dd 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1819,6 +1819,7 @@ class testcaseModel extends model */ public function syncCase2Project($case, $caseID) { + $projects = array(); if(!empty($case->story)) { $projects = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($case->story)->fetchPairs(); @@ -1831,27 +1832,25 @@ class testcaseModel extends model { $projects = array($this->session->execution); } + if(empty($projects)) return; $this->loadModel('action'); $objectInfo = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projects)->fetchAll('id'); - if(!empty($projects)) + foreach($projects as $projectID) { - foreach($projects as $projectID) - { - $lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTCASE)->where('project')->eq($projectID)->orderBy('order_desc')->limit(1)->fetch('order'); - $data = new stdclass(); - $data->project = $projectID; - $data->product = $case->product; - $data->case = $caseID; - $data->version = 1; - $data->order = ++ $lastOrder; - $this->dao->insert(TABLE_PROJECTCASE)->data($data)->exec(); + $lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTCASE)->where('project')->eq($projectID)->orderBy('order_desc')->limit(1)->fetch('order'); + $data = new stdclass(); + $data->project = $projectID; + $data->product = $case->product; + $data->case = $caseID; + $data->version = 1; + $data->order = ++ $lastOrder; + $this->dao->insert(TABLE_PROJECTCASE)->data($data)->exec(); - $objectType = $objectInfo[$projectID]->type; - if($objectType == 'project') $this->action->create('case', $caseID, 'linked2project', '', $projectID); - if(in_array($objectType, array('sprint', 'stage'))) $this->action->create('case', $caseID, 'linked2execution', '', $projectID); - } + $objectType = $objectInfo[$projectID]->type; + if($objectType == 'project') $this->action->create('case', $caseID, 'linked2project', '', $projectID); + if(in_array($objectType, array('sprint', 'stage'))) $this->action->create('case', $caseID, 'linked2execution', '', $projectID); } } From f6cf76e520c9a0a82000181b6766ec371c3840b9 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 13 Apr 2022 09:18:15 +0800 Subject: [PATCH 163/181] * Fix bug #19261. --- module/bug/view/resolve.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index 1217f16097..35d128ceae 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -45,7 +45,7 @@ js::set('productID' , $bug->product);
          type == 'kanban') ? $lang->bug->kanban : $lang->build->execution;?> - + execution, "class='form-control chosen'");?>
          From 6676b9a7c26adef535be13b6fa8aca815255cb01 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Wed, 13 Apr 2022 09:44:51 +0800 Subject: [PATCH 164/181] * Fix api for bug to story. --- api/v1/entries/stories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/entries/stories.php b/api/v1/entries/stories.php index 558f95a7cd..c5f3bf82dd 100644 --- a/api/v1/entries/stories.php +++ b/api/v1/entries/stories.php @@ -66,7 +66,7 @@ class storiesEntry extends entry $control = $this->loadController('story', 'create'); $this->requireFields('title,spec,pri,category'); - $control->create($productID, $this->param('branch', 0), $this->param('moduleID', 0), $this->param('storyID', 0), $this->param('objectID', 0)); + $control->create($productID, $this->param('branch', 0), $this->param('moduleID', 0), $this->param('storyID', 0), $this->param('objectID', 0), $this->param('bugID', 0)); $data = $this->getData(); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); From 1ef7a9f6b0e3c30eabb3798837f29f97a964eb78 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 13 Apr 2022 09:45:05 +0800 Subject: [PATCH 165/181] * Fix bug #16607. --- module/testcase/view/caseheader.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index 0908a5a1ad..6927be6b07 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -45,7 +45,7 @@ if(isset($menuItem->hidden)) continue; $menuType = $menuItem->name; if(!$config->testcase->needReview and empty($config->testcase->forceReview) and $menuType == 'wait') continue; - if($hasBrowsePriv and $menuType == 'QUERY') + if($hasBrowsePriv and $menuType == 'QUERY' and in_array($browseType, array('all', 'needconfirm', 'bysuite'))) { $searchBrowseLink = $this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=bySearch¶m=%s"); $isBySearch = $browseType == 'bysearch'; From ad1c5c34e889445ac72c210ca5303198ef83ca9c Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Wed, 13 Apr 2022 09:47:30 +0800 Subject: [PATCH 166/181] update module data --- test/data/storymodule.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/data/storymodule.yaml b/test/data/storymodule.yaml index 6b4f5c9b66..8a285289d5 100644 --- a/test/data/storymodule.yaml +++ b/test/data/storymodule.yaml @@ -19,7 +19,7 @@ fields: format: "" - field: branch note: "分支" - range: 0 + range: 0{161},1,2,0{2},3,4,0{10000} prefix: "" postfix: "" loop: 0 From 2e5b43979e5b418c97c807186b122cf7b541fa8b Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 13 Apr 2022 09:51:40 +0800 Subject: [PATCH 167/181] * Fix bug #21641. --- module/group/model.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/module/group/model.php b/module/group/model.php index f406b59b9c..3c884c4086 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -396,23 +396,6 @@ class groupModel extends model } $actions['actions'] = $dynamic; - /* Update whitelist. */ - $this->loadModel('personnel'); - $users = $this->getUserPairs($groupID); - $users = array_keys($users); - $objectTypes = array_reverse($this->config->group->acl->objectTypes); //Adjust the order of object types, because execution is subordinate to the whitelist of projects, as well as products to programs. - - foreach($objectTypes as $key => $objectType) - { - $oldAcls = isset($oldGroup->acl[$key]) ? $oldGroup->acl[$key] : array(); - $newAcls = isset($actions[$key]) ? $actions[$key] : array(); - $needRemoveAcls = array_diff($oldAcls, $newAcls); - $needAddAcls = array_diff($newAcls, $oldAcls); - foreach($needAddAcls as $objectID) $this->personnel->updateWhitelist($users, $objectType, $objectID, 'whitelist', 'sync', 'increase'); - foreach($needRemoveAcls as $objectID) $this->personnel->deleteWhitelist($users, $objectType, $objectID, $groupID); - } - - $actions = empty($actions) ? '' : json_encode($actions); $this->dao->update(TABLE_GROUP)->set('acl')->eq($actions)->where('id')->eq($groupID)->exec(); return dao::isError() ? false : true; @@ -473,19 +456,6 @@ class groupModel extends model $acl = $this->dao->select('acl')->from(TABLE_GROUP)->where('id')->eq($groupID)->fetch('acl'); $acl = json_decode($acl); - $this->loadModel('personnel'); - $objectTypes = array_reverse($this->config->group->acl->objectTypes); //Adjust the order of object types, because execution is subordinate to the whitelist of projects, as well as products to programs. - - foreach($objectTypes as $key => $objectType) - { - if(!isset($acl->{$key})) continue; - foreach($acl->{$key} as $objectID) - { - $this->personnel->updateWhitelist($newUsers, $objectType, $objectID, 'whitelist', 'sync', 'increase'); - $this->personnel->deleteWhitelist($delUsers, $objectType, $objectID, $groupID); - } - } - /* Adjust user view. */ $changedUsers = array_merge($newUsers, $delUsers); if(!empty($changedUsers)) From df57c956364f233c6f92ed40dcc0f4bfb5208a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=8D=8E=E4=BC=9F?= Date: Wed, 13 Apr 2022 09:59:37 +0800 Subject: [PATCH 168/181] *Fix bug#21668 --- module/product/view/browse.html.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 26c870a36a..18677b8f34 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -536,10 +536,9 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; foreach($plans as $planID => $plan) { $position = stripos($plan, '/'); - $planLabel = $position === false ? $plan : ('' . substr($plan, 0, $position) . '' . substr($plan, $position + 1)); $searchKey = $withSearch ? ('data-key="' . zget($plansPinYin, $plan, '') . '"') : ''; $actionLink = $this->createLink('story', 'batchChangePlan', "planID=$planID"); - echo html::a('#', $planLabel, '', "$searchKey title='{$plan}' onclick=\"setFormAction('$actionLink', 'hiddenwin', '#productStoryForm')\" onmouseover=\"setBadgeStyle(this, true);\" onmouseout=\"setBadgeStyle(this, false)\""); + echo html::a('#', $plan, '', "$searchKey title='{$plan}' onclick=\"setFormAction('$actionLink', 'hiddenwin', '#productStoryForm')\" onmouseover=\"setBadgeStyle(this, true);\" onmouseout=\"setBadgeStyle(this, false)\""); } ?>
          From a9809c35aab70b089b323317c1a97b4a2920cbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 13 Apr 2022 10:01:36 +0800 Subject: [PATCH 169/181] * code for bug #20823. --- module/block/control.php | 17 +++++++++++------ module/block/model.php | 8 +++++++- module/story/model.php | 9 +++++---- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index 849daf1d1d..5b7c6c93f0 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1731,12 +1731,17 @@ class block extends control $table = $this->config->objectTables[$objectType]; $orderBy = $objectType == 'todo' ? "`date` desc" : 'id_desc'; $limitCount = isset($params->{$objectCount}) ? $params->{$objectCount} : 0; - $objects = $this->dao->select('*')->from($table) - ->where('deleted')->eq(0) - ->andWhere('assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($objectType == 'story')->andWhere('type')->eq('story')->fi() - ->beginIF($objectType == 'todo')->andWhere('cycle')->eq(0)->andWhere('status')->eq('wait')->andWhere('vision')->eq($this->config->vision)->fi() - ->beginIF($objectType != 'todo')->andWhere('status')->ne('closed')->fi() + $objects = $this->dao->select('t1.*')->from($table)->alias('t1') + ->beginIF($objectType == 'story')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi() + ->beginIF($objectType == 'bug')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi() + ->beginIF($objectType == 'task')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')->fi() + ->where('t1.deleted')->eq(0) + ->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() + ->beginIF($objectType == 'story')->andWhere('t1.type')->eq('story')->andWhere('t2.deleted')->eq('0')->fi() + ->beginIF($objectType == 'bug')->andWhere('t2.deleted')->eq('0')->fi() + ->beginIF($objectType == 'story')->andWhere('t2.deleted')->eq('0')->fi() + ->beginIF($objectType == 'todo')->andWhere('t1.cycle')->eq(0)->andWhere('t1.status')->eq('wait')->andWhere('t1.vision')->eq($this->config->vision)->fi() + ->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi() ->orderBy($orderBy) ->beginIF($limitCount)->limit($limitCount)->fi() ->fetchAll(); diff --git a/module/block/model.php b/module/block/model.php index 5b28ed6771..25b7e2fc0b 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -186,7 +186,13 @@ class blockModel extends model ->where('assignedTo')->eq($this->app->user->account) ->andWhere('deleted')->eq(0) ->fetch('count'); - $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('type')->eq('story')->fetch('count'); + $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') + ->where('t1.assignedTo')->eq($this->app->user->account) + ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->andWhere('t1.type')->eq('story') + ->fetch('count'); $data['executions'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_EXECUTION) ->where('status')->notIN('done,closed') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() diff --git a/module/story/model.php b/module/story/model.php index 7654e4951f..e4245ea04c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3007,15 +3007,16 @@ class storyModel extends model if($type == 'reviewBy') $sql = $sql->leftJoin(TABLE_STORYREVIEW)->alias('t3')->on('t1.id = t3.story and t1.version = t3.version'); $stories = $sql->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq('0') ->andWhere('t1.type')->eq($storyType) ->andWhere('t1.vision')->eq($this->config->vision) ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($type != 'all') - ->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi() + ->beginIF($type == 'assignedTo')->andWhere('t1.assignedTo')->eq($account)->fi() ->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->andWhere('t1.status')->in('draft,changed')->fi() - ->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi() - ->beginIF($type == 'reviewedBy')->andWhere("CONCAT(',', reviewedBy, ',')")->like("%,$account,%")->fi() - ->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi() + ->beginIF($type == 'openedBy')->andWhere('t1.openedBy')->eq($account)->fi() + ->beginIF($type == 'reviewedBy')->andWhere("CONCAT(',', t1.reviewedBy, ',')")->like("%,$account,%")->fi() + ->beginIF($type == 'closedBy')->andWhere('t1.closedBy')->eq($account)->fi() ->fi() ->beginIF($includeLibStories == false and $this->config->edition == 'max')->andWhere('t1.lib')->eq('0')->fi() ->orderBy($orderBy) From 7ac526401d215d8d25f3c67c23ba528c66bfa78c Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Wed, 13 Apr 2022 10:08:53 +0800 Subject: [PATCH 170/181] * Fix bug #21700. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 2e8f10396e..ec91506d17 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1624,7 +1624,7 @@ class taskModel extends model $consumed += $estimate->consumed; $work = $estimate->work; $estimateID = $this->dao->lastInsertID(); - $actionID = $this->action->create('task', $taskID, 'RecordEstimate', $work, $estimate->consumed); + $actionID = $this->action->create('task', $taskID, 'RecordEstimate', $work, (float)$estimate->consumed); if(empty($lastDate) or $lastDate <= $estimate->date) { From 486295dcc185a7d470d2768a457462c6d918ba07 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Wed, 13 Apr 2022 10:28:29 +0800 Subject: [PATCH 171/181] * fix bug *20169 --- db/standard/zentao16.5.sql | 28 ++++++++++++++++++++++++ db/zentao.sql | 44 +++++++++++++++++++------------------- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/db/standard/zentao16.5.sql b/db/standard/zentao16.5.sql index d66bdf31e5..d73a5634f0 100644 --- a/db/standard/zentao16.5.sql +++ b/db/standard/zentao16.5.sql @@ -3797,3 +3797,31 @@ SET character_set_client = @saved_cs_client; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; + +REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES +('product-invest', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u6295\\u5165\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u6295\\u5165\\u8868\",\"en\":\"Product Investment\"}', ',product', 'select t1.id,t1.name,1 as projects, round(t3.consumed,2) as consumed from TABLE_PRODUCT as t1\r\n left join TABLE_PROJECTPRODUCT as t2 on t1.id=t2.product\r\n left join ztv_projectsummary as t3 on t2.project=t3.project\r\n left join TABLE_PROJECT as t4 on t2.project=t4.id\r\n left join TABLE_PROGRAM as t5 on t1.program=t5.id\r\n where t1.deleted=\'0\' and t4.deleted=\'0\' and t4.type=\'project\'\r\norder by t5.`order` asc, t1.line desc, t1.`order` asc', '', '{\"projects\":{\"zh-cn\":\"\\u9879\\u76ee\\u6570\",\"zh-tw\":\"\\u9879\\u76ee\\u6570\",\"en\":\"Projects\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"projects\",\"consumed\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"projects\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u6bcf\\u4e2a\\u4ea7\\u54c1\\u7684\\u9879\\u76ee\\u603b\\u6570\\uff0c\\u5df2\\u7ecf\\u6d88\\u8017\\u7684\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u6bcf\\u500b\\u7522\\u54c1\\u7684\\u9805\\u76ee\\u7e3d\\u6578\\uff0c\\u5df2\\u7d93\\u6d88\\u8017\\u7684\\u5de5\\u6642\\u3002\",\"en\":\"Number of projects and consumed hours.\"}', 'admin', '2015-07-20 14:21:31'), +('product-progress', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u5b8c\\u6210\\u5ea6\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u5b8c\\u6210\\u5ea6\\u7d71\\u8a08\\u8868\",\"en\":\"Product Progress\"}', ',product', 'select t1.*,t2.name, (case when t1.status = \'closed\' or t1.stage = \'released\' then 1 else 0 end) as done, 1 as count from TABLE_STORY as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"count\",\"done\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"count\",\"done\"],\"percent\":{\"1\":\"1\"},\"contrast\":{\"1\":\"count\"},\"showAlone\":{\"1\":\"1\"}}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u603b\\u6570(\\u72b6\\u6001\\u662f\\u5173\\u95ed\\uff0c\\u6216\\u8005\\u7814\\u53d1\\u9636\\u6bb5\\u662f\\u53d1\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u7e3d\\u6578(\\u72c0\\u614b\\u662f\\u95dc\\u9589\\uff0c\\u6216\\u8005\\u7814\\u767c\\u968e\\u6bb5\\u662f\\u767c\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"en\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\"}', 'admin', '2015-07-21 15:07:48'), +('story-status', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Story Status\"}', ',product', 'select t1.*,t2.name from TABLE_STORY as t1\r\n left join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u72b6\\u6001\\u7684\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u72c0\\u614b\\u7684\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Total number and status distribution of stories.\"}', 'admin', '2015-07-21 15:35:38'), +('story-stage', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Story Stage\"}', ',product', 'select t1.*,t2.name from TABLE_STORY as t1\r\n left join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u7814\\u53d1\\u9636\\u6bb5\\u7684\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u7814\\u767c\\u968e\\u6bb5\\u7684\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Total number and stage distribution of stories \"}', 'admin', '2015-07-21 15:38:34'), +('product-release', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u53d1\\u5e03\\u6570\\u91cf\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u767c\\u5e03\\u6578\\u91cf\\u7d71\\u8a08\\u8868\",\"en\":\"Product Release\"}', ',product', 'select t2.name, 1 as releases from TABLE_RELEASE as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"releases\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"releases\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u53d1\\u5e03\\u7684\\u6570\\u91cf\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u767c\\u5e03\\u7684\\u6578\\u91cf\\u3002\",\"en\":\"List the number of releases by product.\"}', 'admin', '2015-07-21 16:00:52'), +('task-status', '{\"zh-cn\":\"\\u4efb\\u52a1\\u72b6\\u6001\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u72c0\\u614b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Status Report\"}', ',project', 'select t1.id,t3.name as project,t1.name,t2.status,t1.name as execution,t2.id as taskID, t1.status as projectstatus, (case when t2.deadline < CURDATE() and t2.deadline != \'0000-00-00\' and t2.status != \'closed\' and t2.status != \'done\' and t2.status != \'cancel\' then 1 else 0 end) as timeout from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u6267\\u884c\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u57f7\\u884c\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Based on the status distribution of statistical tasks.\"}', 'admin', '2015-07-22 11:28:33'), +('task-type', '{\"zh-cn\":\"\\u4efb\\u52a1\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Type Report\"}', ',project', 'select t1.id,t3.name as project,t1.name as execution,t2.type,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the type of statistical task distribution.\"}', 'admin', '2015-07-22 13:06:46'), +('task-assign', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u6307\\u6d3e\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u6307\\u6d3e\\u7d71\\u8a08\\u8868\",\"en\":\"Task Assign Report\"}', ',project', 'select t1.id,t4.name as project,t1.name as execution,if(t3.account is not null, t3.account,t2.assignedTo) as assignedTo,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_TEAM as t3 on t3.type=\'task\' && t3.root=t2.id \r\nleft join TABLE_PROJECT as t4 on t1.project=t4.id\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t4.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"assignedTo\":{\"zh-cn\":\"\\u6307\\u6d3e\\u7ed9\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics task assigned to the distribution.\"}', 'admin', '2015-07-22 13:13:28'), +('task-finish', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u5b8c\\u6210\\u8005\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u5b8c\\u6210\\u8005\\u7d71\\u8a08\\u8868\",\"en\":\"Task Finish Report\"}', ',project', 'select t1.id,t3.name as project,t1.name as execution,t2.finishedBy,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t1.project=t3.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and t2.finishedBy!=\'\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"finishedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics task completion distribution.\"}', 'admin', '2015-07-22 13:16:21'), +('project-invest', '{\"zh-cn\":\"\\u9879\\u76ee\\u6295\\u5165\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u6295\\u5165\\u7d71\\u8a08\\u8868\",\"en\":\"Project Invest Report\"}', ',project', 'select t1.id,t5.name as project,t1.name as execution,CONCAT(t1.begin,\' ~ \',t1.end) as timeLimit,t2.teams,t3.stories,round(t4.consumed,1) as consumed,t4.number, t1.status as projectstatus \r\nfrom TABLE_EXECUTION as t1\r\n left join ztv_projectteams as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\n left join ztv_executionsummary as t4 on t1.id=t4.execution \r\nleft join TABLE_PROJECT as t5 on t1.project=t5.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t5.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"timeLimit\":{\"zh-cn\":\"\\u5de5\\u671f\"},\"teams\":{\"zh-cn\":\"\\u4eba\\u6570\"},\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\"},\"consumed\":{\"zh-cn\":\"\\u603b\\u6d88\\u8017\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"number\",\"stories\",\"teams\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"number\",\"stories\",\"teams\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52a1\\u6570\\uff0c\\u9700\\u6c42\\u6570\\uff0c\\u4eba\\u6570\\uff0c\\u603b\\u6d88\\u8017\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52d9\\u6578\\uff0c\\u9700\\u6c42\\u6578\\uff0c\\u4eba\\u6578\\uff0c\\u7e3d\\u6d88\\u8017\\u5de5\\u6642\\u3002\",\"en\":\"Listed by project: number of tasks, number of demands, number of people, total hours consumed.\"}', 'admin', '2015-07-22 16:37:38'), +('projectstory-status', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Story Status\"}', ',project', 'select t2.id, t4.name as project,t2.name as execution,t3.status from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics requirement status distribution.\"}', 'admin', '2015-07-23 15:35:08'), +('project-stage', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Project Stage Report\"}', ',project', 'select t2.id, t4.name as project,t2.name as execution,t3.stage from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics demand stage distribution.\"}', 'admin', '2015-07-23 15:38:18'), +('projectbug-resolution', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolution\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.resolution from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t2.deleted=\'0\' and t2.resolution!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Solution distribution of statistical bugs by project.\"}', 'admin', '2015-07-23 16:04:46'), +('projectbug-status', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Status\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.status from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\' \' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Statistics Bug status distribution by project.\"}', 'admin', '2015-07-23 15:48:03'), +('projectbug-opened', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Opened\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.openedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"openedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Bug creator distribution by project.\"}', 'admin', '2015-07-23 16:08:10'), +('projectbug-resolve', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolve\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.resolvedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and t2.status!=\'active\' and t2.resolvedBy!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolvedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Bug solver distribution by project.\"}', 'admin', '2015-07-23 16:13:16'), +('projectbug-assign', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Assign\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.assignedTo from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution \r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics Bug assigned to the distribution.\"}', 'admin', '2015-07-23 16:29:10'), +('project-quality', '{\"zh-cn\":\"\\u9879\\u76ee\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u8cea\\u91cf\\u8868\",\"en\":\"Project Quality Report\"}', ',project', 'select t1.id, t5.name as project,t5.id,t1.name as execution,t2.stories,(t2.stories-t2.undone) as doneStory,t3.number,(t3.number-t3.undone) as doneTask,t4.bugs,t4.resolutions, round(t4.bugs/(t2.stories-t2.undone),2) as bugthanstory,round(t4.bugs/(t3.number-t3.undone),2) as bugthantask,t4.seriousBugs from TABLE_EXECUTION as t1 \r\nleft join ztv_projectstories as t2 on t1.id=t2.execution\r\nleft join ztv_executionsummary as t3 on t1.id=t3.execution\r\nleft join ztv_projectbugs as t4 on t1.id=t4.execution\r\nleft join TABLE_PROJECT as t5 on t5.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t1.grade=\'1\' and if($project=\'\',1,t5.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u603b\\u6570\"},\"doneTask\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\"},\"bugthantask\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u4efb\\u52a1\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdBug\\u6bd4\\u7387\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52a1\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3\\uff09\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52d9\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3\\uff09\\u3002\",\"en\":\"List total requirements, completed requirements, total tasks, completed tasks, bugs, solved bugs, bugs\\/requirements, bugs\\/tasks, critical bugs (severity not greater than 3) for the project.\"}', 'admin', '2015-07-23 17:03:10'), +('productbug-type', '{\"zh-cn\":\"\\u4ea7\\u54c1Bug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1Bug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Bug Type of Product\"}', ',product,test', 'select t1.id,t1.name,t2.id as bugID,t2.type from TABLE_PRODUCT as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.product \r\nleft join TABLE_PROGRAM as t3 on t1.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t1.line desc, t1.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"The distribution of Bug types by product statistics.\"}', 'admin', '2015-07-24 13:48:22'), +('product-quality', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u8cea\\u91cf\\u8868\",\"en\":\"Product Quality\"}', ',product', 'select t1.id,t1.name,t2.stories,(t2.stories-t2.undone) as doneStory,t3.bugs,t3.resolutions,round(t3.bugs/(t2.stories-t2.undone),2) as bugthanstory,t3.seriousBugs from TABLE_PRODUCT as t1 \r\nleft join ztv_productstories as t2 on t1.id=t2.product \r\nleft join ztv_productbugs as t3 on t1.id=t3.product \r\nleft join TABLE_PROGRAM as t4 on t1.program=t4.id \r\nwhere t1.deleted=\'0\'\r\norder by t4.`order` asc, t1.line desc, t1.`order` asc', '', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u603b\\u6570\",\"en\":\"Stories\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"en\":\"Finished Stories\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\",\"zh-tw\":\"Bug\\u6570\",\"en\":\"Bugs\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6570\",\"en\":\"Solved Bugs\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"zh-tw\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"en\":\"Bug\\/Finished Story\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\",\"zh-tw\":\"\\u91cd\\u8981Bug\\u6570\",\"en\":\"Serious Bugs\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"zh-tw\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"en\":\"Serious Bugs %\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"bugs\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u4ea7\\u54c1\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u603b\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3)\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u7522\\u54c1\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3)\\u3002\",\"en\":\"List requirements for the product, total requirements completed, number of bugs, number of bugs solved, bugs\\/requirements, number of significant bugs (severity not greater than 3).\"}', 'admin', '2015-07-23 17:17:40'), +('user-login', '{\"zh-cn\":\"\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u8868\",\"en\":\"Login Times\"}', ',staff', 'select actor,LEFT(`date`,10) as `day` from TABLE_ACTION where `action`=\'login\' and if($startDate=\'\',1,`date`>=$startDate) and if($endDate=\'\',1,`date`<=$endDate) order by `date` asc, actor asc', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"actor\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"day\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u5b9e\\u73b0\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u62a5\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7edf\\u8ba1\\u6bcf\\u5929\\u6bcf\\u4e2a\\u4eba\\u7684\\u767b\\u5f55\\u6b21\\u6570\\uff0c\\u4ee5\\u53ca\\u603b\\u6570\\u3002\",\"zh-tw\":\"\\u5be6\\u73fe\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u5831\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7d71\\u8a08\\u6bcf\\u5929\\u6bcf\\u500b\\u4eba\\u7684\\u767b\\u9304\\u6b21\\u6578\\uff0c\\u4ee5\\u53ca\\u7e3d\\u6578\\u3002\",\"en\":\"Realize the employee login times statistics report, counting the login times of each person and the total number by day.\"}', 'admin', '2015-07-24 14:28:11'), +('effort', '{\"zh-cn\":\"\\u65e5\\u5fd7\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u65e5\\u8a8c\\u532f\\u7e3d\\u8868\",\"en\":\"Effort Summary\"}', ',staff', 'select t1.account,t1.consumed,t1.`date`,if($dept=\'0\',0,t2.dept) as dept from TABLE_EFFORT as t1 left join TABLE_USER as t2 on t1.account=t2.account where t1.`deleted`=\'0\' and if($startDate=\'\',1,t1.`date`>=$startDate) and if($endDate=\'\',1,t1.`date`<=$endDate) having dept=$dept order by `date` asc', '{\"varName\":[\"dept\",\"startDate\",\"endDate\"],\"showName\":[\"\\u90e8\\u95e8\",\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"dept\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"date\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"consumed\":{\"zh-cn\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost\"}}', '{\"group1\":\"account\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"date\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"consumed\"]}', 2, '{\"zh-cn\":\"\\u67e5\\u770b\\u67d0\\u4e2a\\u65f6\\u95f4\\u6bb5\\u5185\\u7684\\u65e5\\u5fd7\\u60c5\\u51b5\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u95e8\\u9009\\u62e9\\u3002\",\"zh-tw\":\"\\u67e5\\u770b\\u67d0\\u500b\\u6642\\u9593\\u6bb5\\u5167\\u7684\\u65e5\\u8a8c\\u60c5\\u6cc1\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u9580\\u9078\\u64c7\\u3002\",\"en\":\"You can view the logs of a certain period by department.\"}', 'admin', '2015-07-27 13:53:32'), +('company-dynamic', '{\"zh-cn\":\"\\u516c\\u53f8\\u52a8\\u6001\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u516c\\u53f8\\u52d5\\u614b\\u532f\\u7e3d\\u8868\",\"en\":\"Company Dynamics\"}', ',staff', 'select t1.day,t2.userlogin,t3.consumed,t4.storyopen,t5.storyclose,t6.taskopen,t7.taskfinish,t8.bugopen,t9.bugresolve,t1.actions from ztv_dayactions as t1 left join ztv_dayuserlogin as t2 on t1.day=t2.day left join ztv_dayeffort as t3 on t1.day=t3.date left join ztv_daystoryopen as t4 on t1.day=t4.day left join ztv_daystoryclose as t5 on t1.day=t5.day left join ztv_daytaskopen as t6 on t1.day=t6.day left join ztv_daytaskfinish as t7 on t1.day=t7.day left join ztv_daybugopen as t8 on t1.day=t8.day left join ztv_daybugresolve as t9 on t1.day=t9.day where if($startDate=\'\',1,t1.day>=$startDate) and if($endDate=\'\',1,t1.day<=$endDate)', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"day\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"userlogin\":{\"zh-cn\":\"\\u767b\\u5f55\\u6b21\\u6570\",\"zh-tw\":\"\\u767b\\u9304\\u6b21\\u6578\",\"en\":\"Login\"},\"consumed\":{\"zh-cn\":\"\\u65e5\\u5fd7\\u5de5\\u65f6\",\"zh-tw\":\"\\u65e5\\u8a8c\\u5de5\\u6642\",\"en\":\"Cost(h)\"},\"storyopen\":{\"zh-cn\":\"\\u65b0\\u589e\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u65b0\\u589e\\u9700\\u6c42\\u6578\",\"en\":\"Open Story\"},\"storyclose\":{\"zh-cn\":\"\\u5173\\u95ed\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u95dc\\u9589\\u9700\\u6c42\\u6578\",\"en\":\"Closed Story\"},\"taskopen\":{\"zh-cn\":\"\\u65b0\\u589e\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u65b0\\u589e\\u4efb\\u52d9\\u6578\",\"en\":\"Open Task\"},\"taskfinish\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u4efb\\u52d9\\u6578\",\"en\":\"Finished Task\"},\"bugopen\":{\"zh-cn\":\"\\u65b0\\u589eBug\\u6570\",\"zh-tw\":\"\\u65b0\\u589eBug\\u6578\",\"en\":\"Open Bug\"},\"bugresolve\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6578\",\"en\":\"Resolved bug\"},\"actions\":{\"zh-cn\":\"\\u52a8\\u6001\\u6570\",\"zh-tw\":\"\\u52d5\\u614b\\u6578\",\"en\":\"Dynamics\"}}', '{\"group1\":\"day\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"userlogin\",\"consumed\",\"storyopen\",\"storyclose\",\"taskopen\",\"taskfinish\",\"bugopen\",\"bugresolve\",\"actions\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"userlogin\",\"consumed\",\"storyopen\",\"storyclose\",\"taskopen\",\"taskfinish\",\"bugopen\",\"bugresolve\",\"actions\"]}', 2, '{\"zh-cn\":\"\\u53ef\\u4ee5\\u6307\\u5b9a\\u4e00\\u4e2a\\u65f6\\u671f\\uff0c\\u5217\\u51fa\\u76f8\\u5e94\\u7684\\u6570\\u636e\\uff1a1. \\u6bcf\\u5929\\u7684\\u767b\\u5f55\\u6b21\\u6570\\u30022. \\u6bcf\\u5929\\u7684\\u65e5\\u5fd7\\u5de5\\u65f6\\u91cf\\u30023. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u9700\\u6c42\\u6570\\u30024. \\u6bcf\\u5929\\u5173\\u95ed\\u7684\\u9700\\u6c42\\u6570\\u30025. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u4efb\\u52a1\\u6570\\u30026. \\u6bcf\\u5929\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\u30027. \\u6bcf\\u5929\\u65b0\\u589e\\u7684Bug\\u6570\\u30028. \\u6bcf\\u5929\\u89e3\\u51b3\\u7684Bug\\u6570\\u30029. \\u6bcf\\u5929\\u7684\\u52a8\\u6001\\u6570\\u3002\",\"zh-tw\":\"\\u53ef\\u4ee5\\u6307\\u5b9a\\u4e00\\u500b\\u6642\\u671f\\uff0c\\u5217\\u51fa\\u76f8\\u61c9\\u7684\\u6578\\u64da\\uff1a1. \\u6bcf\\u5929\\u7684\\u767b\\u9304\\u6b21\\u6578\\u30022. \\u6bcf\\u5929\\u7684\\u65e5\\u8a8c\\u5de5\\u6642\\u91cf\\u30023. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u9700\\u6c42\\u6578\\u30024. \\u6bcf\\u5929\\u95dc\\u9589\\u7684\\u9700\\u6c42\\u6578\\u30025. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u4efb\\u52d9\\u6578\\u30026. \\u6bcf\\u5929\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\u30027. \\u6bcf\\u5929\\u65b0\\u589e\\u7684Bug\\u6578\\u30028. \\u6bcf\\u5929\\u89e3\\u6c7a\\u7684Bug\\u6578\\u30029. \\u6bcf\\u5929\\u7684\\u52d5\\u614b\\u6578\\u3002\",\"en\":\"The summary of company dynamics\"}', 'admin', '2015-07-27 15:09:42'), +('bug-resolve', '{\"zh-cn\":\"Bug\\u89e3\\u51b3\\u8868\",\"zh-tw\":\"Bug\\u89e3\\u6c7a\\u8868\",\"en\":\"Solved Bugs\"}', ',test', 'select *,if($product=\'\',0,product) as customproduct from TABLE_BUG where deleted=\'0\' and resolution!=\'\' and if($startDate=\'\',1,resolvedDate>=$startDate) and if($endDate=\'\',1,resolvedDate<=$endDate) having customproduct=$product', '{\"varName\":[\"product\",\"startDate\",\"endDate\"],\"showName\":[\"\\u4ea7\\u54c1\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u5f00\\u59cb\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u7ed3\\u675f\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"product\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"resolvedBy\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"],\"percent\":[\"1\"],\"contrast\":[\"crystalTotal\"],\"showAlone\":[\"1\"]}', 2, '{\"zh-cn\":\"List the total number of bugs resolved, the distribution of solutions, and the percentage (the number of bugs solved by this user to the total number of bugs resolved).\",\"zh-tw\":\"\\u5217\\u51fa\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0c\\u89e3\\u6c7a\\u65b9\\u6848\\u7684\\u5206\\u5e03\\uff0c\\u5360\\u7684\\u6bd4\\u4f8b\\uff08\\u8a72\\u7528\\u6236\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf\\u5360\\u6240\\u6709\\u7684\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf)\\u3002\",\"en\":\"percentage:self resolved \\/ all resolved\"}', 'admin', '2015-07-24 13:44:25'), +('project-progress', '{\"zh-cn\":\"\\u9879\\u76ee\\u8fdb\\u5c55\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9032\\u5c55\\u8868\",\"en\":\"Project Progress Report\"}', ',project', 'select t1.id,t4.name as project,t4.id,t1.name as execution,t1.status,t2.number as tasks,round(t2.consumed,2) as consumed,round(t2.`left`,2) as `left`,t3.stories,t2.undone as undoneTask,t3.undone as undoneStory,t2.totalReal from TABLE_EXECUTION as t1 \r\nleft join ztv_executionsummary as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\nleft join TABLE_PROJECT as t4 on t4.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t1.id=$execution) and if($status=\'\',1,t1.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"totalReal\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u6570\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u9700\\u6c42\\u6570\\uff0c\\u5269\\u4f59\\u4efb\\u52a1\\u6570\\uff0c\\u8fdb\\u5ea6\\u3002\",\"zh-tw\":\"\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u6578\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u9700\\u6c42\\u6578\\uff0c\\u5269\\u9918\\u4efb\\u52d9\\u6578\\uff0c\\u9032\\u5ea6\\u3002\",\"en\":\"Project requirements, tasks, consumed hours, remaining hours, remaining demands, remaining tasks, schedule.\"}', 'admin', '2015-07-23 14:03:06'), +('projectbug-type', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Project Bug Type\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t2.id as bugID,t2.type from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Type distribution of Bug statistics by project.\"}', 'admin', '2015-08-04 13:54:22'); diff --git a/db/zentao.sql b/db/zentao.sql index 29674baabc..954e59e617 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -6694,32 +6694,32 @@ CREATE OR REPLACE VIEW `ztv_daybugresolve` AS select count(*) AS `bugresolve`,le CREATE OR REPLACE VIEW `ztv_dayactions` AS select count(*) AS `actions`,left(`zt_action`.`date`,10) AS `day` from `zt_action` group by left(`zt_action`.`date`,10); REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES -('product-invest', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u6295\\u5165\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u6295\\u5165\\u8868\",\"en\":\"Product Investment\"}', ',product', 'select t1.id,t1.name,1 as projects, round(t3.consumed,2) as consumed from TABLE_PRODUCT as t1\r\n left join TABLE_PROJECTPRODUCT as t2 on t1.id=t2.product\r\n left join ztv_projectsummary as t3 on t2.project=t3.project\r\n left join TABLE_PROJECT as t4 on t2.project=t4.id\r\n left join TABLE_PROGRAM as t5 on t1.program=t5.id\r\n where t1.deleted=\'0\' and t4.deleted=\'0\' and t4.type=\'project\'\r\norder by t5.`order` asc, t1.line desc, t1.`order` asc', '', '{\"projects\":{\"zh-cn\":\"\\u9879\\u76ee\\u6570\",\"zh-tw\":\"\\u9879\\u76ee\\u6570\",\"en\":\"Projects\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"projects\",\"consumed\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"projects\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u6bcf\\u4e2a\\u4ea7\\u54c1\\u7684\\u9879\\u76ee\\u603b\\u6570\\uff0c\\u5df2\\u7ecf\\u6d88\\u8017\\u7684\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u6bcf\\u500b\\u7522\\u54c1\\u7684\\u9805\\u76ee\\u7e3d\\u6578\\uff0c\\u5df2\\u7d93\\u6d88\\u8017\\u7684\\u5de5\\u6642\\u3002\",\"en\":\"Number of projects and consumed hours.\"}', 'admin', '2015-07-20 14:21:30'), +('product-invest', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u6295\\u5165\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u6295\\u5165\\u8868\",\"en\":\"Product Investment\"}', ',product', 'select t1.id,t1.name,1 as projects, round(t3.consumed,2) as consumed from TABLE_PRODUCT as t1\r\n left join TABLE_PROJECTPRODUCT as t2 on t1.id=t2.product\r\n left join ztv_projectsummary as t3 on t2.project=t3.project\r\n left join TABLE_PROJECT as t4 on t2.project=t4.id\r\n left join TABLE_PROGRAM as t5 on t1.program=t5.id\r\n where t1.deleted=\'0\' and t4.deleted=\'0\' and t4.type=\'project\'\r\norder by t5.`order` asc, t1.line desc, t1.`order` asc', '', '{\"projects\":{\"zh-cn\":\"\\u9879\\u76ee\\u6570\",\"zh-tw\":\"\\u9879\\u76ee\\u6570\",\"en\":\"Projects\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"projects\",\"consumed\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"projects\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u6bcf\\u4e2a\\u4ea7\\u54c1\\u7684\\u9879\\u76ee\\u603b\\u6570\\uff0c\\u5df2\\u7ecf\\u6d88\\u8017\\u7684\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u6bcf\\u500b\\u7522\\u54c1\\u7684\\u9805\\u76ee\\u7e3d\\u6578\\uff0c\\u5df2\\u7d93\\u6d88\\u8017\\u7684\\u5de5\\u6642\\u3002\",\"en\":\"Number of projects and consumed hours.\"}', 'admin', '2015-07-20 14:21:31'), ('product-progress', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u5b8c\\u6210\\u5ea6\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u5b8c\\u6210\\u5ea6\\u7d71\\u8a08\\u8868\",\"en\":\"Product Progress\"}', ',product', 'select t1.*,t2.name, (case when t1.status = \'closed\' or t1.stage = \'released\' then 1 else 0 end) as done, 1 as count from TABLE_STORY as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"count\",\"done\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"count\",\"done\"],\"percent\":{\"1\":\"1\"},\"contrast\":{\"1\":\"count\"},\"showAlone\":{\"1\":\"1\"}}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u603b\\u6570(\\u72b6\\u6001\\u662f\\u5173\\u95ed\\uff0c\\u6216\\u8005\\u7814\\u53d1\\u9636\\u6bb5\\u662f\\u53d1\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u7e3d\\u6578(\\u72c0\\u614b\\u662f\\u95dc\\u9589\\uff0c\\u6216\\u8005\\u7814\\u767c\\u968e\\u6bb5\\u662f\\u767c\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"en\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\"}', 'admin', '2015-07-21 15:07:48'), ('story-status', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Story Status\"}', ',product', 'select t1.*,t2.name from TABLE_STORY as t1\r\n left join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u72b6\\u6001\\u7684\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u72c0\\u614b\\u7684\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Total number and status distribution of stories.\"}', 'admin', '2015-07-21 15:35:38'), ('story-stage', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Story Stage\"}', ',product', 'select t1.*,t2.name from TABLE_STORY as t1\r\n left join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u7814\\u53d1\\u9636\\u6bb5\\u7684\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u7814\\u767c\\u968e\\u6bb5\\u7684\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Total number and stage distribution of stories \"}', 'admin', '2015-07-21 15:38:34'), -('product-release', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u53d1\\u5e03\\u6570\\u91cf\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u767c\\u5e03\\u6578\\u91cf\\u7d71\\u8a08\\u8868\",\"en\":\"Product Release\"}', ',product', 'select t2.name, 1 as releases from TABLE_RELEASE as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"releases\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"releases\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u53d1\\u5e03\\u7684\\u6570\\u91cf\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u767c\\u5e03\\u7684\\u6578\\u91cf\\u3002\",\"en\":\"Product Release.\"}', 'admin', '2015-07-21 16:00:52'), -('task-status', '{\"zh-cn\":\"\\u4efb\\u52a1\\u72b6\\u6001\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u72c0\\u614b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Status Report\",\"de\":\"Task Status Report\",\"fr\":\"Task Status Report\",\"vi\":\"Task Status Report\",\"ja\":\"Task Status Report\"}', ',project', 'select t1.id,t3.name as project,t1.name,t2.status,t1.name as execution,t2.id as taskID, t1.status as projectstatus, (case when t2.deadline < CURDATE() and t2.deadline != \'0000-00-00\' and t2.status != \'closed\' and t2.status != \'done\' and t2.status != \'cancel\' then 1 else 0 end) as timeout from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u6267\\u884c\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u57f7\\u884c\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 11:28:33'), -('task-type', '{\"zh-cn\":\"\\u4efb\\u52a1\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Type Report\",\"de\":\"Task Type Report\",\"fr\":\"Task Type Report\",\"vi\":\"Task Type Report\",\"ja\":\"Task Type Report\"}', ',project', 'select t1.id,t3.name as project,t1.name as execution,t2.type,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 13:06:46'), -('task-assign', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u6307\\u6d3e\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u6307\\u6d3e\\u7d71\\u8a08\\u8868\",\"en\":\"Task Assign Report\",\"de\":\"Task Assign Report\",\"fr\":\"Task Assign Report\",\"vi\":\"Task Assign Report\",\"ja\":\"Task Assign Report\"}', ',project', 'select t1.id,t4.name as project,t1.name as execution,if(t3.account is not null, t3.account,t2.assignedTo) as assignedTo,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_TEAM as t3 on t3.type=\'task\' && t3.root=t2.id \r\nleft join TABLE_PROJECT as t4 on t1.project=t4.id\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t4.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"assignedTo\":{\"zh-cn\":\"\\u6307\\u6d3e\\u7ed9\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 13:13:28'), -('task-finish', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u5b8c\\u6210\\u8005\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u5b8c\\u6210\\u8005\\u7d71\\u8a08\\u8868\",\"en\":\"Task Finish Report\",\"de\":\"Task Finish Report\",\"fr\":\"Task Finish Report\",\"vi\":\"Task Finish Report\",\"ja\":\"Task Finish Report\"}', ',project', 'select t1.id,t3.name as project,t1.name as execution,t2.finishedBy,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t1.project=t3.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and t2.finishedBy!=\'\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"finishedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 13:16:21'), -('project-invest', '{\"zh-cn\":\"\\u9879\\u76ee\\u6295\\u5165\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u6295\\u5165\\u7d71\\u8a08\\u8868\",\"en\":\"Project Invest Report\",\"de\":\"Project Invest Report\",\"fr\":\"Project Invest Report\",\"vi\":\"Project Invest Report\",\"ja\":\"Project Invest Report\"}', ',project', 'select t1.id,t5.name as project,t1.name as execution,CONCAT(t1.begin,\' ~ \',t1.end) as timeLimit,t2.teams,t3.stories,round(t4.consumed,1) as consumed,t4.number, t1.status as projectstatus \r\nfrom TABLE_EXECUTION as t1\r\n left join ztv_projectteams as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\n left join ztv_executionsummary as t4 on t1.id=t4.execution \r\nleft join TABLE_PROJECT as t5 on t1.project=t5.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t5.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"timeLimit\":{\"zh-cn\":\"\\u5de5\\u671f\"},\"teams\":{\"zh-cn\":\"\\u4eba\\u6570\"},\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\"},\"consumed\":{\"zh-cn\":\"\\u603b\\u6d88\\u8017\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"number\",\"stories\",\"teams\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"number\",\"stories\",\"teams\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52a1\\u6570\\uff0c\\u9700\\u6c42\\u6570\\uff0c\\u4eba\\u6570\\uff0c\\u603b\\u6d88\\u8017\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52d9\\u6578\\uff0c\\u9700\\u6c42\\u6578\\uff0c\\u4eba\\u6578\\uff0c\\u7e3d\\u6d88\\u8017\\u5de5\\u6642\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 16:37:38'), -('projectstory-status', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Story Status\",\"de\":\"Project Story Status\",\"fr\":\"Project Story Status\",\"vi\":\"Project Story Status\",\"ja\":\"Project Story Status\"}', ',project', 'select t2.id, t4.name as project,t2.name as execution,t3.status from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 15:35:08'), -('project-stage', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Project Stage Report\",\"de\":\"Project Stage Report\",\"fr\":\"Project Stage Report\",\"vi\":\"Project Stage Report\",\"ja\":\"Project Stage Report\"}', ',project', 'select t2.id, t4.name as project,t2.name as execution,t3.stage from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 15:38:18'), -('projectbug-resolution', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolution\",\"de\":\"Project Bug Resolution\",\"fr\":\"Project Bug Resolution\",\"vi\":\"Project Bug Resolution\",\"ja\":\"Project Bug Resolution\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.resolution from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t2.deleted=\'0\' and t2.resolution!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:04:46'), -('projectbug-status', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Status\",\"de\":\"Project Bug Status\",\"fr\":\"Project Bug Status\",\"vi\":\"Project Bug Status\",\"ja\":\"Project Bug Status\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.status from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\' \' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 15:48:03'), -('projectbug-opened', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Opened\",\"de\":\"Project Bug Opened\",\"fr\":\"Project Bug Opened\",\"vi\":\"Project Bug Opened\",\"ja\":\"Project Bug Opened\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.openedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"openedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:08:10'), -('projectbug-resolve', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolve\",\"de\":\"Project Bug Resolve\",\"fr\":\"Project Bug Resolve\",\"vi\":\"Project Bug Resolve\",\"ja\":\"Project Bug Resolve\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.resolvedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and t2.status!=\'active\' and t2.resolvedBy!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolvedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:13:16'), -('projectbug-assign', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Assign\",\"de\":\"Project Bug Assign\",\"fr\":\"Project Bug Assign\",\"vi\":\"Project Bug Assign\",\"ja\":\"Project Bug Assign\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.assignedTo from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution \r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:29:10'), -('project-quality', '{\"zh-cn\":\"\\u9879\\u76ee\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u8cea\\u91cf\\u8868\",\"en\":\"Project Quality Report\",\"de\":\"Project Quality Report\",\"fr\":\"Project Quality Report\",\"vi\":\"Project Quality Report\",\"ja\":\"Project Quality Report\"}', ',project', 'select t1.id, t5.name as project,t5.id,t1.name as execution,t2.stories,(t2.stories-t2.undone) as doneStory,t3.number,(t3.number-t3.undone) as doneTask,t4.bugs,t4.resolutions, round(t4.bugs/(t2.stories-t2.undone),2) as bugthanstory,round(t4.bugs/(t3.number-t3.undone),2) as bugthantask,t4.seriousBugs from TABLE_EXECUTION as t1 \r\nleft join ztv_projectstories as t2 on t1.id=t2.execution\r\nleft join ztv_executionsummary as t3 on t1.id=t3.execution\r\nleft join ztv_projectbugs as t4 on t1.id=t4.execution\r\nleft join TABLE_PROJECT as t5 on t5.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t1.grade=\'1\' and if($project=\'\',1,t5.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u603b\\u6570\"},\"doneTask\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\"},\"bugthantask\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u4efb\\u52a1\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdBug\\u6bd4\\u7387\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52a1\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3\\uff09\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52d9\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3\\uff09\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 17:03:10'), -('productbug-type', '{\"zh-cn\":\"\\u4ea7\\u54c1Bug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1Bug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Bug Type of Product\"}', ',product,test', 'select t1.id,t1.name,t2.id as bugID,t2.type from TABLE_PRODUCT as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.product \r\nleft join TABLE_PROGRAM as t3 on t1.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t1.line desc, t1.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Type distribution of Bugs.\"}', 'admin', '2015-07-24 13:48:22'), -('product-quality', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u8cea\\u91cf\\u8868\",\"en\":\"Product Quality\"}', ',product', 'select t1.id,t1.name,t2.stories,(t2.stories-t2.undone) as doneStory,t3.bugs,t3.resolutions,round(t3.bugs/(t2.stories-t2.undone),2) as bugthanstory,t3.seriousBugs from TABLE_PRODUCT as t1 \r\nleft join ztv_productstories as t2 on t1.id=t2.product \r\nleft join ztv_productbugs as t3 on t1.id=t3.product \r\nleft join TABLE_PROGRAM as t4 on t1.program=t4.id \r\nwhere t1.deleted=\'0\'\r\norder by t4.`order` asc, t1.line desc, t1.`order` asc', '', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u603b\\u6570\",\"en\":\"Stories\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"en\":\"Finished Stories\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\",\"zh-tw\":\"Bug\\u6570\",\"en\":\"Bugs\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6570\",\"en\":\"Solved Bugs\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"zh-tw\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"en\":\"Bug\\/Finished Story\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\",\"zh-tw\":\"\\u91cd\\u8981Bug\\u6570\",\"en\":\"Serious Bugs\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"zh-tw\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"en\":\"Serious Bugs %\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"bugs\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u4ea7\\u54c1\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u603b\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3)\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u7522\\u54c1\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3)\\u3002\",\"en\":\"Serious Bug (severity is less than 3).\"}', 'admin', '2015-07-23 17:17:40'), -('user-login', '{\"zh-cn\":\"\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u8868\",\"en\":\"Login Times\"}', ',staff', 'select actor,LEFT(`date`,10) as `day` from TABLE_ACTION where `action`=\'login\' and if($startDate=\'\',1,`date`>=$startDate) and if($endDate=\'\',1,`date`<=$endDate) order by `date` asc, actor asc', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"actor\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"day\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u5b9e\\u73b0\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u62a5\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7edf\\u8ba1\\u6bcf\\u5929\\u6bcf\\u4e2a\\u4eba\\u7684\\u767b\\u5f55\\u6b21\\u6570\\uff0c\\u4ee5\\u53ca\\u603b\\u6570\\u3002\",\"zh-tw\":\"\\u5be6\\u73fe\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u5831\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7d71\\u8a08\\u6bcf\\u5929\\u6bcf\\u500b\\u4eba\\u7684\\u767b\\u9304\\u6b21\\u6578\\uff0c\\u4ee5\\u53ca\\u7e3d\\u6578\\u3002\",\"en\":\"The summary of user login times.\"}', 'admin', '2015-07-24 14:28:11'), -('effort', '{\"zh-cn\":\"\\u65e5\\u5fd7\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u65e5\\u8a8c\\u532f\\u7e3d\\u8868\",\"en\":\"Effort Summary\"}', ',staff', 'select t1.account,t1.consumed,t1.`date`,if($dept=\'0\',0,t2.dept) as dept from TABLE_EFFORT as t1 left join TABLE_USER as t2 on t1.account=t2.account where t1.`deleted`=\'0\' and if($startDate=\'\',1,t1.`date`>=$startDate) and if($endDate=\'\',1,t1.`date`<=$endDate) having dept=$dept order by `date` asc', '{\"varName\":[\"dept\",\"startDate\",\"endDate\"],\"showName\":[\"\\u90e8\\u95e8\",\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"dept\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"date\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"consumed\":{\"zh-cn\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost\"}}', '{\"group1\":\"account\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"date\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"consumed\"]}', 2, '{\"zh-cn\":\"\\u67e5\\u770b\\u67d0\\u4e2a\\u65f6\\u95f4\\u6bb5\\u5185\\u7684\\u65e5\\u5fd7\\u60c5\\u51b5\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u95e8\\u9009\\u62e9\\u3002\",\"zh-tw\":\"\\u67e5\\u770b\\u67d0\\u500b\\u6642\\u9593\\u6bb5\\u5167\\u7684\\u65e5\\u8a8c\\u60c5\\u6cc1\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u9580\\u9078\\u64c7\\u3002\",\"en\":\"Effort summary of users.\"}', 'admin', '2015-07-27 13:53:32'), +('product-release', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u53d1\\u5e03\\u6570\\u91cf\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u767c\\u5e03\\u6578\\u91cf\\u7d71\\u8a08\\u8868\",\"en\":\"Product Release\"}', ',product', 'select t2.name, 1 as releases from TABLE_RELEASE as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"releases\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"releases\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u53d1\\u5e03\\u7684\\u6570\\u91cf\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u767c\\u5e03\\u7684\\u6578\\u91cf\\u3002\",\"en\":\"List the number of releases by product.\"}', 'admin', '2015-07-21 16:00:52'), +('task-status', '{\"zh-cn\":\"\\u4efb\\u52a1\\u72b6\\u6001\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u72c0\\u614b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Status Report\"}', ',project', 'select t1.id,t3.name as project,t1.name,t2.status,t1.name as execution,t2.id as taskID, t1.status as projectstatus, (case when t2.deadline < CURDATE() and t2.deadline != \'0000-00-00\' and t2.status != \'closed\' and t2.status != \'done\' and t2.status != \'cancel\' then 1 else 0 end) as timeout from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u6267\\u884c\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u57f7\\u884c\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Based on the status distribution of statistical tasks.\"}', 'admin', '2015-07-22 11:28:33'), +('task-type', '{\"zh-cn\":\"\\u4efb\\u52a1\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Type Report\"}', ',project', 'select t1.id,t3.name as project,t1.name as execution,t2.type,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the type of statistical task distribution.\"}', 'admin', '2015-07-22 13:06:46'), +('task-assign', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u6307\\u6d3e\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u6307\\u6d3e\\u7d71\\u8a08\\u8868\",\"en\":\"Task Assign Report\"}', ',project', 'select t1.id,t4.name as project,t1.name as execution,if(t3.account is not null, t3.account,t2.assignedTo) as assignedTo,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_TEAM as t3 on t3.type=\'task\' && t3.root=t2.id \r\nleft join TABLE_PROJECT as t4 on t1.project=t4.id\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t4.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"assignedTo\":{\"zh-cn\":\"\\u6307\\u6d3e\\u7ed9\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics task assigned to the distribution.\"}', 'admin', '2015-07-22 13:13:28'), +('task-finish', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u5b8c\\u6210\\u8005\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u5b8c\\u6210\\u8005\\u7d71\\u8a08\\u8868\",\"en\":\"Task Finish Report\"}', ',project', 'select t1.id,t3.name as project,t1.name as execution,t2.finishedBy,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t1.project=t3.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and t2.finishedBy!=\'\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"finishedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics task completion distribution.\"}', 'admin', '2015-07-22 13:16:21'), +('project-invest', '{\"zh-cn\":\"\\u9879\\u76ee\\u6295\\u5165\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u6295\\u5165\\u7d71\\u8a08\\u8868\",\"en\":\"Project Invest Report\"}', ',project', 'select t1.id,t5.name as project,t1.name as execution,CONCAT(t1.begin,\' ~ \',t1.end) as timeLimit,t2.teams,t3.stories,round(t4.consumed,1) as consumed,t4.number, t1.status as projectstatus \r\nfrom TABLE_EXECUTION as t1\r\n left join ztv_projectteams as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\n left join ztv_executionsummary as t4 on t1.id=t4.execution \r\nleft join TABLE_PROJECT as t5 on t1.project=t5.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t5.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"timeLimit\":{\"zh-cn\":\"\\u5de5\\u671f\"},\"teams\":{\"zh-cn\":\"\\u4eba\\u6570\"},\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\"},\"consumed\":{\"zh-cn\":\"\\u603b\\u6d88\\u8017\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"number\",\"stories\",\"teams\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"number\",\"stories\",\"teams\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52a1\\u6570\\uff0c\\u9700\\u6c42\\u6570\\uff0c\\u4eba\\u6570\\uff0c\\u603b\\u6d88\\u8017\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52d9\\u6578\\uff0c\\u9700\\u6c42\\u6578\\uff0c\\u4eba\\u6578\\uff0c\\u7e3d\\u6d88\\u8017\\u5de5\\u6642\\u3002\",\"en\":\"Listed by project: number of tasks, number of demands, number of people, total hours consumed.\"}', 'admin', '2015-07-22 16:37:38'), +('projectstory-status', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Story Status\"}', ',project', 'select t2.id, t4.name as project,t2.name as execution,t3.status from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics requirement status distribution.\"}', 'admin', '2015-07-23 15:35:08'), +('project-stage', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Project Stage Report\"}', ',project', 'select t2.id, t4.name as project,t2.name as execution,t3.stage from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics demand stage distribution.\"}', 'admin', '2015-07-23 15:38:18'), +('projectbug-resolution', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolution\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.resolution from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t2.deleted=\'0\' and t2.resolution!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Solution distribution of statistical bugs by project.\"}', 'admin', '2015-07-23 16:04:46'), +('projectbug-status', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Status\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.status from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\' \' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Statistics Bug status distribution by project.\"}', 'admin', '2015-07-23 15:48:03'), +('projectbug-opened', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Opened\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.openedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"openedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Bug creator distribution by project.\"}', 'admin', '2015-07-23 16:08:10'), +('projectbug-resolve', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolve\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.resolvedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and t2.status!=\'active\' and t2.resolvedBy!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolvedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Bug solver distribution by project.\"}', 'admin', '2015-07-23 16:13:16'), +('projectbug-assign', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Assign\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t1.id as bugID,t2.assignedTo from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution \r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"According to the project statistics Bug assigned to the distribution.\"}', 'admin', '2015-07-23 16:29:10'), +('project-quality', '{\"zh-cn\":\"\\u9879\\u76ee\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u8cea\\u91cf\\u8868\",\"en\":\"Project Quality Report\"}', ',project', 'select t1.id, t5.name as project,t5.id,t1.name as execution,t2.stories,(t2.stories-t2.undone) as doneStory,t3.number,(t3.number-t3.undone) as doneTask,t4.bugs,t4.resolutions, round(t4.bugs/(t2.stories-t2.undone),2) as bugthanstory,round(t4.bugs/(t3.number-t3.undone),2) as bugthantask,t4.seriousBugs from TABLE_EXECUTION as t1 \r\nleft join ztv_projectstories as t2 on t1.id=t2.execution\r\nleft join ztv_executionsummary as t3 on t1.id=t3.execution\r\nleft join ztv_projectbugs as t4 on t1.id=t4.execution\r\nleft join TABLE_PROJECT as t5 on t5.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t1.grade=\'1\' and if($project=\'\',1,t5.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u603b\\u6570\"},\"doneTask\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\"},\"bugthantask\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u4efb\\u52a1\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdBug\\u6bd4\\u7387\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52a1\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3\\uff09\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52d9\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3\\uff09\\u3002\",\"en\":\"List total requirements, completed requirements, total tasks, completed tasks, bugs, solved bugs, bugs\\/requirements, bugs\\/tasks, critical bugs (severity not greater than 3) for the project.\"}', 'admin', '2015-07-23 17:03:10'), +('productbug-type', '{\"zh-cn\":\"\\u4ea7\\u54c1Bug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1Bug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Bug Type of Product\"}', ',product,test', 'select t1.id,t1.name,t2.id as bugID,t2.type from TABLE_PRODUCT as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.product \r\nleft join TABLE_PROGRAM as t3 on t1.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t1.line desc, t1.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"The distribution of Bug types by product statistics.\"}', 'admin', '2015-07-24 13:48:22'), +('product-quality', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u8cea\\u91cf\\u8868\",\"en\":\"Product Quality\"}', ',product', 'select t1.id,t1.name,t2.stories,(t2.stories-t2.undone) as doneStory,t3.bugs,t3.resolutions,round(t3.bugs/(t2.stories-t2.undone),2) as bugthanstory,t3.seriousBugs from TABLE_PRODUCT as t1 \r\nleft join ztv_productstories as t2 on t1.id=t2.product \r\nleft join ztv_productbugs as t3 on t1.id=t3.product \r\nleft join TABLE_PROGRAM as t4 on t1.program=t4.id \r\nwhere t1.deleted=\'0\'\r\norder by t4.`order` asc, t1.line desc, t1.`order` asc', '', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u603b\\u6570\",\"en\":\"Stories\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"en\":\"Finished Stories\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\",\"zh-tw\":\"Bug\\u6570\",\"en\":\"Bugs\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6570\",\"en\":\"Solved Bugs\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"zh-tw\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"en\":\"Bug\\/Finished Story\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\",\"zh-tw\":\"\\u91cd\\u8981Bug\\u6570\",\"en\":\"Serious Bugs\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"zh-tw\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"en\":\"Serious Bugs %\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"bugs\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u4ea7\\u54c1\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u603b\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3)\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u7522\\u54c1\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3)\\u3002\",\"en\":\"List requirements for the product, total requirements completed, number of bugs, number of bugs solved, bugs\\/requirements, number of significant bugs (severity not greater than 3).\"}', 'admin', '2015-07-23 17:17:40'), +('user-login', '{\"zh-cn\":\"\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u8868\",\"en\":\"Login Times\"}', ',staff', 'select actor,LEFT(`date`,10) as `day` from TABLE_ACTION where `action`=\'login\' and if($startDate=\'\',1,`date`>=$startDate) and if($endDate=\'\',1,`date`<=$endDate) order by `date` asc, actor asc', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"actor\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"day\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u5b9e\\u73b0\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u62a5\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7edf\\u8ba1\\u6bcf\\u5929\\u6bcf\\u4e2a\\u4eba\\u7684\\u767b\\u5f55\\u6b21\\u6570\\uff0c\\u4ee5\\u53ca\\u603b\\u6570\\u3002\",\"zh-tw\":\"\\u5be6\\u73fe\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u5831\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7d71\\u8a08\\u6bcf\\u5929\\u6bcf\\u500b\\u4eba\\u7684\\u767b\\u9304\\u6b21\\u6578\\uff0c\\u4ee5\\u53ca\\u7e3d\\u6578\\u3002\",\"en\":\"Realize the employee login times statistics report, counting the login times of each person and the total number by day.\"}', 'admin', '2015-07-24 14:28:11'), +('effort', '{\"zh-cn\":\"\\u65e5\\u5fd7\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u65e5\\u8a8c\\u532f\\u7e3d\\u8868\",\"en\":\"Effort Summary\"}', ',staff', 'select t1.account,t1.consumed,t1.`date`,if($dept=\'0\',0,t2.dept) as dept from TABLE_EFFORT as t1 left join TABLE_USER as t2 on t1.account=t2.account where t1.`deleted`=\'0\' and if($startDate=\'\',1,t1.`date`>=$startDate) and if($endDate=\'\',1,t1.`date`<=$endDate) having dept=$dept order by `date` asc', '{\"varName\":[\"dept\",\"startDate\",\"endDate\"],\"showName\":[\"\\u90e8\\u95e8\",\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"dept\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"date\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"consumed\":{\"zh-cn\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost\"}}', '{\"group1\":\"account\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"date\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"consumed\"]}', 2, '{\"zh-cn\":\"\\u67e5\\u770b\\u67d0\\u4e2a\\u65f6\\u95f4\\u6bb5\\u5185\\u7684\\u65e5\\u5fd7\\u60c5\\u51b5\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u95e8\\u9009\\u62e9\\u3002\",\"zh-tw\":\"\\u67e5\\u770b\\u67d0\\u500b\\u6642\\u9593\\u6bb5\\u5167\\u7684\\u65e5\\u8a8c\\u60c5\\u6cc1\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u9580\\u9078\\u64c7\\u3002\",\"en\":\"You can view the logs of a certain period by department.\"}', 'admin', '2015-07-27 13:53:32'), ('company-dynamic', '{\"zh-cn\":\"\\u516c\\u53f8\\u52a8\\u6001\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u516c\\u53f8\\u52d5\\u614b\\u532f\\u7e3d\\u8868\",\"en\":\"Company Dynamics\"}', ',staff', 'select t1.day,t2.userlogin,t3.consumed,t4.storyopen,t5.storyclose,t6.taskopen,t7.taskfinish,t8.bugopen,t9.bugresolve,t1.actions from ztv_dayactions as t1 left join ztv_dayuserlogin as t2 on t1.day=t2.day left join ztv_dayeffort as t3 on t1.day=t3.date left join ztv_daystoryopen as t4 on t1.day=t4.day left join ztv_daystoryclose as t5 on t1.day=t5.day left join ztv_daytaskopen as t6 on t1.day=t6.day left join ztv_daytaskfinish as t7 on t1.day=t7.day left join ztv_daybugopen as t8 on t1.day=t8.day left join ztv_daybugresolve as t9 on t1.day=t9.day where if($startDate=\'\',1,t1.day>=$startDate) and if($endDate=\'\',1,t1.day<=$endDate)', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"day\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"userlogin\":{\"zh-cn\":\"\\u767b\\u5f55\\u6b21\\u6570\",\"zh-tw\":\"\\u767b\\u9304\\u6b21\\u6578\",\"en\":\"Login\"},\"consumed\":{\"zh-cn\":\"\\u65e5\\u5fd7\\u5de5\\u65f6\",\"zh-tw\":\"\\u65e5\\u8a8c\\u5de5\\u6642\",\"en\":\"Cost(h)\"},\"storyopen\":{\"zh-cn\":\"\\u65b0\\u589e\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u65b0\\u589e\\u9700\\u6c42\\u6578\",\"en\":\"Open Story\"},\"storyclose\":{\"zh-cn\":\"\\u5173\\u95ed\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u95dc\\u9589\\u9700\\u6c42\\u6578\",\"en\":\"Closed Story\"},\"taskopen\":{\"zh-cn\":\"\\u65b0\\u589e\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u65b0\\u589e\\u4efb\\u52d9\\u6578\",\"en\":\"Open Task\"},\"taskfinish\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u4efb\\u52d9\\u6578\",\"en\":\"Finished Task\"},\"bugopen\":{\"zh-cn\":\"\\u65b0\\u589eBug\\u6570\",\"zh-tw\":\"\\u65b0\\u589eBug\\u6578\",\"en\":\"Open Bug\"},\"bugresolve\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6578\",\"en\":\"Resolved bug\"},\"actions\":{\"zh-cn\":\"\\u52a8\\u6001\\u6570\",\"zh-tw\":\"\\u52d5\\u614b\\u6578\",\"en\":\"Dynamics\"}}', '{\"group1\":\"day\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"userlogin\",\"consumed\",\"storyopen\",\"storyclose\",\"taskopen\",\"taskfinish\",\"bugopen\",\"bugresolve\",\"actions\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"userlogin\",\"consumed\",\"storyopen\",\"storyclose\",\"taskopen\",\"taskfinish\",\"bugopen\",\"bugresolve\",\"actions\"]}', 2, '{\"zh-cn\":\"\\u53ef\\u4ee5\\u6307\\u5b9a\\u4e00\\u4e2a\\u65f6\\u671f\\uff0c\\u5217\\u51fa\\u76f8\\u5e94\\u7684\\u6570\\u636e\\uff1a1. \\u6bcf\\u5929\\u7684\\u767b\\u5f55\\u6b21\\u6570\\u30022. \\u6bcf\\u5929\\u7684\\u65e5\\u5fd7\\u5de5\\u65f6\\u91cf\\u30023. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u9700\\u6c42\\u6570\\u30024. \\u6bcf\\u5929\\u5173\\u95ed\\u7684\\u9700\\u6c42\\u6570\\u30025. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u4efb\\u52a1\\u6570\\u30026. \\u6bcf\\u5929\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\u30027. \\u6bcf\\u5929\\u65b0\\u589e\\u7684Bug\\u6570\\u30028. \\u6bcf\\u5929\\u89e3\\u51b3\\u7684Bug\\u6570\\u30029. \\u6bcf\\u5929\\u7684\\u52a8\\u6001\\u6570\\u3002\",\"zh-tw\":\"\\u53ef\\u4ee5\\u6307\\u5b9a\\u4e00\\u500b\\u6642\\u671f\\uff0c\\u5217\\u51fa\\u76f8\\u61c9\\u7684\\u6578\\u64da\\uff1a1. \\u6bcf\\u5929\\u7684\\u767b\\u9304\\u6b21\\u6578\\u30022. \\u6bcf\\u5929\\u7684\\u65e5\\u8a8c\\u5de5\\u6642\\u91cf\\u30023. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u9700\\u6c42\\u6578\\u30024. \\u6bcf\\u5929\\u95dc\\u9589\\u7684\\u9700\\u6c42\\u6578\\u30025. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u4efb\\u52d9\\u6578\\u30026. \\u6bcf\\u5929\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\u30027. \\u6bcf\\u5929\\u65b0\\u589e\\u7684Bug\\u6578\\u30028. \\u6bcf\\u5929\\u89e3\\u6c7a\\u7684Bug\\u6578\\u30029. \\u6bcf\\u5929\\u7684\\u52d5\\u614b\\u6578\\u3002\",\"en\":\"The summary of company dynamics\"}', 'admin', '2015-07-27 15:09:42'), -('bug-resolve', '{\"zh-cn\":\"Bug\\u89e3\\u51b3\\u8868\",\"zh-tw\":\"Bug\\u89e3\\u6c7a\\u8868\",\"en\":\"Solved Bugs\"}', ',test', 'select *,if($product=\'\',0,product) as customproduct from TABLE_BUG where deleted=\'0\' and resolution!=\'\' and if($startDate=\'\',1,resolvedDate>=$startDate) and if($endDate=\'\',1,resolvedDate<=$endDate) having customproduct=$product', '{\"varName\":[\"product\",\"startDate\",\"endDate\"],\"showName\":[\"\\u4ea7\\u54c1\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u5f00\\u59cb\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u7ed3\\u675f\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"product\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"resolvedBy\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"],\"percent\":[\"1\"],\"contrast\":[\"crystalTotal\"],\"showAlone\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u89e3\\u51b3\\u7684Bug\\u603b\\u6570\\uff0c\\u89e3\\u51b3\\u65b9\\u6848\\u7684\\u5206\\u5e03\\uff0c\\u5360\\u7684\\u6bd4\\u4f8b\\uff08\\u8be5\\u7528\\u6237\\u89e3\\u51b3\\u7684Bug\\u7684\\u6570\\u91cf\\u5360\\u6240\\u6709\\u7684\\u89e3\\u51b3\\u7684Bug\\u7684\\u6570\\u91cf)\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0c\\u89e3\\u6c7a\\u65b9\\u6848\\u7684\\u5206\\u5e03\\uff0c\\u5360\\u7684\\u6bd4\\u4f8b\\uff08\\u8a72\\u7528\\u6236\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf\\u5360\\u6240\\u6709\\u7684\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf)\\u3002\",\"en\":\"percentage:self resolved \\/ all resolved\"}', 'admin', '2015-07-24 13:44:25'), -('project-progress', '{\"zh-cn\":\"\\u9879\\u76ee\\u8fdb\\u5c55\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9032\\u5c55\\u8868\",\"en\":\"Project Progress Report\",\"de\":\"Project Progress Report\",\"fr\":\"Project Progress Report\",\"vi\":\"Project Progress Report\",\"ja\":\"Project Progress Report\"}', ',project', 'select t1.id,t4.name as project,t4.id,t1.name as execution,t1.status,t2.number as tasks,round(t2.consumed,2) as consumed,round(t2.`left`,2) as `left`,t3.stories,t2.undone as undoneTask,t3.undone as undoneStory,t2.totalReal from TABLE_EXECUTION as t1 \r\nleft join ztv_executionsummary as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\nleft join TABLE_PROJECT as t4 on t4.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t1.id=$execution) and if($status=\'\',1,t1.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"totalReal\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u6570\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u9700\\u6c42\\u6570\\uff0c\\u5269\\u4f59\\u4efb\\u52a1\\u6570\\uff0c\\u8fdb\\u5ea6\\u3002\",\"zh-tw\":\"\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u6578\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u9700\\u6c42\\u6578\\uff0c\\u5269\\u9918\\u4efb\\u52d9\\u6578\\uff0c\\u9032\\u5ea6\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 14:03:06'), -('projectbug-type', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Project Bug Type\",\"de\":\"Project Bug Type\",\"fr\":\"Project Bug Type\",\"vi\":\"Project Bug Type\",\"ja\":\"Project Bug Type\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t2.id as bugID,t2.type from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-08-04 13:54:22'); +('bug-resolve', '{\"zh-cn\":\"Bug\\u89e3\\u51b3\\u8868\",\"zh-tw\":\"Bug\\u89e3\\u6c7a\\u8868\",\"en\":\"Solved Bugs\"}', ',test', 'select *,if($product=\'\',0,product) as customproduct from TABLE_BUG where deleted=\'0\' and resolution!=\'\' and if($startDate=\'\',1,resolvedDate>=$startDate) and if($endDate=\'\',1,resolvedDate<=$endDate) having customproduct=$product', '{\"varName\":[\"product\",\"startDate\",\"endDate\"],\"showName\":[\"\\u4ea7\\u54c1\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u5f00\\u59cb\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u7ed3\\u675f\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"product\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"resolvedBy\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"],\"percent\":[\"1\"],\"contrast\":[\"crystalTotal\"],\"showAlone\":[\"1\"]}', 2, '{\"zh-cn\":\"List the total number of bugs resolved, the distribution of solutions, and the percentage (the number of bugs solved by this user to the total number of bugs resolved).\",\"zh-tw\":\"\\u5217\\u51fa\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0c\\u89e3\\u6c7a\\u65b9\\u6848\\u7684\\u5206\\u5e03\\uff0c\\u5360\\u7684\\u6bd4\\u4f8b\\uff08\\u8a72\\u7528\\u6236\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf\\u5360\\u6240\\u6709\\u7684\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf)\\u3002\",\"en\":\"percentage:self resolved \\/ all resolved\"}', 'admin', '2015-07-24 13:44:25'), +('project-progress', '{\"zh-cn\":\"\\u9879\\u76ee\\u8fdb\\u5c55\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9032\\u5c55\\u8868\",\"en\":\"Project Progress Report\"}', ',project', 'select t1.id,t4.name as project,t4.id,t1.name as execution,t1.status,t2.number as tasks,round(t2.consumed,2) as consumed,round(t2.`left`,2) as `left`,t3.stories,t2.undone as undoneTask,t3.undone as undoneStory,t2.totalReal from TABLE_EXECUTION as t1 \r\nleft join ztv_executionsummary as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\nleft join TABLE_PROJECT as t4 on t4.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t1.id=$execution) and if($status=\'\',1,t1.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"totalReal\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u6570\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u9700\\u6c42\\u6570\\uff0c\\u5269\\u4f59\\u4efb\\u52a1\\u6570\\uff0c\\u8fdb\\u5ea6\\u3002\",\"zh-tw\":\"\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u6578\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u9700\\u6c42\\u6578\\uff0c\\u5269\\u9918\\u4efb\\u52d9\\u6578\\uff0c\\u9032\\u5ea6\\u3002\",\"en\":\"Project requirements, tasks, consumed hours, remaining hours, remaining demands, remaining tasks, schedule.\"}', 'admin', '2015-07-23 14:03:06'), +('projectbug-type', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Project Bug Type\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,t1.name as execution,t2.id as bugID,t2.type from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Type distribution of Bug statistics by project.\"}', 'admin', '2015-08-04 13:54:22'); REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1,'report','browseReport'), From 0c2c898c016a7c72b60eeb705e9b04461d71f877 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 13 Apr 2022 10:46:44 +0800 Subject: [PATCH 172/181] * Fix bug #21576. --- module/bug/model.php | 4 ++++ module/task/model.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/module/bug/model.php b/module/bug/model.php index e2f6587558..7a9a69dc0f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1568,15 +1568,19 @@ class bugModel extends model */ public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIDList = array(), $skipExecutionIDList = array()) { + $deletedProjectIDList = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq(1)->fetchPairs('id', 'id'); + $bugs = array(); $stmt = $this->dao->select('t1.id, t1.title, t2.name as product') ->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2') ->on('t1.product=t2.id') ->where('t1.assignedTo')->eq($account) + ->beginIF(!empty($deletedProjectIDList))->andWhere('t1.execution')->notin($deletedProjectIDList)->fi() ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi() ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) ->orderBy('id desc') ->beginIF($limit > 0)->limit($limit)->fi() ->query(); diff --git a/module/task/model.php b/module/task/model.php index 2e8f10396e..2eba68540d 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2343,6 +2343,8 @@ class taskModel extends model */ public function getUserTaskPairs($account, $status = 'all', $skipExecutionIDList = array()) { + $deletedProjectIDList = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq(1)->fetchPairs('id', 'id'); + $stmt = $this->dao->select('t1.id, t1.name, t2.name as execution') ->from(TABLE_TASK)->alias('t1') ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id') @@ -2351,6 +2353,7 @@ class taskModel extends model ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi() + ->beginIF(!empty($deletedProjectIDList))->andWhere('t1.execution')->notin($deletedProjectIDList)->fi() ->query(); $tasks = array(); From 18293e3e0d1d23b0ab7e04fcf2493d30fd4da340 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Wed, 13 Apr 2022 11:19:20 +0800 Subject: [PATCH 173/181] * Fix bug #15656. --- module/action/model.php | 2 +- module/api/control.php | 17 ++++++++++------- module/doc/control.php | 17 +++++++++-------- module/doc/model.php | 4 +++- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 672844e097..cd93cd03cf 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1366,7 +1366,7 @@ class actionModel extends model $appendLib = $docLib->deleted == '1' ? $action->objectID : 0; if($docLib->type == 'api') { - $action->objectLink = helper::createLink('api', 'index', "libID={$action->objectID}"); + $action->objectLink = helper::createLink('api', 'index', "libID={$action->objectID}&moduleID=0&apiID=0&version=0&release=0&appendLib={$appendLib}"); } else { diff --git a/module/api/control.php b/module/api/control.php index 3b788b81a7..c36f75a32d 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -22,18 +22,21 @@ class api extends control /** * Api doc index page. * - * @param int $libID - * @param int $moduleID - * @param int $apiID - * @param int $version - * @param int $release + * @param int $libID + * @param int $moduleID + * @param int $apiID + * @param int $version + * @param int $release + * @param int $appendLib * @access public * @return void */ - public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0) + public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0) { /* Get all api doc libraries. */ - $libs = $this->doc->getApiLibs(); + $lib = $this->doc->getLibById($libID); + $appendLib = (!empty($lib) and $lib->deleted == '1') ? $libID : 0; + $libs = $this->doc->getApiLibs($appendLib); /* Generate bread crumbs dropMenu. */ if($libs) diff --git a/module/doc/control.php b/module/doc/control.php index a7dfce5c67..07028eae44 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -374,11 +374,11 @@ class doc extends control /** * Edit a doc. * - * @param int $docID - * @param bool $comment - * @param string $objectType - * @param int $objectID - * @param int $libID + * @param int $docID + * @param bool $comment + * @param string $objectType + * @param int $objectID + * @param int $libID * @access public * @return void */ @@ -466,7 +466,8 @@ class doc extends control } $objects = $this->doc->getOrderedObjects($objectType); - $libs = $this->doc->getLibsByObject($objectType, $objectID); + $appendLib = (!empty($lib) and $lib->deleted == '1') ? $libID : 0; + $libs = $this->doc->getLibsByObject($objectType, $objectID, '', $appendLib); $this->lang->modulePageNav = $this->doc->select($objectType, $objects, $objectID, $libs, $libID); $this->lang->TRActions = common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($objectType, $objectID, $libID) : ''; @@ -1020,7 +1021,7 @@ class doc extends control /* Add the anchor to the element. */ $content[$index] = str_replace('<' . $includeHeadElement[0] . $headElement[2] . '>', '<' . $includeHeadElement[0] . $headElement[2] . " id='anchor{$index}'" . '>', $content[$index]); - $outline .= '
        • ' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'"); + $outline .= '
        • ' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'"); $preElement = $headElement[1]; } @@ -1031,7 +1032,7 @@ class doc extends control /* Add the anchor to the element. */ $content[$index] = str_replace('<' . $includeHeadElement[1] . $headElement[2] . '>', '<' . $includeHeadElement[1] . $headElement[2] . " id='anchor{$index}'" . '>', $content[$index]); - $outline .= '
        • ' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'") . '
        • '; + $outline .= '
        • ' . html::a('#anchor' . $index, strip_tags($headElement[3]), '', "title='" . strip_tags($headElement[3]) . "'") . '
        • '; $preElement = $includeHeadElement[1]; } diff --git a/module/doc/model.php b/module/doc/model.php index 0a74770059..b7890c1816 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -38,14 +38,16 @@ class docModel extends model /** * Get api Libraries. * + * @param int $appendLib * @return array * @author thanatos thanatos915@163.com */ - public function getApiLibs() + public function getApiLibs($appendLib = 0) { $libs = $this->dao->select('*')->from(TABLE_DOCLIB) ->where('deleted')->eq(0) ->andWhere('type')->eq('api') + ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi() ->orderBy('id_desc') ->fetchAll('id'); $libs = array_filter($libs, array($this, 'checkPrivLib')); From 20a90511485fd478262733f226f44e8e416785dc Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Wed, 13 Apr 2022 11:23:29 +0800 Subject: [PATCH 174/181] * Fix bug #14891. --- module/block/view/recentprojectblock.html.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/block/view/recentprojectblock.html.php b/module/block/view/recentprojectblock.html.php index 8a319acca3..169fbc845f 100644 --- a/module/block/view/recentprojectblock.html.php +++ b/module/block/view/recentprojectblock.html.php @@ -26,7 +26,7 @@ #cards .project-stages:after {content: ' '; width: 30px; display: block; right: -5px; top: 16px; bottom: -5px; z-index: 1; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); position: absolute;} #cards .project-stages-row {position: relative; height: 30px; z-index: 0;} #cards .project-stage-item {white-space: nowrap; position: absolute; top: 0; min-width: 48px; padding-top: 13px; color: #838A9D;} -#cards .project-stage-item > div {white-space: nowrap; overflow: visible; text-align: center; text-overflow: ellipsis;} +#cards .project-stage-item > div {max-width: 70px; white-space: nowrap; overflow: hidden; text-align: center; text-overflow: ellipsis;} #cards .project-stage-item:before {content: ' '; display: block; width: 8px; height: 8px; border-radius: 50%; background: #D1D1D1; position: absolute; left: 50%; margin-left: -4px; top: 0; z-index: 1;} #cards .project-stage-item + .project-stage-item:after {content: ' '; display: block; left: -50%; right: 50%; height: 2px; background-color: #D1D1D1; top: 3px; position: absolute; z-index: 0;} #cards .project-stage-item.is-going {color: #333;} @@ -85,9 +85,9 @@

          project->ongoingStage;?>

          - -
          '> -
          name; ?>
          + +
          '> +
          name;?>
          From 90a1fea2d82233f7c76af36d9377e751a7a7518e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 13 Apr 2022 13:35:02 +0800 Subject: [PATCH 175/181] * Fix bug #17551. --- module/project/css/create.css | 2 ++ module/project/js/create.js | 3 +++ module/project/lang/en.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/view/create.html.php | 5 +++++ 5 files changed, 12 insertions(+) diff --git a/module/project/css/create.css b/module/project/css/create.css index 20acbd1503..a72bc0cafb 100644 --- a/module/project/css/create.css +++ b/module/project/css/create.css @@ -15,3 +15,5 @@ #productsBox a {border-radius: 2px !important;} #productsBox .addProduct {padding-left: 0px !important;} #productsBox > .required:after{right: -6px !important;} +#productsBox .productTip {width: 80px; position: absolute; left: 350px; bottom: 6px;} +#productsBox .required > .productTip {left: 360px;} diff --git a/module/project/js/create.js b/module/project/js/create.js index cf21ccf145..9c44afbbac 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -177,12 +177,15 @@ function loadBranches(product, branchID) var length = $('#productsBox .row .input-group').size(); var $html = $('#productsBox .row .col-sm-4:last').html(); $('#productsBox .row .col-sm-4:last').find('.input-group-addon').remove(); + $('#productsBox .row .productTip').remove(); $('#productsBox .row').append('
          ' + $html + '
          '); if($('#productsBox .row .input-group:last select').size() >= 2) $('#productsBox .row .input-group:last select:last').remove(); $('#productsBox .row .input-group:last .chosen-container').remove(); $('#productsBox .row .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); $('#productsBox .row .input-group:last .chosen').chosen(); + $('[data-toggle="popover"]').popover(); + adjustProductBoxMargin(); } diff --git a/module/project/lang/en.php b/module/project/lang/en.php index a0242864a5..8f30c43aac 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -186,6 +186,7 @@ $lang->project->linkStoryByPlanTips = "This action will associate all {$lang- $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; +$lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->tenThousand = ''; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 691d1e9d91..551d4649ed 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -186,6 +186,7 @@ $lang->project->linkStoryByPlanTips = "此操作会将所选计划下面的{$ $lang->project->createExecution = "该项目下没有{$lang->executionCommon},请先创建{$lang->executionCommon}"; $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->execution->common},是否同时将其移除?(该用户所产生的数据不会受影响。)"; $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?"; +$lang->project->productTip = '点击新建产品后,项目将不会关联已选中的产品。'; $lang->project->tenThousand = '万'; $lang->project->hundredMillion = '亿'; diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 264542bf6c..fa76bf3832 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -126,6 +126,11 @@ project->addProduct, '', "onchange=addNewProduct(this);");?>
          + +
          + +
          +