diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index 97c242fda..c5d958803 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -12,6 +12,8 @@
Default' ( Martin Kamerbeek / Oqapi )
- fixed: In the Asset Manager, if you pasted an asset if returned you to the page instead the manager.
- fixed: In the Asset Manager, only display a Select All button if there is more than one asset.
+ - fixed: Add a progress indicator for long running functions so the user knows something is happening.
+ - fixed: In the Asset Manager, if you pasted an package or prototype 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/Asset.pm b/lib/WebGUI/Asset.pm
index 3d71043b9..ab1a7694a 100644
--- a/lib/WebGUI/Asset.pm
+++ b/lib/WebGUI/Asset.pm
@@ -36,6 +36,7 @@ use WebGUI::Form;
use WebGUI::HTML;
use WebGUI::HTMLForm;
use WebGUI::Keyword;
+use WebGUI::ProgressBar;
use WebGUI::Search::Index;
use WebGUI::TabForm;
use WebGUI::Utility;
diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm
index 3d35ada51..80b84d72f 100644
--- a/lib/WebGUI/AssetClipboard.pm
+++ b/lib/WebGUI/AssetClipboard.pm
@@ -35,9 +35,6 @@ These methods are available from this class:
=cut
-
-
-
#-------------------------------------------------------------------
=head2 canPaste ( )
@@ -183,8 +180,8 @@ Alphanumeric ID tag of Asset.
=cut
sub paste {
- my $self = shift;
- my $assetId = shift;
+ my $self = shift;
+ my $assetId = shift;
my $pastedAsset = WebGUI::Asset->newByDynamicClass($self->session,$assetId);
return 0 unless ($self->get("state") eq "published");
return 0 unless ($pastedAsset->canPaste()); ##Allow pasted assets to have a say about pasting.
@@ -508,17 +505,53 @@ sub www_pasteList {
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);
- }
- if ($form->param("proceed") eq 'manageAssets') {
- return $self->www_manageAssets();
+ my $pb = WebGUI::ProgressBar->new($session);
+ ##Need to store the list of assetIds for the status subroutine
+ my @assetIds = $form->param('assetId');
+ $session->scratch->set('assetPasteList', JSON::to_json(\@assetIds));
+ if ($form->param('proceed') eq 'manageAssets') {
+ $session->scratch->set('assetPasteReturnUrl', $self->getUrl('op=manageAssets'));
}
else {
- return "";
+ $session->scratch->set('assetPasteReturnUrl', $self->getUrl);
}
+ $session->scratch->set('assetPasteList', JSON::to_json(\@assetIds));
+ ##Need to set the URL that should be displayed when it is done
+ my $i18n = WebGUI::International->new($session, 'Asset');
+ $pb->setIcon($session->url->extras('adminConsole/assets.gif'));
+ return $pb->render({
+ title => $i18n->get('Paste Assets'),
+ statusUrl => $self->getUrl('func=pasteListStatus'),
+ });
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_pasteListStatus ( )
+
+Pastes a selection of assets. If canEdit is False, returns an insufficient privileges page.
+Returns the user to the manageAssets screen.
+
+=cut
+
+sub www_pasteListStatus {
+ my $self = shift;
+ my $session = $self->session;
+ my $pb = WebGUI::ProgressBar->new($session);
+ if (! $self->canEdit ) {
+ return $session->privilege->insufficient('no style')."return to site";
+ }
+ my $assetIds = $session->scratch->get('assetPasteList') || '[]';
+ my @assetIds = @{ JSON::from_json($assetIds) };
+ my $i18n = WebGUI::International->new($session, 'Asset');
+ ASSET: foreach my $clipId (@assetIds) {
+ my $pasteAsset = WebGUI::Asset->newPending($session, $clipId);
+ next ASSET unless $pasteAsset && $pasteAsset->canEdit;
+ $pb->print(sprintf $i18n->get("Pasting %s"), $pasteAsset->getTitle);
+ $self->paste($clipId);
+ }
+ $pb->redirect( $session->scratch->get('assetPasteReturnUrl') );
+ return "";
}
diff --git a/lib/WebGUI/Content/AssetManager.pm b/lib/WebGUI/Content/AssetManager.pm
index aa44b7426..c2d3930e1 100644
--- a/lib/WebGUI/Content/AssetManager.pm
+++ b/lib/WebGUI/Content/AssetManager.pm
@@ -474,6 +474,7 @@ ENDHTML
$output .= '