From cc69c6961408eab9aaaedb8130e7a0faf34ba67a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 12 Oct 2023 13:32:08 +0000 Subject: [PATCH] Bug 33547: (QA follow-up) Tidy Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- Koha/Preservation/Train/Item.pm | 3 ++- preservation/home.pl | 8 ++++---- preservation/print_slip.pl | 22 +++++++++++----------- t/db_dependent/Koha/Preservation/Trains.t | 6 ++++-- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Koha/Preservation/Train/Item.pm b/Koha/Preservation/Train/Item.pm index b6c65de52b..3a0b4ffbc9 100644 --- a/Koha/Preservation/Train/Item.pm +++ b/Koha/Preservation/Train/Item.pm @@ -62,6 +62,7 @@ sub catalogue_item { return Koha::Item->_new_from_dbic($item_rs); } + =head3 train Return the train object for this item @@ -69,7 +70,7 @@ Return the train object for this item =cut sub train { - my ( $self ) = @_; + my ($self) = @_; my $rs = $self->_result->train; return Koha::Preservation::Train->_new_from_dbic($rs); } diff --git a/preservation/home.pl b/preservation/home.pl index b5f3d2e03f..1f05666703 100755 --- a/preservation/home.pl +++ b/preservation/home.pl @@ -48,10 +48,10 @@ $template->param( biblioitems => Koha::Biblioitem->to_api_mapping, biblio => Koha::Biblio->to_api_mapping, }, - notice_templates => - [ map { { id => $_->id, code => $_->code, name => $_->name } } - Koha::Notice::Templates->search( { module => 'preservation' } ) - ->as_list ], + notice_templates => [ + map { { id => $_->id, code => $_->code, name => $_->name } } + Koha::Notice::Templates->search( { module => 'preservation' } )->as_list + ], ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/preservation/print_slip.pl b/preservation/print_slip.pl index ec3687ba0f..f54d356825 100755 --- a/preservation/print_slip.pl +++ b/preservation/print_slip.pl @@ -25,24 +25,24 @@ use C4::Letters; use Koha::Patrons; use Koha::Preservation::Train::Items; -my $input = CGI->new; +my $input = CGI->new; my $train_item_id = $input->param('train_item_id'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "circ/printslip.tt", - query => $input, - type => "intranet", - flagsrequired => { preservation => '*' }, + template_name => "circ/printslip.tt", + query => $input, + type => "intranet", + flagsrequired => { preservation => '*' }, } ); my $logged_in_user = Koha::Patrons->find($loggedinuser); -my $branch = C4::Context->userenv->{'branch'}; +my $branch = C4::Context->userenv->{'branch'}; my $train_item = Koha::Preservation::Train::Items->find($train_item_id); -unless ($train_item){ +unless ($train_item) { print $input->redirect("/cgi-bin/koha/errors/404.pl"); exit; } @@ -64,12 +64,12 @@ my $slip = $letter->{content}; my $is_html = $letter->{is_html}; $template->param( - slip => $slip, - plain => !$is_html, - caller => 'preservation', + slip => $slip, + plain => !$is_html, + caller => 'preservation', stylesheet => C4::Context->preference("SlipCSS"), ); -$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) ); +$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS') ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/t/db_dependent/Koha/Preservation/Trains.t b/t/db_dependent/Koha/Preservation/Trains.t index 11d20447b4..7b6f71a5a1 100755 --- a/t/db_dependent/Koha/Preservation/Trains.t +++ b/t/db_dependent/Koha/Preservation/Trains.t @@ -110,9 +110,11 @@ subtest 'add_items & items' => sub { is( $item_2->get_from_storage->notforloan, 0 ); is( $item_3->get_from_storage->notforloan, $not_for_loan_train_in ); - is( ref( $item_train_1->train ), + is( + ref( $item_train_1->train ), 'Koha::Preservation::Train', - 'Train::Item->train returns a Koha::Preservation::Train object' ); + 'Train::Item->train returns a Koha::Preservation::Train object' + ); warning_is { $train->add_item( { item_id => $item_2->itemnumber }, { skip_waiting_list_check => 1 } ); -- 2.39.5