HOR-2437
This commit is contained in:
@@ -196,7 +196,9 @@ class pmDynaform
|
|||||||
if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) {
|
if (is_string($value) && in_array(substr($value, 0, 2), $prefixs)) {
|
||||||
$triggerValue = substr($value, 2);
|
$triggerValue = substr($value, 2);
|
||||||
if (isset($this->fields["APP_DATA"][$triggerValue])) {
|
if (isset($this->fields["APP_DATA"][$triggerValue])) {
|
||||||
$json->{$key} = $this->fields["APP_DATA"][$triggerValue];
|
if ($key !== "dataVariable") {
|
||||||
|
$json->{$key} = $this->fields["APP_DATA"][$triggerValue];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$json->{$key} = "";
|
$json->{$key} = "";
|
||||||
}
|
}
|
||||||
@@ -327,6 +329,18 @@ class pmDynaform
|
|||||||
$json->optionsSql[] = $option;
|
$json->optionsSql[] = $option;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($value === "suggest" && isset($json->queryField) && $json->queryField == true) {
|
||||||
|
$json->queryOutputData = array();
|
||||||
|
foreach ($json->optionsSql as $option) {
|
||||||
|
if ($json->queryFilter !== '') {
|
||||||
|
if (preg_match('/^.*' . $json->queryFilter . '.*$/i', $option->label)) {
|
||||||
|
$json->queryOutputData[] = $option;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$json->queryOutputData[] = $option;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//data
|
//data
|
||||||
|
|||||||
@@ -710,9 +710,16 @@ class Variable
|
|||||||
public function executeSqlSuggest($processUid, $variableName, array $arrayVariable = array())
|
public function executeSqlSuggest($processUid, $variableName, array $arrayVariable = array())
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$appData = array();
|
||||||
|
if (isset($arrayVariable['app_uid'])) {
|
||||||
|
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||||
|
$fields = $case->getApplicationRecordByPk($arrayVariable['app_uid'], ['$applicationUid' => 'app_uid']);
|
||||||
|
$case = new \Cases();
|
||||||
|
$appData = $case->unserializeData($fields['APP_DATA']);
|
||||||
|
}
|
||||||
$_SESSION["PROCESS"] = $processUid;
|
$_SESSION["PROCESS"] = $processUid;
|
||||||
\G::LoadClass("pmDynaform");
|
\G::LoadClass("pmDynaform");
|
||||||
$pmDynaform = new \pmDynaform();
|
$pmDynaform = new \pmDynaform(array("APP_DATA" => $appData));
|
||||||
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $arrayVariable["field_id"], $processUid);
|
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $arrayVariable["field_id"], $processUid);
|
||||||
$field->queryField = true;
|
$field->queryField = true;
|
||||||
$field->queryInputData = $arrayVariable;
|
$field->queryInputData = $arrayVariable;
|
||||||
|
|||||||
Reference in New Issue
Block a user