style nits in www_importPackage
This commit is contained in:
parent
3a9c3e5d9a
commit
e88fe856a2
1 changed files with 21 additions and 16 deletions
|
|
@ -346,10 +346,12 @@ sub www_exportPackage {
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub www_importPackage {
|
sub www_importPackage {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->session->privilege->insufficient() unless ($self->canEdit && $self->session->user->isInGroup(4));
|
my $session = $self->session;
|
||||||
my $storage = WebGUI::Storage->createTemp($self->session);
|
return $session->privilege->insufficient() unless ($self->canEdit && $session->user->isInGroup(4));
|
||||||
my $inheritPermissions = $self->session->form->process('inheritPermissions');
|
|
||||||
|
my $form = $session->form;
|
||||||
|
my $storage = WebGUI::Storage->createTemp($session);
|
||||||
|
|
||||||
##This is a hack. It should use the WebGUI::Form::File API to insulate
|
##This is a hack. It should use the WebGUI::Form::File API to insulate
|
||||||
##us from future form name changes.
|
##us from future form name changes.
|
||||||
|
|
@ -357,22 +359,25 @@ sub www_importPackage {
|
||||||
|
|
||||||
my $error = "";
|
my $error = "";
|
||||||
if ($storage->getFileExtension($storage->getFiles->[0]) eq "wgpkg") {
|
if ($storage->getFileExtension($storage->getFiles->[0]) eq "wgpkg") {
|
||||||
$error = $self->importPackage($storage, {
|
$error = $self->importPackage(
|
||||||
inheritPermissions => $inheritPermissions,
|
$storage, {
|
||||||
clearPackageFlag => $self->session->form->process('clearPackageFlag'),
|
inheritPermissions => $form->get('inheritPermissions'),
|
||||||
});
|
clearPackageFlag => $form->get('clearPackageFlag'),
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!blessed $error) {
|
if (!blessed $error) {
|
||||||
my $i18n = WebGUI::International->new($self->session, "Asset");
|
my $i18n = WebGUI::International->new($session, "Asset");
|
||||||
if ($error eq 'corrupt') {
|
my $style = $session->style;
|
||||||
return $self->session->style->userStyle($i18n->get("package corrupt"));
|
if ($error eq 'corrupt') {
|
||||||
}
|
return $style->userStyle($i18n->get("package corrupt"));
|
||||||
else {
|
}
|
||||||
return $self->session->style->userStyle($i18n->get("package extract error"));
|
else {
|
||||||
}
|
return $style->userStyle($i18n->get("package extract error"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# Handle autocommit workflows
|
# Handle autocommit workflows
|
||||||
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, {
|
if (WebGUI::VersionTag->autoCommitWorkingIfEnabled($session, {
|
||||||
allowComments => 1,
|
allowComments => 1,
|
||||||
returnUrl => $self->getUrl,
|
returnUrl => $self->getUrl,
|
||||||
}) eq 'redirect') {
|
}) eq 'redirect') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue