From 0e7711c279b944f2ca262ed0582eb9905f479f1d Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 8 Nov 2006 18:53:51 +0000 Subject: [PATCH] fixing a little problem i created yesterday --- lib/WebGUI/AssetVersioning.pm | 13 +++++++++++++ lib/WebGUI/VersionTag.pm | 17 ++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index 923cc32db..30d718e8c 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -133,6 +133,19 @@ sub getRevisionCount { return $count; } +#------------------------------------------------------------------- + +=head2 getTagCount ( ) + +Returns the number of tags that have been attached to this asset. Think of it sort of like an absolute revision count, rather than counting the number of actual edits, we're counting the number of tags opened against this asset to be edited. + +=cut + +sub getTagCount { + my $self = shift; + my ($count) = $self->session->db->quickArray("select count(distinct(tagId)) from assetData where assetId=?", [$self->getId]); + return $count; +} #------------------------------------------------------------------- diff --git a/lib/WebGUI/VersionTag.pm b/lib/WebGUI/VersionTag.pm index d6cb447e0..1b494e135 100644 --- a/lib/WebGUI/VersionTag.pm +++ b/lib/WebGUI/VersionTag.pm @@ -204,29 +204,16 @@ sub getOpenTags { =head2 getRevisionCount ( ) -Returns the number of revisions for this asset. +Returns the number of revisions for this tag. =cut sub getRevisionCount { my $self = shift; - my ($count) = $self->session->db->quickArray("select count(*) from assetData where assetId=?", [$self->getId]); + my ($count) = $self->session->db->quickArray("select count(*) from assetData where tagId=?", [$self->getId]); return $count; } -#------------------------------------------------------------------- - -=head2 getTagCount ( ) - -Returns the number of tags that have been attached to this asset. Think of it sort of like an absolute revision count, rather than counting the number of actual edits, we're counting the number of tags opened against this asset to be edited. - -=cut - -sub getTagCount { - my $self = shift; - my ($count) = $self->session->db->quickArray("select count(distinct(tagId)) from assetData where assetId=?", [$self->getId]); - return $count; -} #-------------------------------------------------------------------