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

(-)a/circ/article-request-slip.pl (-20 / +29 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 .= $slip->{is_html}?$slip->{content}:'<pre>'.$slip->{content}.'</pre>';
50
    module                 => 'circulation',
71
}
51
    letter_code            => 'AR_SLIP',
52
    message_transport_type => 'print',
53
    lang                   => $patron->lang,
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
72
64
$template->param(
73
$template->param(
65
    slip   => $slip->{content},
74
    slip => $slipContent,
66
    caller => 'article-request',
75
    caller => 'article-request',
67
    plain  => !$slip->{is_html},
76
    plain  => 0,
68
);
77
);
69
78
70
output_html_with_http_headers $cgi, $cookie, $template->output;
79
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 46-52 Link Here
46
                    <i class="fa fa-print"></i>
46
                    <i class="fa fa-print"></i>
47
                    Print slip
47
                    Print slip
48
                </a>
48
                </a>
49
                [% ELSE %]
50
                <a class="ar-print-request" href="#" onclick="PrintMultipleSlip(); return false;">
51
                    <i class="fa fa-print"></i>
52
                    Print slip
53
                </a>
49
                [% END %]
54
                [% END %]
55
50
            </li>
56
            </li>
51
        </ul>
57
        </ul>
52
    </div>
58
    </div>
Lines 442-447 Link Here
442
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
448
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
443
        }
449
        }
444
450
451
        function PrintMultipleSlip() {
452
            var ids = [];
453
            $( active_tab + " input[type='checkbox']:checked").each(function() {
454
                ids.push($(this).attr('reqid'));
455
            });
456
            var link = 'article-request-slip.pl?multi=1&id='+ids.join(',');
457
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
458
459
        }
460
445
        function Cancel( id, a ) {
461
        function Cancel( id, a ) {
446
            // last_cancel_reason: undefined means 'prompt for new reason'
462
            // last_cancel_reason: undefined means 'prompt for new reason'
447
            // a null value indicates that prompt was cancelled
463
            // a null value indicates that prompt was cancelled
448
- 

Return to bug 27949