diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 173b090587986ddf06c0acf6abe8147f357b6831..4a85ffabfa9fd1cb882d1591edf6a16c70c54d1d 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1263,9 +1263,21 @@ class SelectionField extends FormField { } function getFilterData() { + // Start with the filter data for the list item as the [0] index $data = array(parent::getFilterData()); - if (($v = $this->getClean()) instanceof DynamicListItem) { - $data = array_merge($data, $v->getFilterData()); + if (($v = $this->getClean())) { + // Add in the properties for all selected list items in sub + // labeled by their field id + foreach ($v as $id=>$L) { + if (!($li = DynamicListItem::lookup($id))) + continue; + foreach ($li->getFilterData() as $prop=>$value) { + if (!isset($data[$prop])) + $data[$prop] = $value; + else + $data[$prop] .= " $value"; + } + } } return $data; } diff --git a/include/class.forms.php b/include/class.forms.php index e242a44ba40c77807e454be6f9b2313cabc6bb5f..3f2b68db2bab376312979cc3c1a1b60c69a037c0 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -594,17 +594,6 @@ class FormField { return null; } - /** - * Indicates if the field provides for searching for something other - * than keywords. For instance, textbox fields can have hits by keyword - * searches alone, but selection fields should provide the option to - * match a specific value or set of values and therefore need to - * participate on any search builder. - */ - function hasSpecialSearch() { - return true; - } - function getConfigurationForm($source=null) { if (!$this->_cform) { $type = static::getFieldType($this->get('type')); @@ -699,10 +688,6 @@ class TextboxField extends FormField { ); } - function hasSpecialSearch() { - return false; - } - function validateEntry($value) { parent::validateEntry($value); $config = $this->getConfiguration(); @@ -773,10 +758,6 @@ class TextareaField extends FormField { ); } - function hasSpecialSearch() { - return false; - } - function display($value) { $config = $this->getConfiguration(); if ($config['html']) @@ -829,10 +810,6 @@ class PhoneField extends FormField { ); } - function hasSpecialSearch() { - return false; - } - function validateEntry($value) { parent::validateEntry($value); $config = $this->getConfiguration(); @@ -1131,9 +1108,6 @@ class ThreadEntryField extends FormField { function isPresentationOnly() { return true; } - function hasSpecialSearch() { - return false; - } function getConfigurationOptions() { global $cfg; @@ -1454,10 +1428,6 @@ class FileUploadField extends FormField { ); } - function hasSpecialSearch() { - return false; - } - /** * Called from the ajax handler for async uploads via web clients. */ diff --git a/include/class.list.php b/include/class.list.php index f5f9c4bd2551f5605dc4228da9b827e6c62ac010..08451a298a36a15d94e9b5620967fac3a9b5ed39 100644 --- a/include/class.list.php +++ b/include/class.list.php @@ -587,6 +587,14 @@ class DynamicListItem extends VerySimpleModel implements CustomListItem { } } + function getFilterData() { + $data = array(); + foreach ($this->getConfigurationForm()->getFields() as $F) { + $data['.'.$F->get('id')] = $F->toString($F->value); + } + return $data; + } + function toString() { return $this->get('value'); }