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:
parent
71fc839c83
commit
99a9da626d
22 changed files with 218 additions and 259 deletions
|
|
@ -2550,35 +2550,17 @@ sub www_editSave {
|
|||
|
||||
$object->updateHistory("edited");
|
||||
|
||||
# Handle Save & Commit button
|
||||
if ($self->session->form->process("saveAndCommit") ne "") {
|
||||
if ($self->session->setting->get("skipCommitComments")) {
|
||||
$self->session->http->setRedirect(
|
||||
$self->getUrl("op=commitVersionTagConfirm;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId)
|
||||
);
|
||||
}
|
||||
else {
|
||||
$self->session->http->setRedirect(
|
||||
$self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId)
|
||||
);
|
||||
}
|
||||
return undef;
|
||||
# we handle auto commit assets here in case they didn't handle it themselves
|
||||
if ($object->getAutoCommitWorkflowId && $self->hasBeenCommitted) {
|
||||
$object->requestAutoCommit;
|
||||
}
|
||||
|
||||
# Handle Auto Request Commit setting
|
||||
if ($self->session->setting->get("autoRequestCommit")) {
|
||||
# Make sure version tag hasn't already been committed by another process
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($self->session, "nocreate");
|
||||
|
||||
if ($versionTag && $self->session->setting->get("skipCommitComments")) {
|
||||
$versionTag->requestCommit;
|
||||
}
|
||||
elsif ($versionTag) {
|
||||
$self->session->http->setRedirect(
|
||||
$self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId)
|
||||
);
|
||||
return undef;
|
||||
}
|
||||
# else, try to to auto commit
|
||||
elsif(WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
||||
override => scalar $self->session->form->process('saveAndCommit'),
|
||||
allowComments => 1,
|
||||
returnUrl => $self->getUrl,
|
||||
})) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
# Handle "saveAndReturn" button
|
||||
|
|
@ -2600,12 +2582,11 @@ sub www_editSave {
|
|||
$self->session->asset($object);
|
||||
return $self->session->asset->$method();
|
||||
}
|
||||
|
||||
|
||||
$self->session->asset($object->getContainer);
|
||||
return $self->session->asset->www_view;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue