Commit 418623f3 authored by tbrehm's avatar tbrehm

You can now set an array of predefined values in a tform select field together...

You can now set an array of predefined values in a tform select field together with a datasource. The data of the "value" array and the datasource data get merged, so that the datasource data gets appended to the value array.
parent a4710889
......@@ -361,7 +361,11 @@ class tform {
// If Datasource is set, get the data from there
if(isset($field['datasource']) && is_array($field['datasource'])) {
$field["value"] = $this->getDatasourceData($field, $record);
if(is_array($field["value"])) {
$field["value"] = array_merge($field["value"],$this->getDatasourceData($field, $record));
} else {
$field["value"] = $this->getDatasourceData($field, $record);
}
}
// If a limitation for the values is set
......@@ -470,7 +474,11 @@ class tform {
// If Datasource is set, get the data from there
if(@is_array($field['datasource'])) {
$field["value"] = $this->getDatasourceData($field, $record);
if(is_array($field["value"])) {
$field["value"] = array_merge($field["value"],$this->getDatasourceData($field, $record));
} else {
$field["value"] = $this->getDatasourceData($field, $record);
}
}
// If a limitation for the values is set
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment