added explicit locking
This commit is contained in:
parent
e23d239e2a
commit
ea09f24608
5 changed files with 39 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
|||
6.99.0
|
||||
- Addded a lock menu item to explicitly lock an asset from editing.
|
||||
- Run on registration and alert on new user have been converted to a single
|
||||
workflow.
|
||||
- Many changes for better XHTML compliance.
|
||||
|
|
|
|||
|
|
@ -866,9 +866,14 @@ sub getToolbar {
|
|||
$toolbar .= $self->session->icon->export('func=export',$self->get("url")) if defined ($self->session->config->get("exportPath"));
|
||||
$self->session->style->setLink($self->session->config->get("extrasURL").'/contextMenu/contextMenu.css', {rel=>"stylesheet",type=>"text/css"});
|
||||
$self->session->style->setScript($self->session->config->get("extrasURL").'/contextMenu/contextMenu.js', {type=>"text/javascript"});
|
||||
my $lock = "";
|
||||
if (!$self->isLocked) {
|
||||
$lock = 'contextMenu.addLink("'.$self->getUrl("func=lock").'","'.$i18n->get("lock").'");';
|
||||
}
|
||||
return '<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var contextMenu = new contextMenu_createWithImage("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");
|
||||
'.$lock.'
|
||||
contextMenu.addLink("'.$self->getUrl("func=editBranch").'","'.$i18n->get("edit branch").'");
|
||||
contextMenu.addLink("'.$self->getUrl("func=promote").'","'.$i18n->get("promote").'");
|
||||
contextMenu.addLink("'.$self->getUrl("func=demote").'","'.$i18n->get("demote").'");
|
||||
|
|
@ -1024,6 +1029,7 @@ sub manageAssets {
|
|||
contextMenu.addLink("'.$child->getUrl("func=createShortcut;proceed=manageAssets").'","'.$i18n->get("create shortcut").'");
|
||||
contextMenu.addLink("'.$child->getUrl("func=manageRevisions").'","'.$i18n->get("revisions").'");
|
||||
contextMenu.addLink("'.$child->getUrl.'","'.$i18n->get("view").'"); '."\n";
|
||||
$output .= 'contextMenu.addLink("'.$child->getUrl("func=lock;proceed=manageAssets").'","'.$i18n->get("lock").'");' unless ($child->isLocked);
|
||||
my $title = $child->getTitle;
|
||||
$title =~ s/\'/\\\'/g;
|
||||
my $locked;
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ Formats the url to lock a thread.
|
|||
|
||||
sub getLockUrl {
|
||||
my $self = shift;
|
||||
$self->getUrl("func=lock");
|
||||
$self->getUrl("func=lockThread");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ Formats the url to unlock the thread
|
|||
|
||||
sub getUnlockUrl {
|
||||
my $self = shift;
|
||||
return $self->getUrl("func=unlock");
|
||||
return $self->getUrl("func=unlockThread");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -838,7 +838,7 @@ The web method to lock a thread.
|
|||
|
||||
=cut
|
||||
|
||||
sub www_lock {
|
||||
sub www_lockThread {
|
||||
my $self = shift;
|
||||
$self->lock if $self->getParent->canModerate;
|
||||
return $self->www_view;
|
||||
|
|
@ -914,7 +914,7 @@ The web method to unlock a thread.
|
|||
|
||||
=cut
|
||||
|
||||
sub www_unlock {
|
||||
sub www_unlockThread {
|
||||
my $self = shift;
|
||||
$self->unlock if $self->getParent->canModerate;
|
||||
return $self->www_view;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ sub addRevision {
|
|||
my $newVersion = WebGUI::Asset->new($self->session,$self->getId, $self->get("className"), $now);
|
||||
$newVersion->updateHistory("created revision");
|
||||
$newVersion->update($self->get);
|
||||
$newVersion->{isLockedBy} = $self->session->user->userId;
|
||||
$newVersion->setVersionLock;
|
||||
$properties->{status} = 'pending';
|
||||
$newVersion->update($properties);
|
||||
return $newVersion;
|
||||
|
|
@ -225,6 +225,27 @@ sub updateHistory {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_lock ()
|
||||
|
||||
This is the same as doing an www_editSave without changing anything. It's here so that users can lock assets if they're planning on working on them, or they're working on some of the content offline.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_lock {
|
||||
my $self = shift;
|
||||
if (!$self->isLocked && $self->canEdit) {
|
||||
$self = $self->addRevision;
|
||||
}
|
||||
if ($self->session->form->process("proceed") eq "manageAssets") {
|
||||
$self->session->asset($self->getParent);
|
||||
return $self->session->asset->www_manageAssets;
|
||||
}
|
||||
$self->session->asset($self->getContainer);
|
||||
return $self->session->asset->www_view;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_manageRevisions ()
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@ our $I18N = {
|
|||
context => q|The label for the purge button in the trash manager.|
|
||||
},
|
||||
|
||||
'lock' => {
|
||||
message => q|Lock|,
|
||||
lastUpdated => 0,
|
||||
context => q|A context menu item to lock an asset for editing.|
|
||||
},
|
||||
|
||||
'locked' => {
|
||||
message => q|Locked|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue