tbrehm
2010-04-12 418623f35e20f38d5f530c680d045f6a2de50dda
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.
1 files modified
12 ■■■■ changed files
interface/lib/classes/tform.inc.php 12 ●●●● patch | view | raw | blame | history
interface/lib/classes/tform.inc.php
@@ -361,7 +361,11 @@
                                        // 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 @@
                                // 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