View | Details | Raw Unified | Return to bug 33547
Collapse All | Expand All

(-)a/Koha/Preservation/Train/Item.pm (-1 / +2 lines)
Lines 62-67 sub catalogue_item { Link Here
62
    return Koha::Item->_new_from_dbic($item_rs);
62
    return Koha::Item->_new_from_dbic($item_rs);
63
}
63
}
64
64
65
65
=head3 train
66
=head3 train
66
67
67
Return the train object for this item
68
Return the train object for this item
Lines 69-75 Return the train object for this item Link Here
69
=cut
70
=cut
70
71
71
sub train {
72
sub train {
72
    my ( $self ) = @_;
73
    my ($self) = @_;
73
    my $rs = $self->_result->train;
74
    my $rs = $self->_result->train;
74
    return Koha::Preservation::Train->_new_from_dbic($rs);
75
    return Koha::Preservation::Train->_new_from_dbic($rs);
75
}
76
}
(-)a/preservation/home.pl (-4 / +4 lines)
Lines 48-57 $template->param( Link Here
48
        biblioitems => Koha::Biblioitem->to_api_mapping,
48
        biblioitems => Koha::Biblioitem->to_api_mapping,
49
        biblio      => Koha::Biblio->to_api_mapping,
49
        biblio      => Koha::Biblio->to_api_mapping,
50
    },
50
    },
51
    notice_templates =>
51
    notice_templates => [
52
      [ map { { id => $_->id, code => $_->code, name => $_->name } }
52
        map { { id => $_->id, code => $_->code, name => $_->name } }
53
          Koha::Notice::Templates->search( { module => 'preservation' } )
53
            Koha::Notice::Templates->search( { module => 'preservation' } )->as_list
54
          ->as_list ],
54
    ],
55
);
55
);
56
56
57
output_html_with_http_headers $query, $cookie, $template->output;
57
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/preservation/print_slip.pl (-11 / +11 lines)
Lines 25-48 use C4::Letters; Link Here
25
use Koha::Patrons;
25
use Koha::Patrons;
26
use Koha::Preservation::Train::Items;
26
use Koha::Preservation::Train::Items;
27
27
28
my $input = CGI->new;
28
my $input         = CGI->new;
29
my $train_item_id = $input->param('train_item_id');
29
my $train_item_id = $input->param('train_item_id');
30
30
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
32
    {
33
        template_name   => "circ/printslip.tt",
33
        template_name => "circ/printslip.tt",
34
        query           => $input,
34
        query         => $input,
35
        type            => "intranet",
35
        type          => "intranet",
36
        flagsrequired   => { preservation => '*' },
36
        flagsrequired => { preservation => '*' },
37
    }
37
    }
38
);
38
);
39
39
40
my $logged_in_user = Koha::Patrons->find($loggedinuser);
40
my $logged_in_user = Koha::Patrons->find($loggedinuser);
41
my $branch = C4::Context->userenv->{'branch'};
41
my $branch         = C4::Context->userenv->{'branch'};
42
42
43
my $train_item = Koha::Preservation::Train::Items->find($train_item_id);
43
my $train_item = Koha::Preservation::Train::Items->find($train_item_id);
44
44
45
unless ($train_item){
45
unless ($train_item) {
46
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
46
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
47
    exit;
47
    exit;
48
}
48
}
Lines 64-75 my $slip = $letter->{content}; Link Here
64
my $is_html = $letter->{is_html};
64
my $is_html = $letter->{is_html};
65
65
66
$template->param(
66
$template->param(
67
    slip => $slip,
67
    slip       => $slip,
68
    plain => !$is_html,
68
    plain      => !$is_html,
69
    caller => 'preservation',
69
    caller     => 'preservation',
70
    stylesheet => C4::Context->preference("SlipCSS"),
70
    stylesheet => C4::Context->preference("SlipCSS"),
71
);
71
);
72
72
73
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );
73
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS') );
74
74
75
output_html_with_http_headers $input, $cookie, $template->output;
75
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/t/db_dependent/Koha/Preservation/Trains.t (-3 / +4 lines)
Lines 110-118 subtest 'add_items & items' => sub { Link Here
110
    is( $item_2->get_from_storage->notforloan, 0 );
110
    is( $item_2->get_from_storage->notforloan, 0 );
111
    is( $item_3->get_from_storage->notforloan, $not_for_loan_train_in );
111
    is( $item_3->get_from_storage->notforloan, $not_for_loan_train_in );
112
112
113
    is( ref( $item_train_1->train ),
113
    is(
114
        ref( $item_train_1->train ),
114
        'Koha::Preservation::Train',
115
        'Koha::Preservation::Train',
115
        'Train::Item->train returns a Koha::Preservation::Train object' );
116
        'Train::Item->train returns a Koha::Preservation::Train object'
117
    );
116
118
117
    warning_is {
119
    warning_is {
118
        $train->add_item( { item_id => $item_2->itemnumber }, { skip_waiting_list_check => 1 } );
120
        $train->add_item( { item_id => $item_2->itemnumber }, { skip_waiting_list_check => 1 } );
119
- 

Return to bug 33547