remove cut and duplicate asset methods

This commit is contained in:
Doug Bell 2011-02-23 16:44:56 -06:00
parent 9b330fc217
commit 5672cee964

View file

@ -355,99 +355,6 @@ sub pasteInFork {
$self->paste( $_->getId ) for @roots;
} ## end sub pasteInFork
#-------------------------------------------------------------------
=head2 www_cut ( )
If the current user canEdit, it puts $self into the clipboard and calls www_view on it's container.
Otherwise returns AdminConsole rendered insufficient privilege.
=cut
sub www_cut {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
return $self->session->privilege->vitalComponent
if $self->get('isSystem');
$self->cut;
my $asset = $self->getContainer;
if ($self->getId eq $asset->getId) {
$asset = $self->getParent;
}
$self->session->asset($asset);
return $asset->www_view;
}
#-------------------------------------------------------------------
=head2 www_cutList ( )
Checks to see if the current user canEdit the parent containting the assets that
are being cut. If that's not true, or if the CSRF token is missing, then
return insufficient privileges.
Cuts the list of assets in the C<assetId> form variable, checking each one for edit privileges
and to see if it's a system asset.
Returns the user to either the screen set by the C<proceed> form variable, or to
the Asset Manager.
=cut
sub www_cutList {
my $self = shift;
my $session = $self->session;
return $session->privilege->insufficient() unless $self->canEdit && $session->form->validToken;
foreach my $assetId ($session->form->param("assetId")) {
my $asset = WebGUI::Asset->newById($session,$assetId);
if ($asset->canEdit && !$asset->get('isSystem')) {
$asset->cut;
}
}
if ($session->form->process("proceed") ne "") {
my $method = "www_".$session->form->process("proceed");
return $self->$method();
}
return $self->www_manageAssets();
}
#-------------------------------------------------------------------
=head2 www_duplicateList ( )
Checks to see if the current user canEdit the parent containting the assets that
are being duplicated. If that's not true, or if the CSRF token is missing, then
return insufficient privileges.
Duplicates (copy and paste immediately) the list of assets in the C<assetId>
form variable, checking each one for edit privileges.
Returns the user to either the screen set by the C<proceed> form variable, or to
the Asset Manager.
=cut
sub www_duplicateList {
my $self = shift;
my $session = $self->session;
return $session->privilege->insufficient() unless $self->canEdit && $session->form->validToken;
foreach my $assetId ($session->form->param("assetId")) {
my $asset = WebGUI::Asset->newById($session,$assetId);
if ($asset->canEdit) {
my $newAsset = $asset->duplicate({skipAutoCommitWorkflows => 1});
$newAsset->update({ title=>$newAsset->getTitle.' (copy)'});
}
}
if ($session->form->process("proceed") ne "") {
my $method = "www_".$session->form->process("proceed");
return $self->$method();
}
return $self->www_manageAssets();
}
#-------------------------------------------------------------------
=head2 www_emptyClipboard ( )