Merge commit '63865eb39f' into WebGUI8. up to 7.9.11
This commit is contained in:
commit
7b218942b3
72 changed files with 3085 additions and 407 deletions
|
|
@ -324,6 +324,11 @@ If usePaginator is not passed, then this variable will limit the number of asset
|
|||
An array reference of asset states. The ids of assets in those states will be returned. If this option
|
||||
is missing, only assets in the C<published> state will be returned.
|
||||
|
||||
=head4 sortOrder
|
||||
|
||||
Determines the order that assets are returned. By default, it is in Chronological order, by creationDate. If
|
||||
you set sortOrder to Alphabetically, it will sort by title, and then lineage.
|
||||
|
||||
=cut
|
||||
|
||||
sub getMatchingAssets {
|
||||
|
|
@ -384,9 +389,18 @@ sub getMatchingAssets {
|
|||
push @clauses, 'keyword in ('.join(',', @placeholders).')';
|
||||
}
|
||||
|
||||
my $sortOrder = $options->{sortOrder} || 'Chronologically';
|
||||
|
||||
my $orderBy = $sortOrder eq 'Alphabetically' ? ' order by upper(title), lineage' : ' order by creationDate desc, lineage';
|
||||
|
||||
# write the query
|
||||
my $query = 'select distinct assetKeyword.assetId from assetKeyword left join asset using (assetId)
|
||||
where '.join(' and ', @clauses).' order by creationDate desc, lineage';
|
||||
my $query = q{
|
||||
select distinct assetKeyword.assetId
|
||||
from assetKeyword
|
||||
left join asset using (assetId)
|
||||
left join assetData using (assetId)
|
||||
where } .
|
||||
join(' and ', @clauses) . $orderBy;
|
||||
|
||||
# perform the search
|
||||
if ($options->{usePaginator}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue