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]) };
|
@results = @{ $session->db->buildArrayRefOfHashRefs($sql,[$self->getId]) };
|
||||||
foreach my $result (@results){
|
foreach my $result (@results){
|
||||||
if($form->process("search")){
|
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) {
|
foreach my $param ($form->param) {
|
||||||
if($param =~ m/^search_/){
|
if($param =~ m/^search_/){
|
||||||
my $attributeId = $param;
|
my $attributeId = $param;
|
||||||
$attributeId =~ s/^search_//;
|
$attributeId =~ s/^search_//;
|
||||||
$attributeId =~ s/_____/-/;
|
$attributeId =~ s/_____/-/;
|
||||||
my ($listingValue,$fieldType) = $session->db->quickArray("
|
my $fieldType = $matrixListing_attributes->{$attributeId}->{fieldType};
|
||||||
select value, fieldType from MatrixListing_attribute as listing
|
my $listingValue = $matrixListing_attributes->{$attributeId}->{value};
|
||||||
left join Matrix_attribute using(attributeId)
|
# $self->session->errorHandler->warn("fieldType:".$fieldType.", attributeValue: ".$form->process($param).", listingvalue: ".$listingValue);
|
||||||
where listing.attributeId = ? and listing.matrixListingId = ?
|
|
||||||
",[$attributeId,$result->{assetId}]);
|
|
||||||
#$self->session->errorHandler->warn("fieldType:".$fieldType.", attributeValue: ".$form->process($param).", listingvalue: ".$listingValue);
|
|
||||||
if(($fieldType eq 'MatrixCompare') && ($listingValue < $form->process($param))){
|
if(($fieldType eq 'MatrixCompare') && ($listingValue < $form->process($param))){
|
||||||
$result->{checked} = '';
|
$result->{checked} = '';
|
||||||
last;
|
last;
|
||||||
|
|
@ -969,7 +971,6 @@ assetData.revisionDate
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
#$self->session->errorHandler->warn("--Checked--");
|
|
||||||
$result->{checked} = 'checked';
|
$result->{checked} = 'checked';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1058,7 +1059,7 @@ sub www_getCompareListData {
|
||||||
{ value=>$result->{$listingId_safe} },defaultValue=>0)->getValueAsHtml;
|
{ value=>$result->{$listingId_safe} },defaultValue=>0)->getValueAsHtml;
|
||||||
}
|
}
|
||||||
if($session->scratch->get('stickied_'.$result->{attributeId})){
|
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';
|
$result->{checked} = 'checked';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
@ -1153,9 +1154,12 @@ sub www_search {
|
||||||
$attribute->{id} = $attribute->{attributeId};
|
$attribute->{id} = $attribute->{attributeId};
|
||||||
$attribute->{id} =~ s/-/_____/g;
|
$attribute->{id} =~ s/-/_____/g;
|
||||||
$attribute->{extras} = " class='attributeSelect'";
|
$attribute->{extras} = " class='attributeSelect'";
|
||||||
if($attribute->{fieldType} eq 'Combo'){
|
if($attribute->{fieldType} eq 'Combo'){
|
||||||
$attribute->{fieldType} = 'SelectBox';
|
$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;
|
$attribute->{form} = WebGUI::Form::DynamicField->new($self->session,%{$attribute})->toHtml;
|
||||||
push(@attribute_loop,$attribute);
|
push(@attribute_loop,$attribute);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue