diff --git a/db/update21.0.sql b/db/update21.0.sql index d40fc79b6e..c4d2ed649a 100644 --- a/db/update21.0.sql +++ b/db/update21.0.sql @@ -39,6 +39,9 @@ REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`, ` ('zh-tw', 'custom', 'relationList', '3', '{\"relation\":\"\\u91cd\\u8907\",\"relativeRelation\":\"\\u91cd\\u8907\"}', '0', 'all'), ('zh-tw', 'custom', 'relationList', '4', '{\"relation\":\"\\u5f15\\u7528\",\"relativeRelation\":\"\\u88ab\\u5f15\\u7528\"}', '0', 'all'); +INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`) VALUES +('0', '2', '*', '*', '*', 'moduleName=upgrade&methodName=ajaxProcessObjectRelation', '更新关联关系', 'zentao', 1, 'normal'); + UPDATE `zt_action` SET `action` = 'canceled' WHERE `objectType` = 'deploy' AND `action` = 'activated'; DROP TABLE IF EXISTS `zt_account`; diff --git a/module/upgrade/config/upgradeflow.php b/module/upgrade/config/upgradeflow.php index 2bac694c09..fcb21144d1 100644 --- a/module/upgrade/config/upgradeflow.php +++ b/module/upgrade/config/upgradeflow.php @@ -137,7 +137,6 @@ if($config->edition != 'open') $config->upgrade->execFlow['18_3']['functions'] .= ',processDataset,processChart,processReport,processDashboard'; $config->upgrade->execFlow['18_4_beta1']['functions'] = 'processDeployStepAction,updateBISQL,updatePivotStage'; $config->upgrade->execFlow['20_4']['functions'] .= ',updateTaskRelationPriv'; - $config->upgrade->execFlow['21_0'] = array('functions' => 'processObjectRelation'); } if(in_array($this->config->edition, array('max', 'ipd'))) $config->upgrade->execFlow['18_7']['functions'] = 'processOldMetrics,processHistoryDataForMetric,metric-updateMetricDate'; diff --git a/module/upgrade/control.php b/module/upgrade/control.php index bc26e141d4..8ef7782406 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -820,4 +820,17 @@ class upgrade extends control $check = $this->loadModel('bi')->checkDuckdbInstall(); echo(json_encode($check)); } + + + /** + * 定时任务:处理内置关联关系。 + * AJAX: Process object relation. + * + * @access public + * @return void + */ + public function ajaxProcessObjectRelation() + { + $this->upgrade->processObjectRelation(); + } } diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 299b49229f..a1b842ae0c 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -10083,6 +10083,8 @@ class upgradeModel extends model */ public function processObjectRelation() { + if($this->config->edition == 'open') return true; + /* Process story link story. */ $linkedtoStories = $this->dao->select('*')->from(TABLE_RELATION) ->where('AType')->in('story,requirement,epic') @@ -10392,6 +10394,15 @@ class upgradeModel extends model $relation->BID = $childDemandID; $this->dao->replace(TABLE_RELATION)->data($relation)->exec(); } + + if(!dao::isError()) + { + $this->dao->delete()->from(TABLE_CRON) + ->where('`command`')->eq('moduleName=upgrade&methodName=ajaxProcessObjectRelation') + ->andWhere('type')->eq('zentao') + ->andWhere('status')->eq('normal') + ->exec(); + } return true; }