rfe #640: Refactored autocommit and autocomment

Autocommit assets like CS posts or Calendar Events can now be added before the
parent is committed.  They will go into the same version tag as their parent.
This commit is contained in:
Graham Knop 2008-10-22 16:04:10 +00:00
parent 71fc839c83
commit 99a9da626d
22 changed files with 218 additions and 259 deletions

View file

@ -1388,55 +1388,6 @@ sub view {
#-------------------------------------------------------------------
=head2 www_add ( )
Returns an error message if the collaboration system has not yet been posted.
=cut
sub www_add {
my $self = shift;
#Check to see if the asset has been committed
unless ( $self->hasBeenCommitted ) {
my $i18n = WebGUI::International->new($self->session,"Asset_Collaboration");
return $self->processStyle($i18n->get("asset not committed"));
}
return $self->SUPER::www_add( @_ );
}
#-------------------------------------------------------------------
=head2 www_editSave ( )
We're extending www_editSave() here to deal with editing a post that has been denied by the approval process. Our change will reassign the old working tag of this post to the user so that they can edit it.
=cut
sub www_editSave {
my $self = shift;
my $session = $self->session;
my $className = $session->form->param("class");
#my $assetId = $self->session->form->param("assetId");
if($className eq "WebGUI::Asset::Post::Thread") {
my $assetId = $session->form->param("assetId");
if($assetId eq "new" && $self->getValue("useCaptcha")) {
my $captcha = $self->session->form->process("captcha","Captcha");
unless ($captcha) {
return $self->www_add;
}
}
}
return $self->SUPER::www_editSave();
}
#-------------------------------------------------------------------
=head2 www_search ( )
The web method to display and use the forum search interface.