BUG 7717 7421 -> related to DEL_PREVIOUS from APP_DELEGATION table, FIXED!

- fixed -> blame to girish commit 2e97a8
This commit is contained in:
Erik Amaru Ortiz
2011-09-28 12:41:10 -04:00
parent 377e9a99d9
commit ba32c018ae
3 changed files with 27 additions and 16 deletions

View File

@@ -1393,10 +1393,10 @@ class Cases {
* @return void
*/
function newAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sPrevious, $iPriority, $sDelType, $iAppThreadIndex = 1) {
function newAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sPrevious, $iPriority, $sDelType, $iAppThreadIndex = 1, $nextDel=null) {
try {
$appDel = new AppDelegation();
return $appDel->createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, 3, false, $sPrevious );
return $appDel->createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iPriority, false, $sPrevious, $nextDel);
}
catch (exception $e) {
throw ($e);

View File

@@ -615,12 +615,17 @@ class Derivation
//Incrementing the Del_thread First so that new delegation has new del_thread
$iNewAppThreadIndex += 1;
//Creating new delegation according to users in group
$iMIDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
(isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''),
$currentDelegation['DEL_INDEX'],
$nextDel,
$delType,
$iNewAppThreadIndex);
$iMIDelIndex = $this->case->newAppDelegation(
$appFields['PRO_UID'],
$currentDelegation['APP_UID'],
$nextDel['TAS_UID'],
(isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''),
$currentDelegation['DEL_INDEX'],
3, //$nextDel['DEL_PRIORITY'], <- //TODO check this priority alway is 3
$delType,
$iNewAppThreadIndex,
$nextDel
);
$iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex );
@@ -634,12 +639,17 @@ class Derivation
//No Break, need no execute the default ones....
default:
// Create new delegation
$iNewDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'],
(isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''),
$currentDelegation['DEL_INDEX'],
$nextDel,
$delType,
$iAppThreadIndex);
$iNewDelIndex = $this->case->newAppDelegation(
$appFields['PRO_UID'],
$currentDelegation['APP_UID'],
$nextDel['TAS_UID'],
(isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''),
$currentDelegation['DEL_INDEX'],
3, //$nextDel['DEL_PRIORITY'], <- //TODO check this priority alway is 3
$delType,
$iAppThreadIndex,
$nextDel
);
break;
}
$iAppThreadIndex = $appFields['DEL_THREAD'];

View File

@@ -53,7 +53,8 @@ class AppDelegation extends BaseAppDelegation {
* @param $isSubprocess is a subprocess inside a process?
* @return delegation index of the application delegation.
*/
function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $sNextTasParam=null,$iPriority = 3, $isSubprocess=false ) {
function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null) {
//function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $sNextTasParam=null,$iPriority = 3, $isSubprocess=false ) {
if (!isset($sProUid) || strlen($sProUid) == 0 ) {
throw ( new Exception ( 'Column "PRO_UID" cannot be null.' ) );
@@ -91,7 +92,7 @@ class AppDelegation extends BaseAppDelegation {
$this->setProUid ( $sProUid );
$this->setTasUid ( $sTasUid );
$this->setDelIndex ( $delIndex );
$this->setDelPrevious ( 0 );
$this->setDelPrevious ( $sPrevious == -1 ? 0 : $sPrevious );
$this->setUsrUid ( $sUsrUid );
$this->setDelType ( 'NORMAL' );
$this->setDelPriority ( ($iPriority != '' ? $iPriority : '3') );