From fdbc289b3c4048b50b79541dba2b7ef0d0226e7e Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Thu, 3 Jul 2014 15:42:28 -0400 Subject: [PATCH] BUG 15243 "Email Notification from Subprocess" SOLVED - Email Notification from Subprocess. - Problema resuelto, cuando se tiene un subproceso que tiene notificacion en la ultima tarea y este debe retornar al proceso principal, entonces la notificacion se enviara al usuario del proceso principal. --- workflow/engine/classes/class.case.php | 2 +- workflow/engine/classes/class.derivation.php | 30 +++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index c3c2cb5ba..8285ba92d 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -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 diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 6169bf251..0d4919dfe 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -854,24 +854,26 @@ class Derivation ); $this->derivate( $currentDelegation2, $nextDelegations2 ); - // Send notifications - Start - $oUser = new Users(); + if($delIndex > 0 ) { + // Send notifications - Start + $oUser = new Users(); + $aUser = $oUser->load($appFields["CURRENT_USER_UID"]); - $aUser = $oUser->load($appFields["APP_DATA"]["USER_LOGGED"]); - $sFromName = $aUser["USR_FIRSTNAME"] . " " . $aUser["USR_LASTNAME"] . ($aUser["USR_EMAIL"] != "" ? " <" . $aUser["USR_EMAIL"] . ">" : ""); + $sFromName = $aUser["USR_FIRSTNAME"] . " " . $aUser["USR_LASTNAME"] . ($aUser["USR_EMAIL"] != "" ? " <" . $aUser["USR_EMAIL"] . ">" : ""); - try { - $oCase->sendNotifications($appFields["APP_DATA"]["TASK"], - $nextDelegations2, - $appFields["APP_DATA"], - $sApplicationUID, - $delIndex, - $sFromName); + 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%"); + } catch (Exception $e) { + G::SendTemporalMessage(G::loadTranslation("ID_NOTIFICATION_ERROR") . " - " . $e->getMessage(), "warning", "string", null, "100%"); + } + // Send notifications - End } - // Send notifications - End } } }