diff --git a/include/class.forms.php b/include/class.forms.php index 3b55aa353421b462ab4d1c3b49d15ddf1e3365c8..018c5b76535a1d9db12c32d5653e46e34b066751 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -550,6 +550,17 @@ 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')); @@ -621,6 +632,10 @@ class TextboxField extends FormField { ); } + function hasSpecialSearch() { + return false; + } + function validateEntry($value) { parent::validateEntry($value); $config = $this->getConfiguration(); @@ -685,6 +700,10 @@ class TextareaField extends FormField { ); } + function hasSpecialSearch() { + return false; + } + function display($value) { $config = $this->getConfiguration(); if ($config['html']) @@ -729,6 +748,10 @@ class PhoneField extends FormField { ); } + function hasSpecialSearch() { + return false; + } + function validateEntry($value) { parent::validateEntry($value); $config = $this->getConfiguration(); @@ -1014,6 +1037,9 @@ class ThreadEntryField extends FormField { function isPresentationOnly() { return true; } + function hasSpecialSearch() { + return false; + } function getConfigurationOptions() { global $cfg; @@ -1326,6 +1352,10 @@ class FileUploadField extends FormField { ); } + function hasSpecialSearch() { + return false; + } + /** * Called from the ajax handler for async uploads via web clients. */ diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index 3f828d210662a13a70264c9405069e991b7fe252..ee55d4152a2444cfeb97a5db94049501be4d18e8 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -648,9 +648,9 @@ if ($results) { $tform = TicketForm::objects()->one(); echo $tform->getForm()->getMedia(); foreach ($tform->getInstance()->getFields() as $f) { - if (in_array($f->get('type'), array('text', 'memo', 'phone', 'thread'))) + if (!$f->hasData()) continue; - elseif (!$f->hasData()) + elseif (!$f->getImpl()->hasSpecialSearch()) continue; ?><fieldset class="span6"> <label><?php echo $f->getLabel(); ?>:</label><div><?php