- fix: Username blank when editing user Visitor

- fix: Thread Count is off in the Collaboration system
 - Fixed an indexing problem with Product assets.
 - fix: Reply count off when restoring from trash
 - fix: Karma not spent properly
 - fix: Avatar Message Board Template Not Working
This commit is contained in:
JT Smith 2006-06-01 17:40:15 +00:00
parent 9384702260
commit b7957742bc
11 changed files with 168 additions and 69 deletions

View file

@ -154,6 +154,35 @@ sub formatRank {
}
#-------------------------------------------------------------------
=head2 getChildCount ( )
Returns the number of children this asset has. This excludes assets in the trash or clipbaord.
=cut
sub getChildCount {
my $self = shift;
my ($count) = $self->session->db->quickArray("select count(*) from asset where state in ('published','archived') and parentId=?", [$self->getId]);
return $count;
}
#-------------------------------------------------------------------
=head2 getDescendantCount ( )
Returns the number of descendants this asset has. This excludes assets in the trash or clipboard.
=cut
sub getDescendantCount {
my $self = shift;
my ($count) = $self->session->db->quickArray("select count(*) from asset where state in ('published', 'archived') and lineage like ?", [$self->get("lineage")."%"]);
$count--; # have to subtract self
return $count;
}
#-------------------------------------------------------------------
=head2 getFirstChild ( )
@ -498,7 +527,7 @@ sub getRank {
=head2 hasChildren ( )
Returns 1 or the count of Assets with the same parentId as current Asset (Which may be zero).
Returns 1 or the count of Assets with the same parentId as current Asset's assetId (Which may be zero).
=cut
@ -510,8 +539,7 @@ sub hasChildren {
} elsif (exists $self->{_lastChild}) {
$self->{_hasChildren} = 1;
} else {
my ($hasChildren) = $self->session->db->quickArray("select count(*) from asset where parentId=".$self->session->db->quote($self->getId));
$self->{_hasChildren} = $hasChildren;
$self->{_hasChildren} = $self->getChildCount;
}
}
return $self->{_hasChildren};