X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0bfbcce6e77e0f9d83e4f54f3fe9da7edcc866f3..4f99ff6136d6198ba3f7a842c903deaaf4e47a1b:/SL/Controller/File.pm diff --git a/SL/Controller/File.pm b/SL/Controller/File.pm index 05884dd4f..add213b04 100644 --- a/SL/Controller/File.pm +++ b/SL/Controller/File.pm @@ -173,21 +173,25 @@ sub action_ajax_rename { } else { # normal rename + my $res; + eval { - my $res = $file->rename($::form->{to}); + $res = $file->rename($::form->{to}); $main::lxdebug->message(LXDebug->DEBUG2(), "rename result=".$res); - if ($res > SL::File::RENAME_OK) { - $self->js->flash('error', - $res == SL::File::RENAME_EXISTS ? $::locale->text('File still exists !') - : $res == SL::File::RENAME_SAME ? $::locale->text('Same Filename !') - : $::locale->text('File not exists !'))->render; - return 1; - } 1; } or do { $self->js->flash( 'error', t8('internal error (see details)')) ->flash_detail('error', $@)->render; return; + }; + + if ($res != SL::File::RENAME_OK) { + $self->js->flash('error', + $res == SL::File::RENAME_EXISTS ? $::locale->text('File still exists !') + : $res == SL::File::RENAME_SAME ? $::locale->text('Same Filename !') + : $::locale->text('File not exists !')) + ->render; + return; } } $self->is_global($::form->{is_global}); @@ -309,8 +313,8 @@ sub action_download { sub check_object_params { my ($self) = @_; - my $id = $::form->{object_id} +0; - my $draftid = $::form->{draft_id} +0; + my $id = ($::form->{object_id} // 0) * 1; + my $draftid = ($::form->{draft_id} // 0) * 1; my $gldoc = 0; my $type = undef; @@ -604,7 +608,7 @@ SL::Controller::File - Controller for managing files =head1 DESCRIPTION -This is a controller for handling files in a storage independant way. +This is a controller for handling files in a storage independent way. The storage may be a Filesystem,a WebDAV, a Database or DMS. These backends must be configered in ClientConfig. This Controller use as intermediate layer for storage C. @@ -619,7 +623,7 @@ More description of the intermediate layer see L. =head2 C This loads a list of files on a webpage. This can be done with a normal submit or via an ajax/json call. -Dependant of file_type different sources are available. +Dependent of file_type different sources are available. For documents there are the 'created' source and the imports from scanners or email. For attachments and images only the 'uploaded' source available. @@ -744,7 +748,7 @@ The ids of the files to delete. Only this files are deleted not all versions of =head2 C -Some files can be unimported, dependant of the source of the file. This means they are moved +Some files can be unimported, dependent of the source of the file. This means they are moved back to the directory of the source Available C
: @@ -767,4 +771,3 @@ One file can be renamed. There can be some checks if the same filename still exi Martin Helmling Emartin.helmling@opendynamic.deE =cut -