added revision viewing
This commit is contained in:
parent
35a2e8a4f7
commit
aee65b8391
2 changed files with 35 additions and 0 deletions
|
|
@ -1717,6 +1717,7 @@ sub getToolbar {
|
|||
contextMenu.addLink("'.$self->getUrl("func=promote").'","'.$i18n->get("promote").'");
|
||||
contextMenu.addLink("'.$self->getUrl("func=demote").'","'.$i18n->get("demote").'");
|
||||
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","'.$i18n->get("manage").'");
|
||||
contextMenu.addLink("'.$self->getUrl("func=manageRevisions").'","'.$i18n->get("revisions").'");
|
||||
contextMenu.addLink("'.$self->getUrl.'","'.$i18n->get("view").'");
|
||||
contextMenu.print();
|
||||
</script>'.$toolbar;
|
||||
|
|
@ -3612,6 +3613,34 @@ sub www_manageMetaData {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_manageRevisions ()
|
||||
|
||||
Shows a list of the revisions for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_manageRevisions {
|
||||
my $self = shift;
|
||||
my $ac = WebGUI::AdminConsole->new("versions");
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(3));
|
||||
my $i18n = WebGUI::International->new("Asset");
|
||||
#$ac->addSubmenuItem($self->getUrl('func=addVersionTag'), $i18n->get("add a version tag"));
|
||||
#$ac->addSubmenuItem($self->getUrl('func=manageVersions'), $i18n->get("manage versions"));
|
||||
my $output = '<table width=100% class="content">
|
||||
<tr><th>Revision Date</th><th>Revised By</th><th>Tag Name</th><th></th></tr> ';
|
||||
my $sth = WebGUI::SQL->read("select assetData.revisionDate, users.username, assetVersionTag.name from assetData
|
||||
left join assetVersionTag on assetData.tagId=assetVersionTag.tagId left join users on assetData.revisedBy=users.userId
|
||||
where assetData.assetId=".quote($self->getId));
|
||||
while (my ($date,$by,$tag) = $sth->array) {
|
||||
$output .= '<tr><td>'.WebGUI::DateTime::epochToHuman($date).'</td><td>'.$by.'</td><td>'.$tag.'</td><td>[rollback]</td></tr>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
return $ac->render($output,$i18n->get("committed versions"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_manageTrash ( )
|
||||
|
||||
Returns an AdminConsole to deal with assets in the Trash. If isInGroup(4) is False, renders an insufficient privilege page.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
package WebGUI::i18n::English::Asset;
|
||||
|
||||
our $I18N = {
|
||||
'revisions' => {
|
||||
message => q|Revisions|,
|
||||
lastUpdated => 0,
|
||||
context => q|Context menu item.|
|
||||
},
|
||||
|
||||
'manage versions' => {
|
||||
message => q|Manage versions.|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue