diff --git a/db/update22.0.sql b/db/update22.0.sql index 2db03242be..f4d7d64206 100644 --- a/db/update22.0.sql +++ b/db/update22.0.sql @@ -6,6 +6,7 @@ ALTER TABLE `zt_deliverable` ADD `trimRule` varchar(255) NOT NULL AFTER `trimmab ALTER TABLE `zt_deliverable` ADD `template` text NOT NULL AFTER `trimRule`; ALTER TABLE `zt_deliverable` ADD `status` varchar(30) NOT NULL DEFAULT 'enabled' AFTER `name`; ALTER TABLE `zt_deliverable` ADD `category` varchar(255) NOT NULL DEFAULT '' AFTER `lastEditedDate`; +ALTER TABLE `zt_deliverable` ADD `buildin` enum('0','1') NOT NULL DEFAULT '0' AFTER `module`; CREATE TABLE IF NOT EXISTS `zt_deliverablestage` ( `id` int(8) unsigned NOT NULL AUTO_INCREMENT, @@ -58,4 +59,4 @@ UPDATE `zt_lang` SET `value` = '冒烟测试环节' WHERE `module` = 'testcase' UPDATE `zt_lang` SET `value` = '版本验证环节' WHERE `module` = 'testcase' AND `section` = 'stageList' AND `key` = 'bvt' AND `value` = '版本验证阶段'; ALTER TABLE `zt_review` ADD `version` varchar(255) NOT NULL DEFAULT '' AFTER `docVersion`; -ALTER TABLE `zt_review` ADD `deliverable` mediumint(8) NOT NULL DEFAULT '0' AFTER `title`; \ No newline at end of file +ALTER TABLE `zt_review` ADD `deliverable` mediumint(8) NOT NULL DEFAULT '0' AFTER `title`; diff --git a/db/zentao.sql b/db/zentao.sql index 05593e81c0..7914b16134 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -596,6 +596,7 @@ CREATE TABLE `zt_deliverable` ( `id` int(8) unsigned NOT NULL AUTO_INCREMENT, `workflowGroup` int(8) unsigned NOT NULL DEFAULT 0, `module` mediumint(8) unsigned NOT NULL DEFAULT 0, + `buildin` enum('0','1') NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, `status` varchar(30) NOT NULL DEFAULT 'enabled', `activity` int(8) unsigned NOT NULL DEFAULT 0, diff --git a/module/upgrade/config/upgradeflow.php b/module/upgrade/config/upgradeflow.php index b04a6bc30e..530129c7d2 100644 --- a/module/upgrade/config/upgradeflow.php +++ b/module/upgrade/config/upgradeflow.php @@ -112,7 +112,7 @@ $config->upgrade->execFlow['21_6_beta'] = array('functions' => 'processCharter $config->upgrade->execFlow['21_6_1'] = array('xxsqls' => "$appRoot/db/upgradexuanxuan9.1.2.sql"); $config->upgrade->execFlow['21_7'] = array('functions' => 'fixWorkflowNameForExecution'); $config->upgrade->execFlow['21_7_1'] = array('functions' => 'convertCharset,processActionProduct'); -$config->upgrade->execFlow['21_7_3'] = array('functions' => 'upgradeProcessAndActivity,addDefaultDeliverableModule,upgradeDesignToDeliverable,upgradeDeliverable,buildInBaselineReview,upgradeBaselineObjects,upgradeReviewToDeliverable'); +$config->upgrade->execFlow['21_7_3'] = array('functions' => 'upgradeProcessAndActivity,addDefaultDeliverableModule,upgradeDesignToDeliverable,buildinTestcaseStageDeliverable,upgradeDeliverable,buildinBaselineReview,upgradeBaselineObjects,upgradeReviewToDeliverable'); if(!empty($config->isINT)) { diff --git a/module/upgrade/lang/de.php b/module/upgrade/lang/de.php index fb8f6612ef..7a55a40c72 100644 --- a/module/upgrade/lang/de.php +++ b/module/upgrade/lang/de.php @@ -104,6 +104,7 @@ $lang->upgrade->projectName = 'Project Name'; $lang->upgrade->projectManage = 'Project Manage'; $lang->upgrade->compatibleEXT = 'Extension mechanism compatible'; $lang->upgrade->fileName = 'File Name'; +$lang->upgrade->list = ' List'; $lang->upgrade->next = 'Next'; $lang->upgrade->back = 'Back'; diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index 8848dd1873..4bcb2638ed 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -104,6 +104,7 @@ $lang->upgrade->projectName = 'Project Name'; $lang->upgrade->projectManage = 'Project Manage'; $lang->upgrade->compatibleEXT = 'Extension mechanism compatible'; $lang->upgrade->fileName = 'File Name'; +$lang->upgrade->list = ' List'; $lang->upgrade->next = 'Next'; $lang->upgrade->back = 'Back'; diff --git a/module/upgrade/lang/fr.php b/module/upgrade/lang/fr.php index 24c4ee3207..c55ec4f8c3 100644 --- a/module/upgrade/lang/fr.php +++ b/module/upgrade/lang/fr.php @@ -104,6 +104,7 @@ $lang->upgrade->projectName = 'Project Name'; $lang->upgrade->projectManage = 'Project Manage'; $lang->upgrade->compatibleEXT = 'Extension mechanism compatible'; $lang->upgrade->fileName = 'File Name'; +$lang->upgrade->list = ' List'; $lang->upgrade->next = 'Next'; $lang->upgrade->back = 'Back'; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index a500a918be..9c06c43ce9 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -104,6 +104,7 @@ $lang->upgrade->projectName = '项目名称'; $lang->upgrade->projectManage = '项目管理'; $lang->upgrade->compatibleEXT = '扩展机制兼容'; $lang->upgrade->fileName = '文件名称'; +$lang->upgrade->list = '列表'; $lang->upgrade->next = '下一步'; $lang->upgrade->back = '上一步'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index e61c1397b0..8b2a5087e2 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -11311,7 +11311,7 @@ class upgradeModel extends model * @access public * @return int */ - public function addDeliverable(string $name, object $deliverable, object $deliverableStage, array &$nameFilter): int + public function addDeliverable(string $name, object $deliverable, object $deliverableStage, array &$nameFilter = array()): int { /* 重名的交付物名称后面加数字。 */ if(!empty($nameFilter[$name])) @@ -11542,6 +11542,56 @@ class upgradeModel extends model return $activityID; } + /** + * 内置测试环节列表交付物。 + * Buildin testcase stage deliverable. + * + * @access public + * @return void + */ + public function buildinTestcaseStageDeliverable() + { + $this->app->loadLang('testcase'); + $clientLang = $this->app->getClientLang(); + $testcaseStageList = $this->dao->select('`key`, value')->from(TABLE_LANG) + ->where('module')->eq('testcase') + ->andWhere('section')->eq('stageList') + ->andWhere('lang')->in(array($clientLang, 'all')) + ->orderBy('id_asc') + ->fetchPairs(); + + if(empty($typeList)) $testcaseStageList = $this->lang->testcase->stageList; + + $modules = $this->dao->select('root,id')->from(TABLE_MODULE) + ->where('type')->eq('deliverable') + ->andWhere('extra')->eq('test') + ->fetchPairs(); + + $deliverable = new stdClass(); + $deliverable->status = 'enabled'; + $deliverable->createdBy = 'system'; + $deliverable->createdDate = helper::now(); + $deliverable->template = '[]'; + $deliverable->buildin = '1'; + + $deliverableStage = new stdClass(); + $deliverableStage->stage = 'project'; + $deliverableStage->required = '0'; + + $workflows = $this->dao->select('id')->from(TABLE_WORKFLOWGROUP)->where('type')->eq('project')->fetchAll('id'); + foreach($workflows as $workflow) + { + $deliverable->module = zget($modules, $workflow->id, 0); + $deliverable->workflowGroup = $workflow->id; + foreach($testcaseStageList as $key => $name) + { + if(empty($name)) continue; + $deliverable->category = $key; // 标记交付物的类型。 + $this->addDeliverable($name . $this->lang->upgrade->list, $deliverable, $deliverableStage); + } + } + } + /** * 升级项目和迭代的交付物配置。 * Upgrade project deliverable. @@ -11698,12 +11748,12 @@ class upgradeModel extends model /** * 内置基线评审到项目流程中。 - * buildInBaselineReviewFlow + * Buildin baseline review flow. * * @access public * @return void */ - public function buildInBaselineReview() + public function buildinBaselineReview() { $reviewFlow = new stdclass(); $reviewFlow->flow = '1';