From 9fac74a1b8633a5379b705381e82f697e2f1d088 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Thu, 14 Aug 2014 10:28:17 -0400 Subject: [PATCH 1/2] BUG 15581 " Issue with labels in Radio Group..." SOLVED - Issue with labels in Radio Group, check group and suggest - Se realizo el merge de cambios del codigo adjunto del presente bug "class.form.php" al archivo "class.form.php" del branch master. --- gulliver/system/class.form.php | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index 3d3322ad8..9c9a254ac 100755 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -376,7 +376,30 @@ class Form extends XmlForm switch ($v->type) { case 'radiogroup': $values[$k] = $newValues[$k]; - $values[$k . "_label"] = $newValues[$k . "_label"] = $v->options[$newValues[$k]]; + + if (isset($v->options[$newValues[$k]])) { + $values[$k . "_label"] = $newValues[$k . "_label"] = $v->options[$newValues[$k]]; + } else { + $query = G::replaceDataField( $this->fields[$k]->sql, $newValues ); + + //Execute just if a query was set, it should be not empty + if (trim($query) == "") { + continue; //if it is empty string skip it + } + + //We do the query to the external connection and we've got the label + $con = Propel::getConnection(($this->fields[$k]->sqlConnection != "") ? $this->fields[$k]->sqlConnection : "workflow"); + $stmt = $con->prepareStatement($query); + $rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM); + + while ($rs->next()) { + list ($rowId, $rowContent) = $rs->getRow(); + if ($newValues[$k] == $rowId) { + $values[$k . "_label"] = $rowContent; + break; + } + } + } break; case 'suggest': $values[$k] = $newValues[$k]; @@ -548,15 +571,6 @@ class Form extends XmlForm //This value is added when the user does not mark any checkbox $values[$k] = "__NULL__"; break; - case "grid": - $values[$k] = $_FILES["form"]["name"][$k]; - foreach ($values[$k] as $inp => $ii){ - foreach ($ii as $oo => $ee){ - $x = $v->fields; - $_POST["INPUTS"][$k][$oo] = $x[$oo]->input; - } - } - break; } } } else { @@ -699,9 +713,7 @@ class Form extends XmlForm break; case "grid": $i = 0; - if (!is_array($data[$v->name])) { - $data[$v->name] = array(); - } + foreach ($data[$v->name] as $dataGrid) { $i = $i + 1; From 5c695a08239f60cf330c93414b9cca78d08bb2d2 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Thu, 14 Aug 2014 10:55:43 -0400 Subject: [PATCH 2/2] BUG 13913 "Icons to manage dynaform..." SOLVED - Icons to manage dynaform fields are set below column Label - Problema resuelto, cuando se crea un campo con label vacio, al hacer click en Fields Handler los iconos edit field y remove field se mostraran correctamente. --- gulliver/system/class.form.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index 9c9a254ac..f0c9fd1ec 100755 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -571,6 +571,15 @@ class Form extends XmlForm //This value is added when the user does not mark any checkbox $values[$k] = "__NULL__"; break; + case "grid": + $values[$k] = $_FILES["form"]["name"][$k]; + foreach ($values[$k] as $inp => $ii){ + foreach ($ii as $oo => $ee){ + $x = $v->fields; + $_POST["INPUTS"][$k][$oo] = $x[$oo]->input; + } + } + break; } } } else { @@ -713,7 +722,9 @@ class Form extends XmlForm break; case "grid": $i = 0; - + if (!is_array($data[$v->name])) { + $data[$v->name] = array(); + } foreach ($data[$v->name] as $dataGrid) { $i = $i + 1;