BUG 6901 problem fixed.
Some error existing on the code, but it is working now.
This commit is contained in:
@@ -297,10 +297,9 @@ class Form extends XmlForm
|
|||||||
*/
|
*/
|
||||||
function validateArray($newValues)
|
function validateArray($newValues)
|
||||||
{
|
{
|
||||||
//$values = $this->values;
|
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach($this->fields as $k => $v){ //Buque 1
|
foreach($this->fields as $k => $v) {
|
||||||
//echo $v->type.'<br>';
|
|
||||||
if (($v->type != 'submit')) {
|
if (($v->type != 'submit')) {
|
||||||
if ($v->type != 'file') {
|
if ($v->type != 'file') {
|
||||||
if ( array_key_exists($k,$newValues) ) {
|
if ( array_key_exists($k,$newValues) ) {
|
||||||
@@ -309,6 +308,8 @@ class Form extends XmlForm
|
|||||||
$values[$k] = implode('|', $newValues[$k]);
|
$values[$k] = implode('|', $newValues[$k]);
|
||||||
break;
|
break;
|
||||||
case 'dropdown':
|
case 'dropdown':
|
||||||
|
$values[$k] = $newValues[$k];
|
||||||
|
|
||||||
if ($v->saveLabel == 1) {
|
if ($v->saveLabel == 1) {
|
||||||
if(isset($v->options[$newValues[$k]])){
|
if(isset($v->options[$newValues[$k]])){
|
||||||
$values[$k . '_label'] = $v->options[$newValues[$k]];
|
$values[$k . '_label'] = $v->options[$newValues[$k]];
|
||||||
@@ -336,14 +337,17 @@ class Form extends XmlForm
|
|||||||
$i=0;
|
$i=0;
|
||||||
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
|
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
|
||||||
foreach($item as $kk => $vv){
|
foreach($item as $kk => $vv){
|
||||||
|
|
||||||
//we need to know which fields are dropdowns
|
//we need to know which fields are dropdowns
|
||||||
if($this->fields[$k]->fields[$kk]->type == 'dropdown'){
|
if($this->fields[$k]->fields[$kk]->type == 'dropdown') {
|
||||||
if(($this->fields[$k]->fields[$kk]->saveLabel)==1){
|
$values[$k][$j] = $newValues[$k][$j];
|
||||||
|
|
||||||
|
if(($this->fields[$k]->fields[$kk]->saveLabel) == 1) {
|
||||||
if ($this->fields[$k]->validateValue($newValues[$k][$j], $this )){
|
if ($this->fields[$k]->validateValue($newValues[$k][$j], $this )){
|
||||||
if (isset($this->fields[$k]->fields[$kk]->options[$vv])){
|
if (isset($this->fields[$k]->fields[$kk]->options[$vv])){
|
||||||
$values[$k][$j][$kk. '_label'] = $this->fields[$k]->fields[$kk]->options[$vv];
|
$values[$k][$j][$kk . '_label'] = $this->fields[$k]->fields[$kk]->options[$vv];
|
||||||
}else{
|
$newValues[$k][$j][$kk . '_label'] = $values[$k][$j][$kk . '_label'];
|
||||||
|
} else {
|
||||||
$query = G::replaceDataField($this->fields[$k]->fields[$kk]->sql,$values[$k][$j]);
|
$query = G::replaceDataField($this->fields[$k]->fields[$kk]->sql,$values[$k][$j]);
|
||||||
$con = Propel::getConnection('workflow');
|
$con = Propel::getConnection('workflow');
|
||||||
$stmt = $con->prepareStatement($query);
|
$stmt = $con->prepareStatement($query);
|
||||||
@@ -360,24 +364,17 @@ class Form extends XmlForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}/*else{
|
}
|
||||||
if ($this->fields[$k]->validateValue($newValues[$k][$j], $this )){
|
} else {
|
||||||
// if there is a dropdown but with a savelabel set to 0 this checks if a previous dropdown has been setted
|
|
||||||
// so if its true then the $values cannot be rewritted
|
|
||||||
//$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );//print_r($values[$k][$j]);print'<hr>';
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}/* else {
|
|
||||||
// if there are no dropdowns previously setted and the evaluated field is not a dropdown
|
// if there are no dropdowns previously setted and the evaluated field is not a dropdown
|
||||||
// only then rewritte the $values
|
// only then rewritte the $values
|
||||||
//$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
|
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
|
||||||
}*/
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}/*else{
|
} else {
|
||||||
if ($this->fields[$k]->validateValue($newValues[$k][$j], $this ))
|
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
|
||||||
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );//print_r($values[$k][$j]);print'<hr>';
|
}
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -405,6 +402,7 @@ class Form extends XmlForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($newValues as $k => $v) {
|
foreach ($newValues as $k => $v) {
|
||||||
if (strpos($k, 'SYS_GRID_AGGREGATE_') !== false) {
|
if (strpos($k, 'SYS_GRID_AGGREGATE_') !== false) {
|
||||||
$values[$k] = $v;
|
$values[$k] = $v;
|
||||||
|
|||||||
Reference in New Issue
Block a user