diff --git a/db/update21.7.3.sql b/db/update21.7.3.sql index 765945b45a..5bffe4952f 100644 --- a/db/update21.7.3.sql +++ b/db/update21.7.3.sql @@ -87,4 +87,5 @@ CREATE TABLE IF NOT EXISTS `zt_deliverablestage` ( `required` varchar(30) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE UNIQUE INDEX `unique` ON `zt_deliverablestage`(`deliverable`,`stage`); \ No newline at end of file +CREATE UNIQUE INDEX `unique` ON `zt_deliverablestage`(`deliverable`,`stage`); +ALTER TABLE `zt_module` ADD `extra` varchar(30) NOT NULL DEFAULT ''; \ No newline at end of file diff --git a/db/zentao.sql b/db/zentao.sql index eb8c7dbd79..72d65c06f4 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1318,6 +1318,7 @@ CREATE TABLE IF NOT EXISTS `zt_module` ( `owner` varchar(30) NOT NULL DEFAULT '', `collector` text NULL, `short` varchar(60) NOT NULL DEFAULT '', + `extra` varchar(30) NOT NULL DEFAULT '', `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; @@ -13588,23 +13589,23 @@ REPLACE INTO `zt_workflowrule`(`type`, `name`, `rule`, `createdBy`, `createdDate ('system','电话','phone','admin','2020-10-14 14:06:14'), ('system','IP','ip','admin','2020-10-14 14:06:14'); -INSERT INTO `zt_workflowgroup` (`type`, `projectModel`, `projectType`, `name`, `code`, `status`, `vision`, `main`) VALUES -('product', '', 'project', '默认流程', 'productproject', 'normal', 'rnd', '1'), -('project', 'scrum', 'product', '敏捷式产品研发', 'scrumproduct', 'normal', 'rnd', '1'), -('project', 'scrum', 'project', '敏捷式项目研发', 'scrumproject', 'normal', 'rnd', '1'), -('project', 'waterfall', 'product', '瀑布式产品研发', 'waterfallproduct', 'normal', 'rnd', '1'), -('project', 'waterfall', 'project', '瀑布式项目研发', 'waterfallproject', 'normal', 'rnd', '1'), -('project', 'agileplus', 'product', '融合敏捷式产品研发', 'agileplusproduct', 'normal', 'rnd', '1'), -('project', 'agileplus', 'project', '融合敏捷式项目研发', 'agileplusproject', 'normal', 'rnd', '1'), -('project', 'waterfallplus', 'product', '融合瀑布式产品研发', 'waterfallplusproduct', 'normal', 'rnd', '1'), -('project', 'waterfallplus', 'project', '融合瀑布式项目研发', 'waterfallplusproject', 'normal', 'rnd', '1'), -('project', 'kanban', 'product', '看板式产品研发', 'kanbanproduct', 'normal', 'rnd', '1'), -('project', 'kanban', 'project', '看板式项目研发', 'kanbanproject', 'normal', 'rnd', '1'), -('project', 'ipd', 'ipd', 'IPD集成产品研发', 'ipdproduct', 'normal', 'rnd', '1'), -('project', 'ipd', 'tpd', 'IPD预研产品研发', 'tpdproduct', 'normal', 'rnd', '1'), -('project', 'ipd', 'cbb', 'IPD平台产品研发', 'cbbproduct', 'normal', 'rnd', '1'), -('project', 'ipd', 'cpdproduct', 'IPD定制产品研发', 'cpdproduct', 'normal', 'rnd', '1'), -('project', 'ipd', 'cpdproject', 'IPD定制项目研发', 'cpdproject', 'normal', 'rnd', '1'); +INSERT INTO `zt_workflowgroup` (`id`, `type`, `projectModel`, `projectType`, `name`, `code`, `status`, `vision`, `main`) VALUES +('1', 'product', '', 'project', '默认流程', 'productproject', 'normal', 'rnd', '1'), +('2', 'project', 'scrum', 'product', '敏捷式产品研发', 'scrumproduct', 'normal', 'rnd', '1'), +('3', 'project', 'scrum', 'project', '敏捷式项目研发', 'scrumproject', 'normal', 'rnd', '1'), +('4', 'project', 'waterfall', 'product', '瀑布式产品研发', 'waterfallproduct', 'normal', 'rnd', '1'), +('5', 'project', 'waterfall', 'project', '瀑布式项目研发', 'waterfallproject', 'normal', 'rnd', '1'), +('6', 'project', 'agileplus', 'product', '融合敏捷式产品研发', 'agileplusproduct', 'normal', 'rnd', '1'), +('7', 'project', 'agileplus', 'project', '融合敏捷式项目研发', 'agileplusproject', 'normal', 'rnd', '1'), +('8', 'project', 'waterfallplus', 'product', '融合瀑布式产品研发', 'waterfallplusproduct', 'normal', 'rnd', '1'), +('9', 'project', 'waterfallplus', 'project', '融合瀑布式项目研发', 'waterfallplusproject', 'normal', 'rnd', '1'), +('10', 'project', 'kanban', 'product', '看板式产品研发', 'kanbanproduct', 'normal', 'rnd', '1'), +('11', 'project', 'kanban', 'project', '看板式项目研发', 'kanbanproject', 'normal', 'rnd', '1'), +('12', 'project', 'ipd', 'ipd', 'IPD集成产品研发', 'ipdproduct', 'normal', 'rnd', '1'), +('13', 'project', 'ipd', 'tpd', 'IPD预研产品研发', 'tpdproduct', 'normal', 'rnd', '1'), +('14', 'project', 'ipd', 'cbb', 'IPD平台产品研发', 'cbbproduct', 'normal', 'rnd', '1'), +('15', 'project', 'ipd', 'cpdproduct', 'IPD定制产品研发', 'cpdproduct', 'normal', 'rnd', '1'), +('16', 'project', 'ipd', 'cpdproject', 'IPD定制项目研发', 'cpdproject', 'normal', 'rnd', '1'); INSERT INTO `zt_workflowdatasource` (`type`, `name`, `code`, `buildin`, `vision`, `createdBy`, `createdDate`, `datasource`, `view`, `keyField`, `valueField`) VALUES ('system', '产品', 'products', '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"product\",\"method\":\"getPairs\",\"methodDesc\":\"Get product pairs.\",\"params\":[{\"name\":\"mode\",\"type\":\"string\",\"desc\":\"\",\"value\":\"all\"}]}', '', '', ''), @@ -15671,7 +15672,16 @@ INSERT INTO `zt_module`(`id`, `root`, `branch`, `name`, `parent`, `path`, `grade (99, 3, 0, '组织', 0, ',99,', 1, 40, 'pivot', 0, 'system', 'staff', '', '0'), (100, 3, 0, 'Bug', 98, ',98,100,', 2, 10, 'pivot', 0, '', NULL, '', '0'), (102, 1, 0, 'DevOps', 0, ',102,', 1, 50, 'chart', 0, '', NULL, '', '0'), -(103, 1, 0, 'DevOps', 102, ',102,103,', 2, 10, 'chart', 0, '', NULL, '', '0'); +(103, 1, 0, 'DevOps', 102, ',102,103,', 2, 10, 'chart', 0, '', NULL, '', '0'), +(104, 4, 0, '设计类', 0, ',104,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(105, 5, 0, '设计类', 0, ',105,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(106, 8, 0, '设计类', 0, ',106,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(107, 9, 0, '设计类', 0, ',107,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(108, 12, 0, '设计类', 0, ',108,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(109, 13, 0, '设计类', 0, ',109,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(110, 14, 0, '设计类', 0, ',110,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(111, 15, 0, '设计类', 0, ',111,', 1, 10, 'deliverable', 0, '', NULL, '', '0'), +(112, 16, 0, '设计类', 0, ',112,', 1, 10, 'deliverable', 0, '', NULL, '', '0'); -- DROP TABLE IF EXISTS `zt_space`; CREATE TABLE IF NOT EXISTS `zt_space` ( diff --git a/module/design/zen.php b/module/design/zen.php index 7a4c4a0001..6ed121d4e0 100644 --- a/module/design/zen.php +++ b/module/design/zen.php @@ -36,7 +36,7 @@ class designZen extends control $count = 1; foreach(array_filter($this->lang->design->{$typeList}) as $key => $value) { - $key = strtolower($key); + $key = strtolower((string)$key); $exclude = $type == $key ? '' : 'design'; $alias = $type == $key ? $this->app->rawMethod : ''; diff --git a/module/tree/model.php b/module/tree/model.php index 56f9eba39b..6a2427c7c1 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -87,7 +87,7 @@ class treeModel extends model } if($this->isMergeModule($rootID, $type)) { - return $this->dao->select('id, name, root, branch, grade, path, parent, owner, type')->from(TABLE_MODULE) + return $this->dao->select('id, name, root, branch, grade, path, parent, owner, type, extra')->from(TABLE_MODULE) ->where('root')->eq((int)$rootID) ->beginIF($type == 'task')->andWhere('type')->eq('task')->fi() ->beginIF($type != 'task')->andWhere('type')->in("story,$type")->fi() @@ -1255,6 +1255,7 @@ class treeModel extends model $data->parent = (string)$module->parent; $data->name = $module->name; $data->url = helper::createLink('deliverable', 'browse', "groupID={$module->root}&browseType={$extra}¶m={$module->id}"); + $data->extra = $module->extra; return $data; } diff --git a/module/tree/test/model/buildmenuquery.php b/module/tree/test/model/buildmenuquery.php index 9b8f214c13..eb4e7db2d6 100755 --- a/module/tree/test/model/buildmenuquery.php +++ b/module/tree/test/model/buildmenuquery.php @@ -17,11 +17,11 @@ cid=0 - 测试查询root 43 type story 的查询语句 @SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '43' AND ( `type` = 'story') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order` -- 测试查询root 101 type task 的查询语句 @SELECT id, name, root, branch, grade, path, parent, owner, type FROM `zt_module` WHERE `root` = '101' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc +- 测试查询root 101 type task 的查询语句 @SELECT id, name, root, branch, grade, path, parent, owner, type, extra FROM `zt_module` WHERE `root` = '101' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc -- 测试查询root 102 type task 的查询语句 @SELECT id, name, root, branch, grade, path, parent, owner, type FROM `zt_module` WHERE `root` = '102' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc +- 测试查询root 102 type task 的查询语句 @SELECT id, name, root, branch, grade, path, parent, owner, type, extra FROM `zt_module` WHERE `root` = '102' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc -- 测试查询root 103 type task 的查询语句 @SELECT id, name, root, branch, grade, path, parent, owner, type FROM `zt_module` WHERE `root` = '103' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc +- 测试查询root 103 type task 的查询语句 @SELECT id, name, root, branch, grade, path, parent, owner, type, extra FROM `zt_module` WHERE `root` = '103' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc - 测试查询root 41 type story startModule 1821的查询语句 @SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '41' AND ( `type` = 'story') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order` @@ -49,8 +49,8 @@ r($tree->buildMenuQueryTest($root[2], $type[0])) && p( r($tree->buildMenuQueryTest($root[3], $type[0])) && p() && e("SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '41' AND ( `type` = 'story') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order`"); // 测试查询root 41 type story 的查询语句 r($tree->buildMenuQueryTest($root[4], $type[0])) && p() && e("SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '42' AND ( `type` = 'story') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order`"); // 测试查询root 42 type story 的查询语句 r($tree->buildMenuQueryTest($root[5], $type[0])) && p() && e("SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '43' AND ( `type` = 'story') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order`"); // 测试查询root 43 type story 的查询语句 -r($tree->buildMenuQueryTest($root[6], $type[1])) && p() && e("SELECT id, name, root, branch, grade, path, parent, owner, type FROM `zt_module` WHERE `root` = '101' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc"); // 测试查询root 101 type task 的查询语句 -r($tree->buildMenuQueryTest($root[7], $type[1])) && p() && e("SELECT id, name, root, branch, grade, path, parent, owner, type FROM `zt_module` WHERE `root` = '102' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc"); // 测试查询root 102 type task 的查询语句 -r($tree->buildMenuQueryTest($root[8], $type[1])) && p() && e("SELECT id, name, root, branch, grade, path, parent, owner, type FROM `zt_module` WHERE `root` = '103' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc"); // 测试查询root 103 type task 的查询语句 +r($tree->buildMenuQueryTest($root[6], $type[1])) && p() && e("SELECT id, name, root, branch, grade, path, parent, owner, type, extra FROM `zt_module` WHERE `root` = '101' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc"); // 测试查询root 101 type task 的查询语句 +r($tree->buildMenuQueryTest($root[7], $type[1])) && p() && e("SELECT id, name, root, branch, grade, path, parent, owner, type, extra FROM `zt_module` WHERE `root` = '102' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc"); // 测试查询root 102 type task 的查询语句 +r($tree->buildMenuQueryTest($root[8], $type[1])) && p() && e("SELECT id, name, root, branch, grade, path, parent, owner, type, extra FROM `zt_module` WHERE `root` = '103' AND `type` = 'task' AND `deleted` = '0' ORDER BY `grade` desc,`order`,`type` desc"); // 测试查询root 103 type task 的查询语句 r($tree->buildMenuQueryTest($root[3], $type[0], $startModule[0])) && p() && e("SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '41' AND ( `type` = 'story') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order`"); // 测试查询root 41 type story startModule 1821的查询语句 r($tree->buildMenuQueryTest($root[3], $type[0], $startModule[1], $branch)) && p() && e("SELECT * FROM `zt_module` WHERE 1=1 AND `root` = '41' AND ( `type` = 'story') AND (branch = '0' OR `branch` = '1') AND `deleted` = '0' ORDER BY `root`,`grade` desc,`order`"); // 测试查询root 41 type story startModule 0 branch 1 的查询语句 diff --git a/module/upgrade/config/upgradeflow.php b/module/upgrade/config/upgradeflow.php index 70e8b8e2c4..02dc5dd114 100644 --- a/module/upgrade/config/upgradeflow.php +++ b/module/upgrade/config/upgradeflow.php @@ -112,6 +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' => 'addDefaultDeliverableModule'); if(!empty($config->isINT)) { diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 6c9dc7e161..b5ef31e36c 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -11196,4 +11196,40 @@ class upgradeModel extends model return array('blockTitle' => $blockTitle, 'exportUrl' => $exportUrl, 'fetcherUrl' => $fetcherUrl); } + + /** + * 为指定模型的项目流程内置默认设计类。 + * Add default deliverable module. + * + * @access public + * @return void + */ + public function addDefaultDeliverableModule() + { + $this->app->loadLang('deliverable'); + $modelList = array('waterfall', 'waterfallplus', 'ipd'); + $groupList = $this->dao->select('*')->from(TABLE_WORKFLOWGROUP)->where('projectModel')->in($modelList)->fetchAll(); + foreach($groupList as $group) + { + $module = new stdclass(); + $module->root = $group->id; + $module->branch = '0'; + $module->name = $this->lang->deliverable->designModule; + $module->parent = '0'; + $module->path = ''; + $module->grade = '1'; + $module->order = '0'; + $module->type = 'deliverable'; + $module->from = '0'; + $module->owner = ''; + $module->collector = null; + $module->short = ''; + $module->extra = 'design'; + $module->deleted = '0'; + $this->dao->insert(TABLE_MODULE)->data($module)->exec(); + + $moduleID = $this->dao->lastInsertID(); + $this->dao->update(TABLE_MODULE)->set('path')->eq(",$moduleID,")->where('id')->eq($moduleID)->exec(); + } + } }