BUG 7345 Fixed. Multiple Dependent fields solved at grids.

This commit is contained in:
Enrique Ponce De Leon
2011-08-01 17:12:59 -04:00
parent 5ce46a00fe
commit 1d66e9a9a8

View File

@@ -72,6 +72,28 @@
unset($newValues[$sKey]->$aKeys[0]);
}
}
//Next Lines re-build newValues array to send multiple dependent fields merged by row into a grid.
if (sizeof($newValues)>1 && isset($_POST['grid'])){
$fieldBase = array();
foreach ($newValues as $key => $values){
for ($r2=1; $r2 <= $_POST['row']; $r2++){
foreach ($values as $class => $value){
if ($class = $_POST['grid']){
$value = (array) $value;
$arrayK = $value[$r2];
foreach ($arrayK as $key2 => $val) {
$fieldBase[$r2][$key2] = $val[$key2];
}
}
}
}
}
$newValues = array();
//$fieldBase = (array) $fieldBase;
$newValues[0]->$_POST['grid'] = $fieldBase;
}
//Resolve dependencies
//Returns an array ($dependentFields) with the names of the fields
//that depends of fields passed through AJAX ($_GET/$_POST)