Do not highlight checkboxes when returning search results. Fixes bug #11150

This commit is contained in:
Colin Kuskie 2009-10-21 12:58:58 -07:00
parent 365d4bfef2
commit 13f833c27b
2 changed files with 5 additions and 6 deletions

View file

@ -1193,6 +1193,7 @@ sub www_getCompareFormData {
if($form->process("search")) {
if ($searchParamList) {
RESULT: foreach my $result (@{$self->getListings}) {
my $checked = '';
my $matrixListing_attributes = $session->db->buildHashRefOfHashRefs("
select value, fieldType, attributeId from Matrix_attribute
left join MatrixListing_attribute as listing using(attributeId)
@ -1203,24 +1204,21 @@ sub www_getCompareFormData {
my $fieldType = $matrixListing_attributes->{$param->{attributeId}}->{fieldType};
my $listingValue = $matrixListing_attributes->{$param->{attributeId}}->{value};
if(($fieldType eq 'MatrixCompare') && ($listingValue < $param->{value})){
$result->{checked} = '';
last PARAM;
}
elsif(($fieldType ne 'MatrixCompare' && $fieldType ne '') && ($param->{value} ne $listingValue)){
$result->{checked} = '';
last PARAM;
}
else{
$result->{checked} = 'checked';
$checked = 'checked';
}
}
$result->{assetId} =~ s/-/_____/g;
push @results, $result if $result->{checked} eq 'checked';
push @results, $result if $checked eq 'checked';
}
}
else {
foreach my $result (@{$self->getListings}) {
$result->{checked} = 'checked';
$result->{assetId} =~ s/-/_____/g;
push @results, $result;
}
@ -1390,7 +1388,7 @@ sub www_listAttributes {
=head2 www_search ( )
Returns the search screen.
Returns the search screen. Uses www_getCompareFormData with search=1 for doing AJAX requests.
=cut