Bug 33547: (QA follow-up) Tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-10-12 13:32:08 +00:00 committed by Tomas Cohen Arazi
parent 4fad116545
commit cc69c69614
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
4 changed files with 21 additions and 18 deletions

View file

@ -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);
}

View file

@ -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;

View file

@ -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;

View file

@ -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 } );