Merged in bugfix/HOR-2762 (pull request #5454)

HOR-2762

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Paula Quispe
2017-02-22 20:42:53 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 29 additions and 10 deletions

View File

@@ -2015,7 +2015,7 @@ class Cases
* @return Fields * @return Fields
*/ */
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array()) public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
{ {
if ($sTasUid != '') { if ($sTasUid != '') {
try { try {
@@ -2125,15 +2125,16 @@ class Cases
if(!$isSubprocess){ if(!$isSubprocess){
$Fields['APP_STATUS'] = 'DRAFT'; $Fields['APP_STATUS'] = 'DRAFT';
} }
$inbox = new ListInbox(); $inbox = new ListInbox();
$inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication); $inbox->newRow($Fields, $sUsrUid, $isSelfService);
//Multiple Instance //Multiple Instance
foreach($aUserFields as $rowUser){ foreach($aUserFields as $rowUser){
$Fields["USR_UID"] = $rowUser["USR_UID"]; $Fields["USR_UID"] = $rowUser["USR_UID"];
$Fields["DEL_INDEX"] = $rowUser["DEL_INDEX"]; $Fields["DEL_INDEX"] = $rowUser["DEL_INDEX"];
$inbox = new ListInbox(); $inbox = new ListInbox();
$inbox->newRow($Fields, $sUsrUid, $isSubprocess, $dataPreviusApplication); $inbox->newRow($Fields, $sUsrUid, $isSelfService);
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
} catch (exception $e) { } catch (exception $e) {

View File

@@ -822,7 +822,7 @@ class Derivation
$arrayApplicationData2["REMOVED_LIST"] = $removeList; $arrayApplicationData2["REMOVED_LIST"] = $removeList;
$inbox = new ListInbox(); $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 there are subprocess to create
if (isset( $aSP )) { 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 //Create the new case in the sub-process
// set the initial date to null the time its created //Set the initial date to null the time its created
$aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields); $aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields, $isSelfservice);
$taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process $taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process

View File

@@ -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; $removeList = true;
if (isset($data['REMOVED_LIST'])) { if (isset($data['REMOVED_LIST'])) {

View File

@@ -99,7 +99,7 @@ class ListUnassigned extends BaseListUnassigned
public function newRow ($data, $delPreviusUsrUid) public function newRow ($data, $delPreviusUsrUid)
{ {
$data['DEL_PREVIOUS_USR_UID'] = $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 = new Criteria();
$criteria->addSelectColumn( ApplicationPeer::APP_NUMBER ); $criteria->addSelectColumn( ApplicationPeer::APP_NUMBER );