. * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. * */ /** * this file is a fix to a dependency bug it was just a minor improvement, * also the functionality of dependent fields in grids doesn't depends in this * file so this is somewhat expendable. * */ function subDependencies( $k , &$G_FORM , &$aux, $grid = '') { $myDependentFields = ''; if (array_search( $k, $aux )!==FALSE) return array(); if ($grid == '') { if (!array_key_exists( $k , $G_FORM->fields )) return array(); if (!isset($G_FORM->fields[$k]->dependentFields)) return array(); $aux[] = $k; $mydependentFields = $G_FORM->fields[$k]->dependentFields; } else { if (!array_key_exists( $k , $G_FORM->fields[$grid]->fields )) return array(); if (!isset($G_FORM->fields[$grid]->fields[$k]->dependentFields)) return array(); $myDependentFields = $G_FORM->fields[$grid]->fields[$k]->dependentFields; $myDependentFields = explode( ',', $G_FORM->fields[$grid]->fields[$k]->dependentFields); } return $myDependentFields; } if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response; $sDynUid = G::getUIDName(urlDecode($_POST['DYN_UID'])); $json=new Services_JSON(); $formValues=($json->decode($_POST['fields'])); $sFieldName = $_POST['fieldName']; $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) { $newValue = (array)$newValue; $aKeys = array_keys($newValue); $aValues = array(); for ($i = 1; $i <= ($_POST['row'] - 1); $i++) { $aValues[$i] = array($aKeys[0] => ''); } $aValues[$_POST['row']] = array($aKeys[0] => $newValue[$aKeys[0]]); $newValues[$sKey]->$_POST['grid'] = $aValues; unset($newValues[$sKey]->$aKeys[0]); //echo "
";
//echo "";
}
}
$dependentFields = array();
$aux = array();
$found =false;
for($r=0;$r