Merge pull request #2491 from luisfernandosl/BUG-15243
BUG 15243 "Email Notification from Subprocess" SOLVED
This commit is contained in:
@@ -3970,7 +3970,7 @@ class Cases
|
||||
if (SubApplicationPeer::doCount($oCriteria2) > 0) {
|
||||
G::LoadClass('derivation');
|
||||
$oDerivation = new Derivation();
|
||||
$oDerivation->verifyIsCaseChild($sApplicationUID);
|
||||
$oDerivation->verifyIsCaseChild($sApplicationUID, $iIndex);
|
||||
}
|
||||
|
||||
//update searchindex
|
||||
|
||||
@@ -638,7 +638,7 @@ class Derivation
|
||||
//Close case
|
||||
$appFields["APP_STATUS"] = "COMPLETED";
|
||||
$appFields["APP_FINISH_DATE"] = "now";
|
||||
$this->verifyIsCaseChild( $currentDelegation["APP_UID"] );
|
||||
$this->verifyIsCaseChild($currentDelegation["APP_UID"], $currentDelegation["DEL_INDEX"]);
|
||||
|
||||
$sw = 1;
|
||||
}
|
||||
@@ -793,7 +793,7 @@ class Derivation
|
||||
* @param string $sApplicationUID
|
||||
* @return void
|
||||
*/
|
||||
function verifyIsCaseChild ($sApplicationUID)
|
||||
function verifyIsCaseChild ($sApplicationUID, $delIndex = 0)
|
||||
{
|
||||
//Obtain the related row in the table SUB_APPLICATION
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -814,7 +814,7 @@ class Derivation
|
||||
$oDataset->next();
|
||||
$aSP = $oDataset->getRow();
|
||||
if ($aSP['SP_SYNCHRONOUS'] == 1) {
|
||||
$appFields = $oCase->loadCase( $sApplicationUID );
|
||||
$appFields = $oCase->loadCase($sApplicationUID, $delIndex);
|
||||
//Copy case variables to parent case
|
||||
$aFields = unserialize( $aSP['SP_VARIABLES_IN'] );
|
||||
$aNewFields = array ();
|
||||
@@ -853,6 +853,27 @@ class Derivation
|
||||
$currentDelegation2 = array ('APP_UID' => $aSA['APP_PARENT'],'DEL_INDEX' => $aSA['DEL_INDEX_PARENT'],'APP_STATUS' => 'TO_DO','TAS_UID' => $aParentCase['TAS_UID'],'ROU_TYPE' => $aDeriveTasks[1]['ROU_TYPE']
|
||||
);
|
||||
$this->derivate( $currentDelegation2, $nextDelegations2 );
|
||||
|
||||
if($delIndex > 0 ) {
|
||||
// Send notifications - Start
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load($appFields["CURRENT_USER_UID"]);
|
||||
|
||||
$sFromName = $aUser["USR_FIRSTNAME"] . " " . $aUser["USR_LASTNAME"] . ($aUser["USR_EMAIL"] != "" ? " <" . $aUser["USR_EMAIL"] . ">" : "");
|
||||
|
||||
try {
|
||||
$oCase->sendNotifications($appFields["TAS_UID"],
|
||||
$nextDelegations2,
|
||||
$appFields["APP_DATA"],
|
||||
$sApplicationUID,
|
||||
$delIndex,
|
||||
$sFromName);
|
||||
|
||||
} catch (Exception $e) {
|
||||
G::SendTemporalMessage(G::loadTranslation("ID_NOTIFICATION_ERROR") . " - " . $e->getMessage(), "warning", "string", null, "100%");
|
||||
}
|
||||
// Send notifications - End
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user