* [misc] Add cron task for process object relation.
This commit is contained in:
@@ -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`;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user