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
*/
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;
}

View File

@@ -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

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

View File

@@ -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 );