- Any attempt to view "root" will redirect the user to the default page.
- fix [ 1285604 ] getVars undefined in Asset::File.pm - fix [ 1284330 ] error in page export function - Fixed a trash purging problem. - fix [ 1281516 ] Undefined subroutine &WebGUI::Asset::File::quote runHourly - fix [ 1281430 ] www_restoreList should be in AssetTrash.pm
This commit is contained in:
parent
8f71e237c1
commit
637bd165ba
38 changed files with 53 additions and 4190 deletions
|
|
@ -409,7 +409,7 @@ sub render {
|
|||
my $importNode = $session{asset}->getImportNode;
|
||||
my $importNodeLineage = $importNode->get("lineage");
|
||||
my $assetLineage = $session{asset}->get("lineage");
|
||||
if ($assetLineage =~ /^$importNodeLineage/) {
|
||||
if ($assetLineage =~ /^$importNodeLineage/ || $assetLineage eq "000001") {
|
||||
$var{"backtosite.url"} = $session{asset}->getDefault->getUrl;
|
||||
} else {
|
||||
$var{"backtosite.url"} = $session{asset}->getContainer->getUrl;
|
||||
|
|
|
|||
|
|
@ -1325,9 +1325,7 @@ Returns "".
|
|||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
if ($session{var}{adminOn}) {
|
||||
return $self->getToolbar;
|
||||
}
|
||||
WebGUI::HTTP::setRedirect($self->getDefault->getUrl);
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
@ -1587,28 +1585,6 @@ sub www_manageAssets {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_restoreList ( )
|
||||
|
||||
Restores a piece of content from the trash back to it's original location.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_restoreList {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless $self->canEdit;
|
||||
foreach my $id ($session{cgi}->param("assetId")) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($id);
|
||||
$asset->publish;
|
||||
}
|
||||
if ($session{form}{proceed} ne "") {
|
||||
my $method = "www_".$session{form}{proceed};
|
||||
return $self->$method();
|
||||
}
|
||||
return $self->www_manageTrash();
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use WebGUI::Asset;
|
|||
use WebGUI::HTTP;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::SQL;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset);
|
||||
|
||||
|
|
@ -117,7 +118,6 @@ sub duplicate {
|
|||
sub getBox {
|
||||
my $self = shift;
|
||||
my $var = {};
|
||||
$self->getStorageLocation->getVars($self->get("filename"),$var);
|
||||
return $self->processTemplate($var,"PBtmpl0000000000000003");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Asset;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Session;
|
||||
use File::Path;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
|
|||
|
|
@ -174,25 +174,6 @@ sub www_deleteList {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_emptyTrash ( )
|
||||
|
||||
Calls the purgeTree() method to delete all items in Trash. Returns the www_manageTrash() method. If isInGroup(4) returns false, renders insufficient privilege page.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_emptyTrash {
|
||||
my $self = shift;
|
||||
my $ac = WebGUI::AdminConsole->new("trash");
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
|
||||
foreach my $asset (@{$self->getAssetsInTrash(!($session{form}{systemTrash} && WebGUI::Grouping::isInGroup(3)))}) {
|
||||
$asset->purgeTree;
|
||||
}
|
||||
return $self->www_manageTrash();
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_manageTrash ( )
|
||||
|
|
@ -253,6 +234,28 @@ sub www_manageTrash {
|
|||
return $ac->render($output, $header);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_restoreList ( )
|
||||
|
||||
Restores a piece of content from the trash back to it's original location.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_restoreList {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless $self->canEdit;
|
||||
foreach my $id ($session{cgi}->param("assetId")) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($id);
|
||||
$asset->publish;
|
||||
}
|
||||
if ($session{form}{proceed} ne "") {
|
||||
my $method = "www_".$session{form}{proceed};
|
||||
return $self->$method();
|
||||
}
|
||||
return $self->www_manageTrash();
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Asset;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Paginator;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -521,10 +522,12 @@ sub www_manageRevisionsInTag {
|
|||
$ac->addSubmenuItem($self->getUrl('func=manageVersions'), $i18n->get("manage versions"));
|
||||
my $output = '<table width=100% class="content">
|
||||
<tr><th></th><th>Title</th><th>Type</th><th>Revision Date</th><th>Revised By</th></tr> ';
|
||||
my $sth = WebGUI::SQL->read("select assetData.revisionDate, users.username, asset.assetId, asset.className from assetData
|
||||
my $p = WebGUI::Paginator->new($self->getUrl("func=manageRevisionsInTag;tagId=".$session{form}{tagId}));
|
||||
$p->setDataByQuery("select assetData.revisionDate, users.username, asset.assetId, asset.className from assetData
|
||||
left join asset on assetData.assetId=asset.assetId left join users on assetData.revisedBy=users.userId
|
||||
where assetData.tagId=".quote($session{form}{tagId}));
|
||||
while (my ($date,$by,$id, $class) = $sth->array) {
|
||||
foreach my $row (@{$p->getPageData}) {
|
||||
my ($date,$by,$id, $class) = ($row->{revisionDate}, $row->{username}, $row->{assetId}, $row->{className});
|
||||
my $asset = WebGUI::Asset->new($id,$class,$date);
|
||||
$output .= '<tr><td>'.WebGUI::Icon::deleteIcon("func=purgeRevision;proceed=manageRevisionsInTag;tagId=".$session{form}{tagId}.";revisionDate=".$date,$asset->get("url"),$i18n->get("purge revision prompt")).'</td>
|
||||
<td>'.$asset->getTitle.'</td>
|
||||
|
|
@ -532,8 +535,7 @@ sub www_manageRevisionsInTag {
|
|||
<td><a href="'.$asset->getUrl("func=viewRevision;revisionDate=".$date).'">'.WebGUI::DateTime::epochToHuman($date).'</a></td>
|
||||
<td>'.$by.'</td></tr>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
$output .= '</table>'.$p->getBarSimple;
|
||||
my $tag = WebGUI::SQL->getRow("assetVersionTag","tagId",$session{form}{tagId});
|
||||
return $ac->render($output,$i18n->get("revisions in tag").": ".$tag->{name});
|
||||
}
|
||||
|
|
@ -559,6 +561,7 @@ sub www_purgeRevision {
|
|||
sub www_rollbackVersionTag {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::adminOnly() unless WebGUI::Grouping::isInGroup(3);
|
||||
return WebGUI::Privilege::vitalComponent() if ($session{form}{tagId} eq "pbversion0000000000001" || $session{form}{tagId} eq "pbversion0000000000002");
|
||||
my $tagId = $session{form}{tagId};
|
||||
if ($tagId) {
|
||||
$self->rollbackVersionTag($tagId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue