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 39-45 Link Here
39
                    <i class="fa fa-print"></i>
39
                    <i class="fa fa-print"></i>
40
                    Print slip
40
                    Print slip
41
                </a>
41
                </a>
42
                [% ELSE %]
43
                <a class="ar-print-request" href="#" onclick="PrintMultipleSlip(); return false;">
44
                    <i class="fa fa-print"></i>
45
                    Print slip
46
                </a>
42
                [% END %]
47
                [% END %]
48
43
            </li>
49
            </li>
44
        </ul>
50
        </ul>
45
    </div>
51
    </div>
Lines 396-401 Link Here
396
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
402
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
397
        }
403
        }
398
404
405
        function PrintMultipleSlip() {
406
            var ids = [];
407
            $( active_tab + " input[type='checkbox']:checked").each(function() {
408
                ids.push($(this).attr('reqid'));
409
            });
410
            var link = 'article-request-slip.pl?multi=1&id='+ids.join(',');
411
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
412
413
        }
414
399
        function Cancel( id, a ) {
415
        function Cancel( id, a ) {
400
            // last_cancel_reason: undefined means 'prompt for new reason'
416
            // last_cancel_reason: undefined means 'prompt for new reason'
401
            // a null value indicates that prompt was cancelled
417
            // a null value indicates that prompt was cancelled
402
- 

Return to bug 27949