Bugzilla – Attachment 42591 Details for
Bug 14321
Merge UploadedFile and UploadedFiles into Koha::Upload
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14321: [QA Follow-up] Perltidy upload.pl
Bug-14321-QA-Follow-up-Perltidy-uploadpl.patch (text/plain), 4.01 KB, created by
Marcel de Rooy
on 2015-09-16 12:12:45 UTC
(
hide
)
Description:
Bug 14321: [QA Follow-up] Perltidy upload.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-09-16 12:12:45 UTC
Size:
4.01 KB
patch
obsolete
>From 568507b7407ca53a7decd52aaeab48a9a0081689 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 16 Sep 2015 14:06:59 +0200 >Subject: [PATCH] Bug 14321: [QA Follow-up] Perltidy upload.pl >Content-Type: text/plain; charset=utf-8 > >Run perltidy -pro=xt/perltidyrc on tools/upload.pl. >No other changes. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > tools/upload.pl | 63 +++++++++++++++++++++++++++++-------------------------- > 1 file changed, 33 insertions(+), 30 deletions(-) > >diff --git a/tools/upload.pl b/tools/upload.pl >index 47c28f5..5d9c8e7 100755 >--- a/tools/upload.pl >+++ b/tools/upload.pl >@@ -25,13 +25,13 @@ use C4::Auth; > use C4::Output; > use Koha::Upload; > >-my $input = CGI::->new; >-my $op = $input->param('op') // 'new'; >+my $input = CGI::->new; >+my $op = $input->param('op') // 'new'; > my $plugin = $input->param('plugin'); >-my $index = $input->param('index'); # MARC editor input field id >-my $term = $input->param('term'); >-my $id = $input->param('id'); >-my $msg = $input->param('msg'); >+my $index = $input->param('index'); # MARC editor input field id >+my $term = $input->param('term'); >+my $id = $input->param('id'); >+my $msg = $input->param('msg'); > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { template_name => "tools/upload.tt", >@@ -47,50 +47,53 @@ $template->param( > index => $index, > ); > >-my $upar = $plugin? { public => 1 }: {}; >-if( $op eq 'new' ) { >+my $upar = $plugin ? { public => 1 } : {}; >+if ( $op eq 'new' ) { > $template->param( >- mode => 'new', >+ mode => 'new', > uploadcategories => Koha::Upload->getCategories, > ); > output_html_with_http_headers $input, $cookie, $template->output; >-} elsif( $op eq 'search' ) { >- my $h = $id? { id => $id }: { term => $term }; >- my @uploads = Koha::Upload->new( $upar )->get( $h ); >+} elsif ( $op eq 'search' ) { >+ my $h = $id ? { id => $id } : { term => $term }; >+ my @uploads = Koha::Upload->new($upar)->get($h); > $template->param( >- mode => 'report', >- msg => $msg, >+ mode => 'report', >+ msg => $msg, > uploads => \@uploads, > ); > output_html_with_http_headers $input, $cookie, $template->output; >-} elsif( $op eq 'delete' ) { >+} elsif ( $op eq 'delete' ) { >+ > # delete only takes the id parameter >- my $upl = Koha::Upload->new( $upar ); >- my ( $fn ) = $upl->delete({ id => $id }); >+ my $upl = Koha::Upload->new($upar); >+ my ($fn) = $upl->delete( { id => $id } ); > my $e = $upl->err; >- my $msg = $fn? JSON::to_json({ $fn => 6 }): >- $e? JSON::to_json( $e ): undef; >+ my $msg = >+ $fn ? JSON::to_json( { $fn => 6 } ) >+ : $e ? JSON::to_json($e) >+ : undef; > $template->param( >- mode => 'deleted', >- msg => $msg, >+ mode => 'deleted', >+ msg => $msg, > uploadcategories => $upl->getCategories, > ); > output_html_with_http_headers $input, $cookie, $template->output; >-} elsif( $op eq 'download' ) { >- my $upl = Koha::Upload->new( $upar ); >- my $rec = $upl->get({ id => $id, filehandle => 1 }); >- my $fh = $rec->{fh}; >- if( !$rec || !$fh ) { >+} elsif ( $op eq 'download' ) { >+ my $upl = Koha::Upload->new($upar); >+ my $rec = $upl->get( { id => $id, filehandle => 1 } ); >+ my $fh = $rec->{fh}; >+ if ( !$rec || !$fh ) { > $template->param( >- mode => 'new', >- msg => JSON::to_json({ $id => 5 }), >+ mode => 'new', >+ msg => JSON::to_json( { $id => 5 } ), > uploadcategories => $upl->getCategories, > ); > output_html_with_http_headers $input, $cookie, $template->output; > } else { > my @hdr = $upl->httpheaders( $rec->{name} ); >- print Encode::encode_utf8( $input->header( @hdr ) ); >- while( <$fh> ) { >+ print Encode::encode_utf8( $input->header(@hdr) ); >+ while (<$fh>) { > print $_; > } > $fh->close; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14321
:
41498
|
41499
|
41500
|
41501
|
41555
|
41556
|
41557
|
41558
|
41559
|
41560
|
41561
|
41562
|
41665
|
41666
|
41667
|
41668
|
41669
|
41677
|
41873
|
41874
|
41875
|
41876
|
41877
|
41878
|
41879
|
41880
|
41881
|
42411
|
42412
|
42413
|
42414
|
42558
|
42559
|
42560
|
42561
|
42584
|
42587
|
42588
|
42589
|
42590
|
42591
|
42660
|
42661
|
42662
|
42663
|
42664
|
42665
|
42666
|
42707
|
42726
|
42727
|
42728
|
42729
|
42730
|
42731
|
42732
|
42889
|
42890