Merged in bugfix/HOR-2840 (pull request #5524)

HOR-2840

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Roly
2017-03-15 19:55:26 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -320,7 +320,7 @@ class pmDynaform
$dt = $this->getCacheQueryData($json->dbConnection, $sql, $json->type); $dt = $this->getCacheQueryData($json->dbConnection, $sql, $json->type);
foreach ($dt as $row) { foreach ($dt as $row) {
$option = new stdClass(); $option = new stdClass();
$option->value = $row[0]; $option->value = isset($row[0]) ? $row[0] : "";
$option->label = isset($row[1]) ? $row[1] : ""; $option->label = isset($row[1]) ? $row[1] : "";
$json->optionsSql[] = $option; $json->optionsSql[] = $option;
} }
@@ -334,7 +334,7 @@ class pmDynaform
if (isset($this->fields['APP_DATA'][$dataVariable]) && is_array($this->fields['APP_DATA'][$dataVariable])) { if (isset($this->fields['APP_DATA'][$dataVariable]) && is_array($this->fields['APP_DATA'][$dataVariable])) {
foreach ($this->fields['APP_DATA'][$dataVariable] as $row) { foreach ($this->fields['APP_DATA'][$dataVariable] as $row) {
$option = new stdClass(); $option = new stdClass();
$option->value = $row[0]; $option->value = isset($row[0]) ? $row[0] : "";
$option->label = isset($row[1]) ? $row[1] : ""; $option->label = isset($row[1]) ? $row[1] : "";
$json->optionsSql[] = $option; $json->optionsSql[] = $option;
} }
@@ -343,7 +343,7 @@ class pmDynaform
$json->queryOutputData = array(); $json->queryOutputData = array();
foreach ($json->optionsSql as $option) { foreach ($json->optionsSql as $option) {
if ($json->queryFilter !== '') { if ($json->queryFilter !== '') {
if (preg_match('/^.*' . $json->queryFilter . '.*$/i', $option->label)) { if (stripos($option->label, $json->queryFilter) !== false) {
$json->queryOutputData[] = $option; $json->queryOutputData[] = $option;
} }
} else { } else {