From 4320d39b1c7df7beb3d0c20669daf4b907c45ecd Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 17 Jun 2009 15:38:08 +0000 Subject: [PATCH] Pasting from the AdminBar in the AssetManager should leave you in the manager. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/AssetClipboard.pm | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e22ac3039..c741bde91 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,6 +10,7 @@ - fixed bug in Thingy where the style template would not be processed after editing a Thing and the 'return after edit' setting was set to 'Thing Default' ( Martin Kamerbeek / Oqapi ) + - fixed: In the Asset Manager, if you pasted an asset if returned you to the page instead the manager. 7.7.10 - Made a change to LDAP auth that adds an OR to that query so that it also searches for a row with fieldData REGEXP '^uid=(value-from-ldap-directory-server),'. (Wes Morgan) diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 8da7ff7b6..3d35ada51 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -489,7 +489,7 @@ sub www_paste { return $session->privilege->insufficient() unless $self->canEdit; my $pasteAssetId = $session->form->process('assetId'); my $pasteAsset = WebGUI::Asset->newPending($session, $pasteAssetId); - return $session->privilege->insufficient() unless $pasteAsset->canEdit; + return $session->privilege->insufficient() unless $pasteAsset && $pasteAsset->canEdit; $self->paste($pasteAssetId); return ""; } @@ -498,19 +498,27 @@ sub www_paste { =head2 www_pasteList ( ) -Returns a www_manageAssets() method. Pastes a selection of assets. If canEdit is False, returns an insufficient privileges page. +Pastes a selection of assets. If canEdit is False, returns an insufficient privileges page. +Returns the user to the manageAssets screen. =cut sub www_pasteList { - my $self = shift; - return $self->session->privilege->insufficient() unless $self->canEdit; - ASSET: foreach my $clipId ($self->session->form->param("assetId")) { - my $pasteAsset = WebGUI::Asset->newPending($self->session, $clipId); + my $self = shift; + my $session = $self->session; + return $session->privilege->insufficient() unless $self->canEdit; + my $form = $session->form; + ASSET: foreach my $clipId ($form->param("assetId")) { + my $pasteAsset = WebGUI::Asset->newPending($session, $clipId); next ASSET unless $pasteAsset->canEdit; $self->paste($clipId); } - return $self->www_manageAssets(); + if ($form->param("proceed") eq 'manageAssets') { + return $self->www_manageAssets(); + } + else { + return ""; + } }