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

(-)a/circ/article-request-slip.pl (-20 / +32 lines)
Lines 30-36 use Koha::Patrons; Link Here
30
30
31
my $cgi = CGI->new;
31
my $cgi = CGI->new;
32
32
33
my $id = $cgi->param('id');
33
my @ids = split( ',', $cgi->param('id') );
34
34
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
36
    {
36
    {
Lines 41-70 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
41
    }
41
    }
42
);
42
);
43
43
44
my $ar = Koha::ArticleRequests->find($id);
44
my $ars         = Koha::ArticleRequests->search( { id => { '-in' => \@ids } } );
45
my $slipContent = '';
46
my $first       = 1;
47
while ( my $ar = $ars->next ) {
48
    if ( !$first ) {
49
        $slipContent .= "<hr/>";
50
    }
51
    $first = 0;
52
    $template->param( article_request => $ar );
53
    my $patron = Koha::Patrons->find( $ar->borrowernumber );
45
54
46
$template->param( article_request => $ar );
55
    my $slip = C4::Letters::GetPreparedLetter(
47
my $patron = Koha::Patrons->find( $ar->borrowernumber );
56
        module                 => 'circulation',
57
        letter_code            => 'AR_SLIP',
58
        message_transport_type => 'print',
59
        lang                   => $patron->lang,
60
        tables                 => {
61
            article_requests => $ar->id,
62
            borrowers        => $ar->borrowernumber,
63
            biblio           => $ar->biblionumber,
64
            biblioitems      => $ar->biblionumber,
65
            items            => $ar->itemnumber,
66
            branches         => $ar->branchcode,
67
        },
68
    );
48
69
49
my $slip = C4::Letters::GetPreparedLetter(
70
    $slipContent .=
50
    module                 => 'circulation',
71
        $slip->{is_html}
51
    letter_code            => 'AR_SLIP',
72
      ? $slip->{content}
52
    message_transport_type => 'print',
73
      : '<pre>' . $slip->{content} . '</pre>';
53
    lang                   => $patron->lang,
74
}
54
    tables                 => {
55
        article_requests => $ar->id,
56
        borrowers        => $ar->borrowernumber,
57
        biblio           => $ar->biblionumber,
58
        biblioitems      => $ar->biblionumber,
59
        items            => $ar->itemnumber,
60
        branches         => $ar->branchcode,
61
    },
62
);
63
75
64
$template->param(
76
$template->param(
65
    slip   => $slip->{content},
77
    slip => $slipContent,
66
    caller => 'article-request',
78
    caller => 'article-request',
67
    plain  => !$slip->{is_html},
79
    plain  => 0,
68
);
80
);
69
81
70
output_html_with_http_headers $cgi, $cookie, $template->output;
82
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (-1 / +16 lines)
Lines 52-58 Link Here
52
                    <i class="fa fa-print"></i>
52
                    <i class="fa fa-print"></i>
53
                    Print slip
53
                    Print slip
54
                </a>
54
                </a>
55
                [% ELSE %]
56
                <a class="ar-print-request" href="#" onclick="PrintMultipleSlip(); return false;">
57
                    <i class="fa fa-print"></i>
58
                    Print slip
59
                </a>
55
                [% END %]
60
                [% END %]
61
56
            </li>
62
            </li>
57
        </ul>
63
        </ul>
58
        </span>
64
        </span>
Lines 645-650 Link Here
645
            }, cancel_id, cancel_a)
651
            }, cancel_id, cancel_a)
646
        });
652
        });
647
653
654
        function PrintMultipleSlip() {
655
            var ids = [];
656
            $( active_tab + " input[type='checkbox']:checked").each(function() {
657
                ids.push($(this).attr('reqid'));
658
            });
659
            var link = 'article-request-slip.pl?multi=1&id='+ids.join(',');
660
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
661
662
        }
663
648
        function Cancel( id, a ) {
664
        function Cancel( id, a ) {
649
            cancel_id = id;
665
            cancel_id = id;
650
            cancel_a = a;
666
            cancel_a = a;
651
- 

Return to bug 27949