Merge remote branch 'upstream/master' into BUG-10747

This commit is contained in:
Hector Cortez
2013-02-19 13:35:28 -04:00
5 changed files with 23 additions and 3 deletions

View File

@@ -610,6 +610,9 @@ class Form extends XmlForm
if (in_array( $dataFieldName, $grids )) {
foreach ($dataField as $indexGrid => $dataGrid) {
foreach ($dataGrid as $fieldGridName => $fieldGridValue) {
if (!isset($requiredFieldsGrids[$dataFieldName])) {
$requiredFieldsGrids[$dataFieldName] = array();
}
if (! is_array( $requiredFieldsGrids[$dataFieldName] )) {
$requiredFieldsGrids[$dataFieldName] = array ();
}

View File

@@ -897,7 +897,7 @@ class Cases
}
}
} else {
$aReturn[$mKey] = $aArray2[$mKey];
$aReturn[$mKey] = isset($aArray2[$mKey]) ? $aArray2[$mKey] : null;
}
}
return $aReturn;

View File

@@ -84,6 +84,9 @@ class Derivation
$taskInfo = array ();
$oUser = new Users();
if (!class_exists('Cases')) {
G::LoadClass('case');
}
$this->case = new Cases();
// 1. there is no rule
if (is_null( $aDerivation['ROU_NEXT_TASK'] )) {

View File

@@ -2395,7 +2395,7 @@ function PMFRedirectToStep ($sApplicationUID, $iDelegation, $sStepType, $sStepUi
* @return array | $array | List of users | Return a list of users
*
*/
function PMFGetNextAssignedUser ($application, $task)
function PMFGetNextAssignedUser ($application, $task, $delIndex = null, $userUid = null)
{
require_once 'classes/model/AppDelegation.php';
@@ -2409,7 +2409,14 @@ function PMFGetNextAssignedUser ($application, $task)
$TaskFields = $oTask->load( $task );
$typeTask = $TaskFields['TAS_ASSIGN_TYPE'];
if ($typeTask == 'BALANCED') {
$g = new G();
$g->sessionVarSave();
$_SESSION['INDEX'] = (!is_null($delIndex) ? $delIndex : (isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : null));
$_SESSION['USER_LOGGED'] = (!is_null($userUid) ? $userUid : (isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null));
if ($typeTask == 'BALANCED' && !is_null($_SESSION['INDEX']) && !is_null($_SESSION['USER_LOGGED'])) {
G::LoadClass( 'derivation' );
$oDerivation = new Derivation();
@@ -2423,6 +2430,8 @@ function PMFGetNextAssignedUser ($application, $task)
$aUsers[] = $aUser;
}
$g->sessionVarRestore();
if (count( $aUsers ) == 1) {
return $aUser;
} else {
@@ -2430,6 +2439,7 @@ function PMFGetNextAssignedUser ($application, $task)
}
} else {
$g->sessionVarRestore();
return false;
}
}

View File

@@ -29,6 +29,10 @@
/* Includes */
G::LoadClass( 'case' );
if (!is_array($_POST['form'])) {
$_POST['form'] = array();
}
//load the variables
$oCase = new Cases();
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs' );