Add indicator to trash and clipboard for assets with children

This commit is contained in:
Graham Knop 2007-07-31 16:38:29 +00:00
parent 1a4b77b435
commit 27b3a4d644
4 changed files with 8 additions and 3 deletions

View file

@ -176,7 +176,9 @@ Returns the number of children this asset has. This excludes assets in the trash
sub getChildCount {
my $self = shift;
my ($count) = $self->session->db->quickArray("select count(*) from asset where state in ('published','archived') and parentId=?", [$self->getId]);
my $opts = shift || {};
my $stateWhere = $opts->{includeTrash} ? '' : "state in ('published','archived') and";
my ($count) = $self->session->db->quickArray("select count(*) from asset where $stateWhere parentId=?", [$self->getId]);
return $count;
}