From 2fca1f429b959b76ca842beaf9ebbfd185295ece Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 21 Feb 2017 16:36:51 -0400 Subject: [PATCH 1/2] HOR-2762 --- workflow/engine/classes/class.case.php | 11 ++++++----- workflow/engine/classes/class.derivation.php | 11 ++++++++--- workflow/engine/classes/model/ListInbox.php | 15 ++++++++++++++- workflow/engine/classes/model/ListUnassigned.php | 2 +- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index fd49b293b..b6b6bace8 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -2015,7 +2015,7 @@ class Cases * @return Fields */ - public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array()) + public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false) { if ($sTasUid != '') { try { @@ -2125,15 +2125,16 @@ class Cases if(!$isSubprocess){ $Fields['APP_STATUS'] = 'DRAFT'; } + $inbox = new ListInbox(); - $inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication); + $inbox->newRow($Fields, $sUsrUid, $isSelfService); //Multiple Instance foreach($aUserFields as $rowUser){ $Fields["USR_UID"] = $rowUser["USR_UID"]; $Fields["DEL_INDEX"] = $rowUser["DEL_INDEX"]; $inbox = new ListInbox(); - $inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication); + $inbox->newRow($Fields, $sUsrUid, $isSelfService); } /*----------------------------------********---------------------------------*/ } catch (exception $e) { @@ -4433,11 +4434,11 @@ class Cases /*----------------------------------********---------------------------------*/ $this->getExecuteTriggerProcess($sApplicationUID, 'REASSIGNED'); - + //Delete record of the table LIST_UNASSIGNED $unassigned = new ListUnassigned(); $unassigned->remove($sApplicationUID, $iDelegation); - + return true; } diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 9b6975e59..7b90d1591 100644 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -822,7 +822,7 @@ class Derivation $arrayApplicationData2["REMOVED_LIST"] = $removeList; $inbox = new ListInbox(); - $inbox->newRow($arrayApplicationData2, $arrayApplicationData["CURRENT_USER_UID"], false, array(), (($arrayNextDelegationData["TAS_ASSIGN_TYPE"] == "SELF_SERVICE")? true : false)); + $inbox->newRow($arrayApplicationData2, $arrayApplicationData["CURRENT_USER_UID"], (($arrayNextDelegationData["TAS_ASSIGN_TYPE"] == "SELF_SERVICE")? true : false)); } } } @@ -1405,9 +1405,14 @@ class Derivation //if there are subprocess to create if (isset( $aSP )) { + //Check if is Selfservice the task in the subprocess + $isSelfservice = false; + if(empty($aSP['USR_UID'])){ + $isSelfservice = true; + } //Create the new case in the sub-process - // set the initial date to null the time its created - $aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields); + //Set the initial date to null the time its created + $aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields, $isSelfservice); $taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process diff --git a/workflow/engine/classes/model/ListInbox.php b/workflow/engine/classes/model/ListInbox.php index b944dc776..c165d816d 100644 --- a/workflow/engine/classes/model/ListInbox.php +++ b/workflow/engine/classes/model/ListInbox.php @@ -216,7 +216,20 @@ class ListInbox extends BaseListInbox } } - public function newRow ($data, $delPreviusUsrUid, $isInitSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false) + /** + * Define the variables before created the row + * + * This method is used before create the new data + * we completed the information about some variables + * for create the record + * + * @param array $data + * @param string $delPreviusUsrUid Uid from the user previous + * @param boolean $isSelfService this value define if the case is Unassigned + * @return void + * + */ + public function newRow ($data, $delPreviusUsrUid, $isSelfService = false) { $removeList = true; if (isset($data['REMOVED_LIST'])) { diff --git a/workflow/engine/classes/model/ListUnassigned.php b/workflow/engine/classes/model/ListUnassigned.php index 0b0f01157..53abab8a4 100644 --- a/workflow/engine/classes/model/ListUnassigned.php +++ b/workflow/engine/classes/model/ListUnassigned.php @@ -99,7 +99,7 @@ class ListUnassigned extends BaseListUnassigned public function newRow ($data, $delPreviusUsrUid) { $data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid; - $data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE']; + $data['DEL_DUE_DATE'] = isset($data['DEL_TASK_DUE_DATE']) ? $data['DEL_TASK_DUE_DATE'] : ''; $criteria = new Criteria(); $criteria->addSelectColumn( ApplicationPeer::APP_NUMBER ); From e520f3a0963d1bd9953827b588cb4beb3b95729d Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 21 Feb 2017 17:57:32 -0400 Subject: [PATCH 2/2] CS --- workflow/engine/classes/class.derivation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 7b90d1591..f604b3a76 100644 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -1407,7 +1407,7 @@ class Derivation if (isset( $aSP )) { //Check if is Selfservice the task in the subprocess $isSelfservice = false; - if(empty($aSP['USR_UID'])){ + if (empty($aSP['USR_UID'])) { $isSelfservice = true; } //Create the new case in the sub-process