diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 35e3992af..0146825e1 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -35,6 +35,13 @@ - fix [ 1264301 ] HTML Link in text editor broken - Removed the positive options for Navigations with start points relative to the current URL since they didn't make any sense. + - Fixed a bug where password field was not being displayed in the user manager. + - Fixed a bug in version management where you couldn't see the list of things + changed under a specific tag. + - Fixed a bug in versioning that would allow a user not using the same tag as + the original editor to edit a locked asset. + - Fixed a bug that would not allow an editor to commit an individual asset + revision. 6.7.1 diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 3c8d57279..a8a39f81e 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -808,18 +808,20 @@ Returns a toolbar with a set of icons that hyperlink to functions that delete, e sub getToolbar { my $self = shift; my $toolbar = deleteIcon('func=delete',$self->get("url"),WebGUI::International::get(43,"Asset")); - if (!$self->isLocked || $self->get("isLockedBy") eq $session{user}{userId}) { + my $commit; + my $i18n = WebGUI::International->new("Asset"); + if (($self->canEditIfLocked && $session{scratch}{versionTag} eq $self->get("tagId")) || !$self->isLocked) { $toolbar .= editIcon('func=edit',$self->get("url")); } else { $toolbar .= lockedIcon('func=manageRevisions',$self->get("url")); } + $commit = 'contextMenu.addLink("'.$self->getUrl("func=commitRevision").'","'.$i18n->get("commit").'");' if ($self->canEditIfLocked); $toolbar .= cutIcon('func=cut',$self->get("url")) .copyIcon('func=copy',$self->get("url")); $toolbar .= shortcutIcon('func=createShortcut',$self->get("url")) unless ($self->get("className") =~ /Shortcut/); $toolbar .= exportIcon('func=export',$self->get("url")) if defined ($session{config}{exportPath}); WebGUI::Style::setLink($session{config}{extrasURL}.'/contextMenu/contextMenu.css', {rel=>"stylesheet",type=>"text/css"}); WebGUI::Style::setScript($session{config}{extrasURL}.'/contextMenu/contextMenu.js', {type=>"text/javascript"}); - my $i18n = WebGUI::International->new("Asset"); return ''.$toolbar; @@ -1209,13 +1212,13 @@ sub publish { =head2 purgeCache ( ) -Purges all cache entries associated with this revision. +Purges all cache entries associated with this asset. =cut sub purgeCache { my $self = shift; - WebGUI::Cache->new(["asset",$self->getId,$self->get("revisionDate")])->delete; + WebGUI::Cache->new(["asset",$self->getId])->delete; } @@ -1392,7 +1395,7 @@ sub www_editSave { $object = $self->addChild({className=>$session{form}{class}}); $object->{_parent} = $self; } else { - return $self->getContainer->www_view if ($self->isLocked && $self->get("isLockedBy") ne $session{user}{userId}); + return $self->getContainer->www_view if ($self->canEditIfLocked || !$self->isLocked); $object = $self->addRevision; } $object->processPropertiesFromFormPost; @@ -1445,10 +1448,12 @@ sub www_manageAssets { assetManager.AddColumn('".$i18n->get("size")."','','right',''); assetManager.AddColumn('".$i18n->get("locked")."','','center','');\n"; foreach my $child (@{$self->getLineage(["children"],{returnObjects=>1})}) { + my $commit = 'contextMenu.addLink("'.$child->getUrl("func=commitRevision").'","'.$i18n->get("commit").'");' if ($child->canEditIfLocked); $output .= 'var contextMenu = new contextMenu_createWithLink("'.$child->getId.'","More"); contextMenu.addLink("'.$child->getUrl("func=editBranch").'","'.$i18n->get("edit branch").'"); contextMenu.addLink("'.$child->getUrl("func=createShortcut;proceed=manageAssets").'","'.$i18n->get("create shortcut").'"); contextMenu.addLink("'.$child->getUrl("func=manageRevisions").'","'.$i18n->get("revisions").'"); + '.$commit.' contextMenu.addLink("'.$child->getUrl.'","'.$i18n->get("view").'"); '."\n"; my $title = $child->getTitle; $title =~ s/\'/\\\'/g; @@ -1456,7 +1461,7 @@ sub www_manageAssets { my $edit; if ($child->isLocked) { $locked = 'locked'; - $edit = "'getUrl("func=edit;proceed=manageAssets")."\">Edit | '+" if ($child->get("isLockedBy") eq $session{user}{userId}); + $edit = "'getUrl("func=edit;proceed=manageAssets")."\">Edit | '+" if ($child->canEditIfLocked && $session{scratch}{versionTag} eq $self->get("tagId")); } else { $edit = "'getUrl("func=edit;proceed=manageAssets")."\">Edit | '+"; $locked = 'unlocked'; diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index 8ceb1c4f0..8266a6b98 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -102,6 +102,27 @@ sub addVersionTag { #------------------------------------------------------------------- +=head2 canEditIfLocked ( ) + +Returns a boolean indicating whether this asset is locked and if the current user can edit it in that state. + +=cut + +sub canEditIfLocked { + my $self = shift; + return 0 unless ($self->isLocked); + return ($self->get("isLockedBy") eq $session{user}{userId}); +} + + +#------------------------------------------------------------------- + +=head2 commit ( ) + +Unlock's the asset and sets it to approved. + +=cut + sub commit { my $self = shift; $self->unsetVersionLock; @@ -111,6 +132,16 @@ sub commit { #------------------------------------------------------------------- +=head2 commitVersionTag ( tagId ) + +Commits all assets edited under a version tag, and then sets the version tag to committed. + +=head3 tagId + +The unique id of the tag to be committed. + +=cut + sub commitVersionTag { my $class = shift; my $tagId = shift; @@ -349,7 +380,16 @@ sub www_addVersionTagSave { } -#-------------------------------------------------------------------A +#------------------------------------------------------------------- + +sub www_commitRevision { + my $self = shift; + return WebGUI::Privilege::adminOnly() unless $self->canEdit; + $self->commit; + return $self->getContainer->www_manageAssets if ($session{form}{proceed} eq "manageAssets"); + return $self->getContainer->www_view; +} +#------------------------------------------------------------------- sub www_commitVersionTag { my $self = shift; @@ -417,7 +457,8 @@ sub www_manageRevisions { $output .= ''.WebGUI::Icon::deleteIcon("func=purgeRevision;revisionDate=".$date,$self->get("url"),$i18n->get("purge revision prompt")).' '.WebGUI::DateTime::epochToHuman($date).' '.$by.' - '.$tag.''; + '.$tag.' + '; } $sth->finish; $output .= ''; @@ -449,16 +490,17 @@ sub www_manageVersions { my $rollbackPrompt = $i18n->get("rollback version tag confirm"); my $commitPrompt = $i18n->get("commit version tag confirm"); my $output = '

You are currently working under a tag called: '.$tag.'.

- '; + '; my $sth = WebGUI::SQL->read("select tagId,name,creationDate,createdBy from assetVersionTag where isCommitted=0"); while (my ($id,$name,$date,$by) = $sth->array) { my $u = WebGUI::User->new($by); - $output .= ' + $output .= ' + + '; } $sth->finish; diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index eb7c9649b..e63dc0567 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -82,7 +82,11 @@ sub addUserForm { my $self = shift; my $userData = $self->getParams; my $f = WebGUI::HTMLForm->new; - $f->password("authWebGUI.identifier",WebGUI::International::get(51),"password"); + $f->password( + name=>"authWebGUI.identifier", + label=>WebGUI::International::get(51), + value=>"password" + ); $f->interval( -name=>"authWebGUI.passwordTimeout", -label=>WebGUI::International::get(16,'AuthWebGUI'),
Tag NameCreated OnCreated By
Tag NameCreated OnCreated By
'.$name.'
'.WebGUI::Icon::deleteIcon("func=rollbackVersionTag;tagId=".$id,$self->get("url"),$rollbackPrompt).''.$name.' '.WebGUI::DateTime::epochToHuman($date).' '.$u->username.' '.$setTag.' | - '.$rollback.' | '.$commit.'