From e0e8a1305df5cc58eb568ce64d61f358299ae45d 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 --- Koha/Preservation/Train/Item.pm | 3 ++- preservation/home.pl | 14 +++++++------- preservation/print_slip.pl | 22 +++++++++++----------- t/db_dependent/Koha/Preservation/Trains.t | 6 ++++-- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Koha/Preservation/Train/Item.pm b/Koha/Preservation/Train/Item.pm index 6089ae5d3b..bc02c791e2 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 a13c48dedc..1ae4aced0b 100755 --- a/preservation/home.pl +++ b/preservation/home.pl @@ -40,18 +40,18 @@ $template->param( map { my $table = $_; map { ( $table . '.' . $_ => $columns->{$table}->{$_} ) } - keys %{ $columns->{$table} } + keys %{ $columns->{$table} } } qw( biblio biblioitems items ) }, api_mappings => { - items => Koha::Item->to_api_mapping, + items => Koha::Item->to_api_mapping, biblioitems => Koha::Biblioitem->to_api_mapping, - biblio => Koha::Biblio->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 d881c5d89f..a5866d42d2 100755 --- a/t/db_dependent/Koha/Preservation/Trains.t +++ b/t/db_dependent/Koha/Preservation/Trains.t @@ -99,9 +99,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.30.2