removing the autocommit jury rig that posts and wikipage's were using

This commit is contained in:
JT Smith 2006-12-06 17:35:36 +00:00
parent 82867ec273
commit eb580be7f1
6 changed files with 39 additions and 37 deletions

View file

@ -301,6 +301,12 @@ sub formatContent {
return $msg;
}
#-------------------------------------------------------------------
sub getAutoCommitWorkflowId {
my $self = shift;
return $self->getThread->getParent->get("approvalWorkflow");
}
#-------------------------------------------------------------------
=head2 getAvatarUrl ( )
@ -749,20 +755,6 @@ sub processPropertiesFromFormPost {
$self->getThread->subscribe if ($self->session->form->process("subscribe"));
delete $self->{_storageLocation};
$self->postProcess;
# allows us to let the cs post use it's own workflow approval process
my $currentTag = WebGUI::VersionTag->getWorking($self->session);
if ($currentTag->getAssetCount < 2) {
$currentTag->set({workflowId=>$self->getThread->getParent->get("approvalWorkflow")});
$currentTag->requestCommit;
} else {
my $newTag = WebGUI::VersionTag->create($self->session, {
name=>$self->getTitle." / ".$self->session->user->username,
workflowId=>$self->getThread->getParent->get("approvalWorkflow")
});
$self->session->db->write("update assetData set tagId=? where assetId=? and tagId=?",[$newTag->getId, $self->getId, $currentTag->getId]);
$self->purgeCache;
$newTag->requestCommit;
}
}

View file

@ -129,6 +129,13 @@ sub duplicate {
}
#-------------------------------------------------------------------
sub getAutoCommitWorkflowId {
my $self = shift;
return $self->getWiki->get("approvalWorkflow");
}
#-------------------------------------------------------------------
sub getEditForm {
my $self = shift;
@ -231,7 +238,7 @@ sub processPropertiesFromFormPost {
isHidden => 1,
actionTakenBy => $self->session->user->userId,
actionTaken => $actionTaken});
if ($self->canAdminister) {
if ($self->getWiki->canAdminister) {
$self->update({isProtected => $self->session->form("isProtected")});
}
delete $self->{_storageLocation};
@ -249,20 +256,6 @@ sub processPropertiesFromFormPost {
$size += $storage->getFileSize($file);
}
$self->setSize($size);
# allows us to let the cs post use it's own workflow approval process
my $currentTag = WebGUI::VersionTag->getWorking($self->session);
if ($currentTag->getAssetCount < 2) {
$currentTag->set({workflowId=>$self->getWiki->get("approvalWorkflow")});
$currentTag->requestCommit;
} else {
my $newTag = WebGUI::VersionTag->create($self->session, {
name=>$self->getTitle." / ".$self->session->user->username,
workflowId=>$self->getWiki->get("approvalWorkflow")
});
$self->session->db->write("update assetData set tagId=? where assetId=? and tagId=?",[$newTag->getId, $self->getId, $currentTag->getId]);
$self->purgeCache;
$newTag->requestCommit;
}
}
#-------------------------------------------------------------------
@ -298,7 +291,7 @@ sub view {
#-------------------------------------------------------------------
sub www_delete {
my $self = shift;
return $self->session->privilege->insufficient unless $self->canAdminister;
return $self->session->privilege->insufficient unless $self->getWiki->canAdminister;
$self->trash;
$self->session->asset($self->getParent);
return $self->getParent->www_view;