Add a new template variable to the Thingy search screen, so that List type form fields can display a better form for searching. Fixes bug #11612.

This commit is contained in:
Colin Kuskie 2010-06-29 15:13:21 -07:00
parent 5e7b332e67
commit bb2587b1ea
5 changed files with 12 additions and 3 deletions

View file

@ -3284,7 +3284,7 @@ $self->session->form->process($_) eq "") {
sequenceNumber');
while (my $field = $fields->hashRef) {
if ($field->{searchIn}){
my $searchForm = $self->getFormElement($field);
my $searchForm = $self->getFormPlugin($field, 1);
my $searchTextForm = WebGUI::Form::Text($self->session, {
name=>"field_".$field->{fieldId},
size=>25,
@ -3299,9 +3299,10 @@ sequenceNumber');
push(@searchFields_loop, {
"searchFields_fieldId" => $field->{fieldId},
"searchFields_label" => $field->{label},
"searchFields_form" => $searchForm,
"searchFields_form" => $searchForm->toHtml,
"searchFields_textForm" => $searchTextForm,
"searchFields_is".$fieldType => 1,
"searchFields_listType" => $searchForm->isa('WebGUI::Form::List'),
});
my @searchValue = $session->form->process("field_".$field->{fieldId});

View file

@ -191,6 +191,7 @@ our $HELP = {
{ 'name' => 'searchFields_textForm' },
{ 'name' => 'searchFields_label' },
{ 'name' => 'searchFields_is__fieldType__' },
{ 'name' => 'searchFields_listType' },
],
},
{ 'name' => 'listOfThings',

View file

@ -970,11 +970,17 @@ search has been done.|,
},
'searchFields_is__fieldType__' => {
message => q|A boolean indicating wether this field is of type __fieldType__. The first letter of __fieldType__ is always uppercase. Example: for a select box the value of <tmpl_var searchFields_isSelectBox> is true.|,
message => q|A boolean indicating whether this field is of type __fieldType__. The first letter of __fieldType__ is always uppercase. Example: for a select box the value of <tmpl_var searchFields_isSelectBox> is true.|,
lastUpdated => 1104630516,
context => q|Description of a tmpl_var for the template help.|,
},
'searchFields_listType' => {
message => q|A boolean indicating whether this field is a List type field.|,
lastUpdated => 1277849256,
context => q|Description of a tmpl_var for the template help.|,
},
'displayInSearchFields_loop' => {
message => q|A loop containing the fields that are displayed in the search results.|,
lastUpdated => 1104630516,