BUG 7650 Function PMFRedirectToStep didnt work properly SOLVED
- In the triggers do not run properly because it addresses before saving the data - Data is captured and stored before redirect
This commit is contained in:
@@ -3024,6 +3024,7 @@ class Cases {
|
|||||||
$aTriggers = $this->loadTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType);
|
$aTriggers = $this->loadTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType);
|
||||||
|
|
||||||
if (count($aTriggers) > 0) {
|
if (count($aTriggers) > 0) {
|
||||||
|
global $oPMScript;
|
||||||
$oPMScript = new PMScript();
|
$oPMScript = new PMScript();
|
||||||
$oPMScript->setFields($aFields);
|
$oPMScript->setFields($aFields);
|
||||||
foreach ($aTriggers as $aTrigger) {
|
foreach ($aTriggers as $aTrigger) {
|
||||||
|
|||||||
@@ -1679,6 +1679,7 @@ function PMFgetLabelOption($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTED
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid) {
|
function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid) {
|
||||||
|
$iDelegation = intval($iDelegation);
|
||||||
require_once 'classes/model/AppDelegation.php';
|
require_once 'classes/model/AppDelegation.php';
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||||
@@ -1687,21 +1688,22 @@ function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid
|
|||||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
|
global $oPMScript;
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
if ($aRow) {
|
if ($aRow) {
|
||||||
require_once 'classes/model/Step.php';
|
require_once 'classes/model/Step.php';
|
||||||
$oStep = new Step();
|
$oStep = new Step();
|
||||||
$oTheStep = $oStep->loadByType($aRow['TAS_UID'], $sStepType, $sStepUid);
|
$oTheStep = $oStep->loadByType($aRow['TAS_UID'], $sStepType, $sStepUid);
|
||||||
$bContinue = true;
|
$bContinue = true;
|
||||||
|
G::LoadClass('case');
|
||||||
|
$oCase = new Cases();
|
||||||
|
$aFields = $oCase->loadCase($sApplicationUID);
|
||||||
if ($oTheStep->getStepCondition() != '') {
|
if ($oTheStep->getStepCondition() != '') {
|
||||||
G::LoadClass('case');
|
|
||||||
$oCase = new Cases();
|
|
||||||
$aFields = $oCase->loadCase($sApplicationUID);
|
|
||||||
G::LoadClass('pmScript');
|
G::LoadClass('pmScript');
|
||||||
$oPMScript = new PMScript();
|
$pmScript = new PMScript();
|
||||||
$oPMScript->setFields($aFields['APP_DATA']);
|
$pmScript->setFields($aFields['APP_DATA']);
|
||||||
$oPMScript->setScript($oTheStep->getStepCondition());
|
$pmScript->setScript($oTheStep->getStepCondition());
|
||||||
$bContinue = $oPMScript->evaluate();
|
$bContinue = $pmScript->evaluate();
|
||||||
}
|
}
|
||||||
if ($bContinue) {
|
if ($bContinue) {
|
||||||
switch ($oTheStep->getStepTypeObj()) {
|
switch ($oTheStep->getStepTypeObj()) {
|
||||||
@@ -1721,6 +1723,11 @@ function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid
|
|||||||
$sAction = '';
|
$sAction = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// save data
|
||||||
|
if (!is_null($oPMScript)) {
|
||||||
|
$aFields['APP_DATA'] = $oPMScript->aFields;
|
||||||
|
$oCase->updateCase($sApplicationUID,$aFields);
|
||||||
|
}
|
||||||
G::header('Location: ' . 'cases_Step?TYPE=' . $sStepType . '&UID=' . $sStepUid . '&POSITION=' . $oTheStep->getStepPosition() . '&ACTION=' . $sAction);
|
G::header('Location: ' . 'cases_Step?TYPE=' . $sStepType . '&UID=' . $sStepUid . '&POSITION=' . $oTheStep->getStepPosition() . '&ACTION=' . $sAction);
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user