From ec8edf4feb0c8ce392820dd9ab0d012b2b5b821e Mon Sep 17 00:00:00 2001 From: Gustavo Adolfo Cruz Laura Date: Fri, 10 Dec 2010 15:37:07 +0000 Subject: [PATCH] Bug 5673, the issue of dependent fields in a dynaform seems to be related to a session loss problem. --- .../dynaforms/dynaforms_checkDependentFields.php | 15 ++------------- workflow/public_html/sysGeneric.php | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/workflow/engine/methods/dynaforms/dynaforms_checkDependentFields.php b/workflow/engine/methods/dynaforms/dynaforms_checkDependentFields.php index b97233adf..61c370990 100644 --- a/workflow/engine/methods/dynaforms/dynaforms_checkDependentFields.php +++ b/workflow/engine/methods/dynaforms/dynaforms_checkDependentFields.php @@ -50,7 +50,8 @@ } if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response; - +// the script responds an ajax request in order to check the dependent fields, +// and generate a json output of the values that the dependent field must have. $sDynUid = G::getUIDName(urlDecode($_POST['DYN_UID'])); $json=new Services_JSON(); $formValues=($json->decode($_POST['fields'])); @@ -59,13 +60,9 @@ $sMasterField = ''; $sPath = PATH_DYNAFORM; $G_FORM = new form( $sDynUid , $sPath ); $aux = array(); -//g::pr($newValues); $newValues=$json->decode(urlDecode(stripslashes($_POST['form']))); -//g::pr($formValues); if (isset($_POST['grid'])) { -// echo ("is grid"); -// die(); $_POST['row'] = (int)$_POST['row']; $aAux = array(); foreach ($newValues as $sKey => $newValue) { @@ -78,9 +75,6 @@ $newValues=$json->decode(urlDecode(stripslashes($_POST['form']))); $aValues[$_POST['row']] = array($aKeys[0] => $newValue[$aKeys[0]]); $newValues[$sKey]->$_POST['grid'] = $aValues; unset($newValues[$sKey]->$aKeys[0]); - //echo "
";
-
-      //echo "
"; } } @@ -103,9 +97,6 @@ $newValues=$json->decode(urlDecode(stripslashes($_POST['form']))); $_SESSION[$G_FORM->id][$k] = $v; } else { -// echo "-$r-"; -// g::pr($v); -// echo "--"; foreach($v[$_POST['row']] as $k1 => $v1) { $myDependentFields = subDependencies( $k1 , $G_FORM , $aux, $_POST['grid'] ); if(!$found){ @@ -129,6 +120,4 @@ $newValues=$json->decode(urlDecode(stripslashes($_POST['form']))); break; } -//echo "one
"; - ?> diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 00f367bb5..24b9be0ea 100644 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -493,7 +493,7 @@ $startingTime = array_sum(explode(' ',microtime())); and SYS_TARGET != 'autoinstallPlugins' and SYS_TARGET != 'heartbeatStatus' and SYS_COLLECTION != 'services' and SYS_COLLECTION != 'tracker' and $collectionPlugin != 'services' - and $bWE != true and SYS_TARGET != 'defaultAjaxDynaform' and SYS_TARGET != 'cases_ShowDocument') { + and $bWE != true and SYS_TARGET != 'defaultAjaxDynaform' and SYS_TARGET != 'dynaforms_checkDependentFields' and SYS_TARGET != 'cases_ShowDocument') { $bRedirect = true; if (isset($_GET['sid'])) { G::LoadClass('sessions');