matrix bugfixes and code improvements
This commit is contained in:
parent
d370772762
commit
6f634a44c2
1 changed files with 15 additions and 11 deletions
|
|
@ -948,18 +948,20 @@ assetData.revisionDate
|
|||
@results = @{ $session->db->buildArrayRefOfHashRefs($sql,[$self->getId]) };
|
||||
foreach my $result (@results){
|
||||
if($form->process("search")){
|
||||
$self->session->errorHandler->warn("checking listing: ".$result->{title});
|
||||
# $self->session->errorHandler->warn("checking listing: ".$result->{title});
|
||||
my $matrixListing_attributes = $session->db->buildHashRefOfHashRefs("
|
||||
select value, fieldType, attributeId from MatrixListing_attribute as listing
|
||||
left join Matrix_attribute using(attributeId)
|
||||
where listing.matrixListingId = ?
|
||||
",[$result->{assetId}],'attributeId');
|
||||
foreach my $param ($form->param) {
|
||||
if($param =~ m/^search_/){
|
||||
my $attributeId = $param;
|
||||
$attributeId =~ s/^search_//;
|
||||
$attributeId =~ s/_____/-/;
|
||||
my ($listingValue,$fieldType) = $session->db->quickArray("
|
||||
select value, fieldType from MatrixListing_attribute as listing
|
||||
left join Matrix_attribute using(attributeId)
|
||||
where listing.attributeId = ? and listing.matrixListingId = ?
|
||||
",[$attributeId,$result->{assetId}]);
|
||||
#$self->session->errorHandler->warn("fieldType:".$fieldType.", attributeValue: ".$form->process($param).", listingvalue: ".$listingValue);
|
||||
my $fieldType = $matrixListing_attributes->{$attributeId}->{fieldType};
|
||||
my $listingValue = $matrixListing_attributes->{$attributeId}->{value};
|
||||
# $self->session->errorHandler->warn("fieldType:".$fieldType.", attributeValue: ".$form->process($param).", listingvalue: ".$listingValue);
|
||||
if(($fieldType eq 'MatrixCompare') && ($listingValue < $form->process($param))){
|
||||
$result->{checked} = '';
|
||||
last;
|
||||
|
|
@ -969,7 +971,6 @@ assetData.revisionDate
|
|||
last;
|
||||
}
|
||||
else{
|
||||
#$self->session->errorHandler->warn("--Checked--");
|
||||
$result->{checked} = 'checked';
|
||||
}
|
||||
}
|
||||
|
|
@ -1058,7 +1059,7 @@ sub www_getCompareListData {
|
|||
{ value=>$result->{$listingId_safe} },defaultValue=>0)->getValueAsHtml;
|
||||
}
|
||||
if($session->scratch->get('stickied_'.$result->{attributeId})){
|
||||
$self->session->errorHandler->warn("found checked stickie: ".$result->{attributeId});
|
||||
# $self->session->errorHandler->warn("found checked stickie: ".$result->{attributeId});
|
||||
$result->{checked} = 'checked';
|
||||
}
|
||||
else{
|
||||
|
|
@ -1153,9 +1154,12 @@ sub www_search {
|
|||
$attribute->{id} = $attribute->{attributeId};
|
||||
$attribute->{id} =~ s/-/_____/g;
|
||||
$attribute->{extras} = " class='attributeSelect'";
|
||||
if($attribute->{fieldType} eq 'Combo'){
|
||||
if($attribute->{fieldType} eq 'Combo'){
|
||||
$attribute->{fieldType} = 'SelectBox';
|
||||
$attribute->{options} = "blank\n".$attribute->{options};
|
||||
}
|
||||
if($attribute->{fieldType} eq 'SelectBox'){
|
||||
$attribute->{options} = "blank\n".$attribute->{options};
|
||||
$attribute->{value} = 'blank';
|
||||
}
|
||||
$attribute->{form} = WebGUI::Form::DynamicField->new($self->session,%{$attribute})->toHtml;
|
||||
push(@attribute_loop,$attribute);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue