Merge branch 'master' into WebGUI8
This commit is contained in:
commit
2400f19099
797 changed files with 33894 additions and 27196 deletions
|
|
@ -595,20 +595,14 @@ sub view {
|
|||
$style->setLink($url->extras('yui/build/datatable/assets/skins/sam/datatable.css'),
|
||||
{type =>'text/css', rel=>'stylesheet'});
|
||||
|
||||
$style->setScript($url->extras('yui/build/utilities/utilities.js'),
|
||||
{type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'),
|
||||
{type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/datasource/datasource-min.js'),
|
||||
{type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/datatable/datatable-min.js'),
|
||||
{type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/button/button-min.js'),
|
||||
{type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/utilities/utilities.js'), {type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'), {type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/datasource/datasource-min.js'), {type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/datatable/datatable-min.js'), {type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/button/button-min.js'), {type => 'text/javascript'});
|
||||
|
||||
my ($varStatistics,$varStatisticsEncoded);
|
||||
my $var = $self->get;
|
||||
$var->{listing_loop} = $self->getListings;
|
||||
$var->{isLoggedIn} = ($session->user->userId ne "1");
|
||||
$var->{addMatrixListing_url} = $self->getUrl('func=add;class=WebGUI::Asset::MatrixListing');
|
||||
$var->{exportAttributes_url} = $self->getUrl('func=exportAttributes');
|
||||
|
|
@ -729,7 +723,7 @@ sub view {
|
|||
push (@{ $varStatistics->{last_updated_loop} }, {
|
||||
url => $lastUpdatedListing->getUrl,
|
||||
name => $lastUpdatedListing->title,
|
||||
lastUpdated => $self->session->datetime->epochToHuman($lastUpdatedListing->lastUpdated,"%z")
|
||||
lastUpdated => $session->datetime->epochToHuman($lastUpdatedListing->lastUpdated,"%z")
|
||||
});
|
||||
}
|
||||
$varStatistics->{lastUpdated_sortButton} = "<span id='sortByUpdated'><button type='button'>"
|
||||
|
|
@ -757,6 +751,7 @@ sub view {
|
|||
rating.category =?
|
||||
and asset.parentId=?
|
||||
and asset.state='published'
|
||||
and rating.countValue >= 10
|
||||
and assetData.revisionDate=(
|
||||
select
|
||||
max(revisionDate)
|
||||
|
|
@ -772,21 +767,21 @@ sub view {
|
|||
|
||||
$data = $db->quickHashRef($sql." desc limit 1",[$category,$self->getId]);
|
||||
push(@{ $varStatistics->{best_rating_loop} },{
|
||||
url=>'/'.$data->{url},
|
||||
category=>$category,
|
||||
name=>$data->{productName},
|
||||
mean=>$data->{meanValue},
|
||||
median=>$data->{medianValue},
|
||||
count=>$data->{countValue}
|
||||
url => $session->url->gateway($data->{url}),
|
||||
category => $category,
|
||||
name => $data->{productName},
|
||||
mean => 0+$data->{meanValue},
|
||||
median => 0+$data->{medianValue},
|
||||
count => 0+$data->{countValue}
|
||||
});
|
||||
$data = $db->quickHashRef($sql." asc limit 1",[$category,$self->getId]);
|
||||
push(@{ $varStatistics->{worst_rating_loop} },{
|
||||
url=>'/'.$data->{url},
|
||||
category=>$category,
|
||||
name=>$data->{productName},
|
||||
mean=>$data->{meanValue},
|
||||
median=>$data->{medianValue},
|
||||
count=>$data->{countValue}
|
||||
url => $session->url->gateway($data->{url}),
|
||||
category => $category,
|
||||
name => $data->{productName},
|
||||
mean => 0+$data->{meanValue},
|
||||
median => 0+$data->{medianValue},
|
||||
count => 0+$data->{countValue}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1156,34 +1151,35 @@ 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)
|
||||
where listing.matrixListingId = ?
|
||||
and attributeId IN(".$searchParamList.")",
|
||||
[$result->{assetId}],'attributeId');
|
||||
##Searching is AND based.
|
||||
PARAM: foreach my $param (@searchParams_sorted) {
|
||||
my $fieldType = $matrixListing_attributes->{$param->{attributeId}}->{fieldType};
|
||||
my $listingValue = $matrixListing_attributes->{$param->{attributeId}}->{value};
|
||||
if(($fieldType eq 'MatrixCompare') && ($listingValue < $param->{value})){
|
||||
$result->{checked} = '';
|
||||
$checked = '';
|
||||
last PARAM;
|
||||
}
|
||||
elsif(($fieldType ne 'MatrixCompare' && $fieldType ne '') && ($param->{value} ne $listingValue)){
|
||||
$result->{checked} = '';
|
||||
$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;
|
||||
}
|
||||
|
|
@ -1353,7 +1349,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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue