Uncommitted Collaborations and adding threads

This commit is contained in:
JT Smith 2006-11-07 23:46:19 +00:00
parent 4c35af0488
commit 9791c99d3b
3 changed files with 19 additions and 3 deletions

View file

@ -65,6 +65,8 @@
- WebGUI::Session::Scratch->delete now returns the value deleted for
convenience, like Perl's built-in delete() function.
- fix: Auth redirectOnLogin wouldn't work if login called from Operation::execute()
- fix: Uncommitted Collaborations and adding threads
7.1.3
- fix: SQLReport now returns error if can't find DatabaseLink

View file

@ -221,7 +221,7 @@ sub canPost {
return (
(
$self->get("status") eq "approved" ||
$self->getRevisionCount > 1
$self->getTagCount > 1 # checks to make sure that the cs has been committed at least once
) && (
$self->session->user->isInGroup($self->get("postGroupId"))
|| $self->SUPER::canEdit

View file

@ -204,13 +204,27 @@ sub getOpenTags {
=head2 getRevisionCount ( )
Returns the number of revisions that are under this tag.
Returns the number of revisions for this asset.
=cut
sub getRevisionCount {
my $self = shift;
my ($count) = $self->session->db->quickArray("select count(assetId) from assetData where tagId=?", [$self->getId]);
my ($count) = $self->session->db->quickArray("select count(*) from assetData where assetId=?", [$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;
}