* [task#130092,done,1h] add upgrade logic.
This commit is contained in:
@@ -103,6 +103,7 @@ $config->upgrade->execFlow['20_3_0'] = array('functions' => 'importBuildinW
|
||||
$config->upgrade->execFlow['20_4'] = array('functions' => 'createDefaultDoclibSpace,updateStoryVerifiedDate,xuanNotifyJitsiConference', 'xxsqls' => "$appRoot/db/upgradexuanxuan7.3.sql,$appRoot/db/upgradexuanxuan9.0.sql");
|
||||
$config->upgrade->execFlow['20_5'] = array('functions' => 'fixWorkflowFieldOptions');
|
||||
$config->upgrade->execFlow['20_6'] = array('functions' => 'processDemandFiles,processSqlbuilderTables');
|
||||
$config->upgrade->execFlow['20_7_1'] = array('functions' => 'processWorkflowGroups');
|
||||
|
||||
if(!empty($config->isINT))
|
||||
{
|
||||
|
||||
@@ -9994,4 +9994,34 @@ class upgradeModel extends model
|
||||
}
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* 历史产品、项目绑定默认工作流模板。
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processWorkflowGroups()
|
||||
{
|
||||
$workflowGroups = $this->dao->select('code, id')->from(TABLE_WORKFLOWGROUP)->where('main')->eq('1')->fetchPairs();
|
||||
|
||||
foreach($workflowGroups as $code => $groupID)
|
||||
{
|
||||
if($code == 'productproject')
|
||||
{
|
||||
$this->dao->update(TABLE_PRODUCT)->set('workflowGroup')->eq($groupID)->exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('workflowGroup')->eq($groupID)
|
||||
->where('type')->eq('project')
|
||||
->beginIF($code == 'scrumproduct')->andWhere('model')->eq('scrum')->andWhere('hasProduct')->eq('1')->fi()
|
||||
->beginIF($code == 'scrumproject')->andWhere('model')->eq('scrum')->andWhere('hasProduct')->eq('0')->fi()
|
||||
->beginIF($code == 'waterfallproduct')->andWhere('model')->eq('waterfall')->andWhere('hasProduct')->eq('1')->fi()
|
||||
->beginIF($code == 'waterfallproject')->andWhere('model')->eq('waterfall')->andWhere('hasProduct')->eq('0')->fi()
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user