* Update defalut likages for approval review.
This commit is contained in:
@@ -679,6 +679,7 @@ class upgradeModel extends model
|
||||
$this->processCreatedBy();
|
||||
$this->updateApproval();
|
||||
$this->addDefaultRuleToWorkflow();
|
||||
$this->processReviewLinkages();
|
||||
$this->addFlowActions('biz7.3');
|
||||
$this->addFlowFields('biz7.3');
|
||||
break;
|
||||
@@ -6981,4 +6982,39 @@ class upgradeModel extends model
|
||||
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process review linkages of approval.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function processReviewLinkages()
|
||||
{
|
||||
$linkagePairs = $this->dao->select('id, linkages')->from(TABLE_WORKFLOWACTION)->where('action')->eq('approvalreview')->andWhere('role')->eq('approval')->fetchPairs();
|
||||
|
||||
$oldLinkages = array();
|
||||
$oldLinkages[0]['sources'][0]['field'] = 'reviewResult';
|
||||
$oldLinkages[0]['sources'][0]['operator'] = '==';
|
||||
$oldLinkages[0]['sources'][0]['value'] = 'reject';
|
||||
$oldLinkages[0]['targets'][0]['field'] = 'reviewOpinion';
|
||||
$oldLinkages[0]['targets'][0]['status'] = 'show';
|
||||
|
||||
$newLinkages = array();
|
||||
$newLinkages[0]['sources'][0]['field'] = 'reviewResult';
|
||||
$newLinkages[0]['sources'][0]['operator'] = '==';
|
||||
$newLinkages[0]['sources'][0]['value'] = 'pass';
|
||||
$newLinkages[0]['targets'][0]['field'] = 'reviewOpinion';
|
||||
$newLinkages[0]['targets'][0]['status'] = 'hide';
|
||||
|
||||
foreach($linkagePairs as $id => $linkages)
|
||||
{
|
||||
if(helper::jsonEncode($oldLinkages) == $linkages)
|
||||
{
|
||||
$this->dao->update(TABLE_WORKFLOWACTION)->set('linkages')->eq(helper::jsonEncode($newLinkages))->where('id')->eq($id)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
return !dao::isError();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user