almost done fixing addRevision changes
This commit is contained in:
parent
3ce9198220
commit
1866c593ea
25 changed files with 186 additions and 199 deletions
|
|
@ -1423,7 +1423,9 @@ sub www_deleteFieldConfirm {
|
|||
unless $self->canEdit;
|
||||
return $self->session->privilege->locked
|
||||
unless $self->canEditIfLocked;
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
$newSelf->deleteField($self->session->form->process("fieldName"));
|
||||
$newSelf->{_mode} = 'form';
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
|
|
@ -1450,7 +1452,9 @@ sub www_deleteTabConfirm {
|
|||
unless $self->canEdit;
|
||||
return $self->session->privilege->locked
|
||||
unless $self->canEditIfLocked;
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
$newSelf->deleteTab($self->session->form->process("tabId"));
|
||||
$newSelf->{_mode} = 'form';
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
|
|
@ -1667,7 +1671,9 @@ sub www_editFieldSave {
|
|||
$field{isMailField} = 1;
|
||||
}
|
||||
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
if ($fieldName) {
|
||||
if ($fieldName ne $newName) {
|
||||
$newSelf->renameField($fieldName, $newName);
|
||||
|
|
@ -1923,7 +1929,9 @@ sub www_moveFieldDown {
|
|||
unless $self->canEdit;
|
||||
return $self->session->privilege->locked
|
||||
unless $self->canEditIfLocked;
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
my $fieldName = $self->session->form->process('fieldName');
|
||||
$newSelf->moveFieldDown($fieldName);
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
|
|
@ -1983,7 +1991,9 @@ sub www_moveFieldUp {
|
|||
unless $self->canEdit;
|
||||
return $self->session->privilege->locked
|
||||
unless $self->canEditIfLocked;
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
my $fieldName = $self->session->form->process('fieldName');
|
||||
$newSelf->moveFieldUp($fieldName);
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
|
|
@ -2044,7 +2054,9 @@ sub www_moveTabRight {
|
|||
unless $self->canEdit;
|
||||
return $self->session->privilege->locked
|
||||
unless $self->canEditIfLocked;
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
my $tabId = $self->session->form->process('tabId');
|
||||
$newSelf->moveTabRight($tabId);
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
|
|
@ -2100,7 +2112,9 @@ sub www_moveTabLeft {
|
|||
unless $self->canEdit;
|
||||
return $self->session->privilege->locked
|
||||
unless $self->canEditIfLocked;
|
||||
my $newSelf = $self->addRevision;
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newSelf->setVersionLock;
|
||||
my $tabId = $self->session->form->process('tabId');
|
||||
$newSelf->moveTabLeft($tabId);
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
|
|
|
|||
|
|
@ -771,8 +771,11 @@ sub processFileSynopsis {
|
|||
if ( $asset->synopsis ne $synopsis ) {
|
||||
my $properties = $asset->get;
|
||||
$properties->{ synopsis } = $synopsis;
|
||||
$properties->{ tagId } = $newVersionTag->getId;
|
||||
$properties->{ status } = "pending";
|
||||
|
||||
$asset->addRevision( $properties, undef, { skipAutoCommitWorkflows => 1 } );
|
||||
my $newRev = $asset->addRevision( $properties );
|
||||
$newRev->setVersionLock;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1440,7 +1443,9 @@ sub www_edit {
|
|||
|
||||
if ( ! Exception::Class->caught() ) {
|
||||
# Add revision and create a new version tag by doing so
|
||||
my $newRevision = $asset->addRevision;
|
||||
my $tag = WebGUI::VersionTag->create( $session, { workflowId => $asset->getAutoCommitWorkflowId } );
|
||||
my $newRevision = $asset->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newRevision->setVersionLock;
|
||||
# Rotate photo (i.e. all attached image files) by 90° CCW
|
||||
$newRevision->rotate(-90);
|
||||
# Auto-commit version tag
|
||||
|
|
@ -1458,7 +1463,9 @@ sub www_edit {
|
|||
|
||||
if ( Exception::Class->caught() ) {
|
||||
# Add revision and create a new version tag by doing so
|
||||
my $newRevision = $asset->addRevision;
|
||||
my $tag = WebGUI::VersionTag->create( $session, { workflowId => $asset->getAutoCommitWorkflowId } );
|
||||
my $newRevision = $asset->addRevision({ tagId => $tag->getId, status => "pending" });
|
||||
$newRevision->setVersionLock;
|
||||
# Rotate photo (i.e. all attached image files) by 90° CW
|
||||
$newRevision->rotate(90);
|
||||
# Auto-commit version tag
|
||||
|
|
|
|||
|
|
@ -322,9 +322,11 @@ a new asset revision.
|
|||
sub www_setContentPositions {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless ($self->canEdit);
|
||||
$self->addRevision({
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({
|
||||
contentPositions=>$self->session->form->process("map")
|
||||
});
|
||||
$newSelf->setVersionLock;
|
||||
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
|
||||
return "Map set: ".$self->session->form->process("map");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -554,12 +554,20 @@ sub www_ajaxEditPointSave {
|
|||
unless $asset && $asset->canEdit;
|
||||
$asset = $asset->addRevision;
|
||||
}
|
||||
|
||||
|
||||
my $errors = $asset->processAjaxEditForm;
|
||||
|
||||
# Commit!
|
||||
if ( $asset->getAutoCommitWorkflowId ) {
|
||||
if ( $self->hasBeenCommitted) {
|
||||
my $tag = WebGUI::VersionTag->create( $session, {
|
||||
workflowId => $asset->getAutoCommitWorkflowId,
|
||||
} );
|
||||
$asset->update({
|
||||
tagId => $tag->getId,
|
||||
status => "pending",
|
||||
});
|
||||
$asset->setVersionLock;
|
||||
$asset->requestAutoCommit;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -837,18 +837,16 @@ sub submitObjectEdit {
|
|||
. $self->revisionDate );
|
||||
|
||||
# New revision should be created and then committed automatically
|
||||
my $oldVersionTag = WebGUI::VersionTag->getWorking($session, 'noCreate');
|
||||
my $newVersionTag = WebGUI::VersionTag->create($session, { workflowId => 'pbworkflow00000000003', });
|
||||
$newVersionTag->setWorking;
|
||||
|
||||
# Create the new revision
|
||||
$survey = $self->addRevision;
|
||||
$survey = $self->addRevision({
|
||||
tagId => $newVersionTag->getId,
|
||||
status => "pending",
|
||||
});
|
||||
|
||||
$newVersionTag->commit();
|
||||
$survey = $survey->cloneFromDb;
|
||||
|
||||
#Restore the old one, if it exists
|
||||
$oldVersionTag->setWorking() if $oldVersionTag;
|
||||
}
|
||||
|
||||
# See if any special actions were requested..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue