Merge branch 'master' into WebGUI8
This commit is contained in:
commit
e4e27d6e96
23 changed files with 555 additions and 260 deletions
|
|
@ -486,15 +486,15 @@ sub getWorking {
|
|||
#First see if there is already a version tag
|
||||
$tag = $stow->get(q{versionTag});
|
||||
|
||||
return $tag if $tag;
|
||||
return $tag if ($tag && !$tag->isLocked);
|
||||
|
||||
$tagId = $session->scratch()->get(q{versionTag});
|
||||
if ($tagId) {
|
||||
$tag = $class->new($session, $tagId);
|
||||
|
||||
$stow->set(q{versionTag}, $tag);
|
||||
|
||||
return $tag;
|
||||
unless ($tag->isLocked) {
|
||||
$stow->set(q{versionTag}, $tag);
|
||||
return $tag;
|
||||
}
|
||||
}
|
||||
|
||||
#No tag found. Create or reclaim one?
|
||||
|
|
@ -523,10 +523,10 @@ sub getWorking {
|
|||
# For now, we only reclaim if 1 tag open.
|
||||
if (scalar @openTags == 1) {
|
||||
$tag = $openTags[0];
|
||||
|
||||
$tag->setWorking();
|
||||
|
||||
return $tag;
|
||||
unless ($tag->isLocked) {
|
||||
$tag->setWorking();
|
||||
return $tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ($mode eq q{siteWide}) {
|
||||
|
|
@ -534,7 +534,7 @@ sub getWorking {
|
|||
|
||||
OPENTAG:
|
||||
foreach my $openTag (@{WebGUI::VersionTag->getOpenTags($session)}) {
|
||||
if ($openTag->get(q{isSiteWide})) {
|
||||
if ($openTag->get(q{isSiteWide}) && !$openTag->isLocked) {
|
||||
|
||||
$tag = $openTag;
|
||||
|
||||
|
|
@ -563,6 +563,16 @@ sub getWorking {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isLocked ( )
|
||||
|
||||
Returns boolean value indicating whether tag is locked
|
||||
|
||||
=cut
|
||||
|
||||
sub isLocked { $_[0]{_data}{isLocked} }
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 leaveTag ( )
|
||||
|
||||
Make the user leave their current tag.
|
||||
|
|
@ -782,6 +792,7 @@ Sets this tag as the working tag for the current user.
|
|||
|
||||
sub setWorking {
|
||||
my $self = shift;
|
||||
return if $self->isLocked;
|
||||
$self->session->scratch->set("versionTag",$self->getId);
|
||||
$self->session->stow->set("versionTag", $self);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue