Display assets, regardless of their status, in the Clipboard and Trash. Fixes bug #11550.

This commit is contained in:
Colin Kuskie 2010-06-22 22:31:07 -07:00
parent 08ee8153b3
commit 05a19ff7b8
3 changed files with 13 additions and 30 deletions

View file

@ -7,6 +7,7 @@
- fixed #11646: Post and Thread Last Post
- fixed #11626: Duplicate messages from Collab Systems
- fixed #11667: Shop: unable to remove item from Cart
- fixed #11550: Pending assets in the clipboard or trash are not visible from the approval screen
7.9.7
- added #11571: Allow return from photo edit view to gallery edit view

View file

@ -181,6 +181,7 @@ sub getAssetsInClipboard {
{
statesToInclude => ["clipboard"],
returnObjects => 1,
statusToInclude => [qw/approved pending archived/],
whereClause => $limit,
}
);

View file

@ -57,39 +57,20 @@ sub getAssetsInTrash {
my $self = shift;
my $limitToUser = shift;
my $userId = shift || $self->session->user->userId;
my @assets;
my $limit;
if ($limitToUser) {
$limit = "and asset.stateChangedBy=".$self->session->db->quote($userId);
$limit = "asset.stateChangedBy=".$self->session->db->quote($userId);
}
my $sth = $self->session->db->read("
select
asset.assetId,
assetData.revisionDate,
asset.className
from
asset
left join
assetData on asset.assetId=assetData.assetId
where
asset.state='trash'
and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId)
$limit
group by
assetData.assetId
order by
assetData.title desc
");
while (my ($id, $date, $class) = $sth->array) {
my $asset = WebGUI::Asset->new($self->session,$id,$class,$date);
if ($asset){
push(@assets, $asset);
}else{
$self->session->errorHandler->error("AssetTrash::getAssetsInTrash - failed to instanciate asset with assetId $id, className $class, and revisionDate $date");
}
}
$sth->finish;
return \@assets;
my $root = WebGUI::Asset->getRoot($self->session);
return $root->getLineage(
["descendants", ],
{
statesToInclude => ["trash"],
statusToInclude => [qw/approved pending archived/],
returnObjects => 1,
whereClause => $limit,
}
);
}
#----------------------------------------------------------------------------