StoryTopic 'Alphabetically' sort order

This commit is contained in:
Scott Walters 2010-07-27 18:42:31 -04:00
parent 33592f9dbb
commit e033192328
6 changed files with 110 additions and 9 deletions

View file

@ -367,9 +367,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}) {