Merge branch dev/story-78436 of zentao/zentaopms (#11847)
This commit is contained in:
@@ -447,6 +447,7 @@ define('TABLE_DEMANDPOOL', '`' . $config->db->prefix . 'demandpool`');
|
||||
define('TABLE_DEMAND', '`' . $config->db->prefix . 'demand`');
|
||||
define('TABLE_DEMANDSPEC', '`' . $config->db->prefix . 'demandspec`');
|
||||
define('TABLE_DEMANDREVIEW', '`' . $config->db->prefix . 'demandreview`');
|
||||
define('TABLE_DECISION', '`' . $config->db->prefix . 'decision`');
|
||||
define('TABLE_API', '`' . $config->db->prefix . 'api`');
|
||||
define('TABLE_API_SPEC', '`' . $config->db->prefix . 'apispec`');
|
||||
define('TABLE_APISTRUCT', '`' . $config->db->prefix . 'apistruct`');
|
||||
@@ -803,4 +804,4 @@ $config->excludeDropmenuModules = array('reporttemplate');
|
||||
$config->hasSwitcherModules = array('design');
|
||||
$config->hasSwitcherMethods = array('project-bug', 'project-testcase', 'execution-bug', 'execution-testcase', 'testtask-cases', 'testtask-view', 'testtask-report', 'testtask-groupcase', 'testtask-linkcase');
|
||||
$config->excludeSwitcherList = array();
|
||||
$config->hasMainNavBar = array();
|
||||
$config->hasMainNavBar = array();
|
||||
|
||||
@@ -101,3 +101,19 @@ DELETE FROM `zt_workflowgroup` WHERE `projectModel` = 'kanban';
|
||||
UPDATE `zt_project` SET `workflowGroup` = '0' WHERE `model` = 'kanban';
|
||||
|
||||
ALTER TABLE `zt_stage` ADD `workflowGroup` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `id`;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `zt_decision` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`workflowGroup` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`stage` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`type` varchar(30) NOT NULL DEFAULT '',
|
||||
`category` varchar(30) NOT NULL DEFAULT '',
|
||||
`builtin` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`createdBy` char(30) NOT NULL DEFAULT '',
|
||||
`createdDate` datetime NULL,
|
||||
`editedBy` char(30) NOT NULL DEFAULT '',
|
||||
`editedDate` datetime NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
@@ -623,6 +623,23 @@ CREATE TABLE IF NOT EXISTS `zt_deliverablestage` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
CREATE UNIQUE INDEX `unique` ON `zt_deliverablestage`(`deliverable`,`stage`);
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_decision`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_decision` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`workflowGroup` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`stage` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`type` varchar(30) NOT NULL DEFAULT '',
|
||||
`category` varchar(30) NOT NULL DEFAULT '',
|
||||
`builtin` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`createdBy` char(30) NOT NULL DEFAULT '',
|
||||
`createdDate` datetime NULL,
|
||||
`editedBy` char(30) NOT NULL DEFAULT '',
|
||||
`editedDate` datetime NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_dimension`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_dimension` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
|
||||
@@ -12540,6 +12540,60 @@ class upgradeModel extends model
|
||||
$this->dao->exec('ALTER TABLE ' . TABLE_STAGE . ' DROP COLUMN `projectType`');
|
||||
}
|
||||
|
||||
/**
|
||||
* TR和DCP评审对象升级到技术与决策评审流程。
|
||||
* Upgrade TR and DCP objects to decision flows.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function upgradeDecision()
|
||||
{
|
||||
$ipdProjectGroups = $this->dao->select('id')->from(TABLE_WORKFLOWGROUP)->where('type')->eq('project')->andWhere('projectModel')->eq('ipd')->andWhere('builtin')->eq('1')->fetchPairs();
|
||||
$ipdProjectStages = $this->dao->select('id,workflowGroup,type')->from(TABLE_STAGE)->where('projectType')->eq('ipd')->fetchGroup('workflowGroup');
|
||||
|
||||
$object = new stdclass();
|
||||
$object->createdBy = $this->app->user->account;
|
||||
$object->createdDate = helper::now();
|
||||
|
||||
$decisionFlow = new stdclass();
|
||||
$decisionFlow->flow = 1;
|
||||
$decisionFlow->objectType = 'decision';
|
||||
$decisionFlow->relatedBy = $this->app->user->account;
|
||||
$decisionFlow->relatedDate = helper::now();
|
||||
$decisionFlow->extra = 'review';
|
||||
|
||||
foreach($ipdProjectGroups as $ipdProjectGroupID)
|
||||
{
|
||||
if(empty($ipdProjectStages[$ipdProjectGroupID])) continue;
|
||||
|
||||
$object->workflowgroup = $ipdProjectGroupID;
|
||||
|
||||
$decisionFlow->root = $ipdProjectGroupID;
|
||||
|
||||
foreach($ipdProjectStages[$ipdProjectGroupID] as $stages)
|
||||
{
|
||||
foreach($stages as $stage)
|
||||
{
|
||||
$object->stage = $stage->id;
|
||||
|
||||
$stageType = $stage->type;
|
||||
foreach($this->config->review->ipdReviewPoint->$stageType as $category)
|
||||
{
|
||||
$object->title = $this->lang->review->reviewPoint->titleList[$category];
|
||||
$object->type = strpos($category, 'TR') === 0 ? 'TR' : 'DCP';
|
||||
$object->category = $category;
|
||||
$this->dao->insert(TABLE_DECISION)->data($object)->autoCheck()->exec();
|
||||
|
||||
$decisionFlow->objectID = $this->dao->lastInsertID();
|
||||
$this->dao->insert(TABLE_APPROVALFLOWOBJECT)->data($decisionFlow)->autoCheck()->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整 21.7.5 版本的权限
|
||||
* Adjust priv 21.7.5.
|
||||
|
||||
Reference in New Issue
Block a user