@@ -, +, @@ --- circ/article-request-slip.pl | 49 +++++++++++-------- .../prog/en/modules/circ/article-requests.tt | 16 ++++++ 2 files changed, 45 insertions(+), 20 deletions(-) --- a/circ/article-request-slip.pl +++ a/circ/article-request-slip.pl @@ -30,7 +30,7 @@ use Koha::Patrons; my $cgi = CGI->new; -my $id = $cgi->param('id'); +my @ids = split( ',', $cgi->param('id') ); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -41,30 +41,39 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $ar = Koha::ArticleRequests->find($id); +my $ars = Koha::ArticleRequests->search({id => {'-in' => \@ids}}); +my $slipContent = ''; +my $first=1; +while(my $ar = $ars->next) { + if(!$first) { + $slipContent .= "
"; + } + $first = 0; + $template->param( article_request => $ar ); + my $patron = Koha::Patrons->find( $ar->borrowernumber ); -$template->param( article_request => $ar ); -my $patron = Koha::Patrons->find( $ar->borrowernumber ); + my $slip = C4::Letters::GetPreparedLetter( + module => 'circulation', + letter_code => 'AR_SLIP', + message_transport_type => 'print', + lang => $patron->lang, + tables => { + article_requests => $ar->id, + borrowers => $ar->borrowernumber, + biblio => $ar->biblionumber, + biblioitems => $ar->biblionumber, + items => $ar->itemnumber, + branches => $ar->branchcode, + }, + ); -my $slip = C4::Letters::GetPreparedLetter( - module => 'circulation', - letter_code => 'AR_SLIP', - message_transport_type => 'print', - lang => $patron->lang, - tables => { - article_requests => $ar->id, - borrowers => $ar->borrowernumber, - biblio => $ar->biblionumber, - biblioitems => $ar->biblionumber, - items => $ar->itemnumber, - branches => $ar->branchcode, - }, -); + $slipContent .= $slip->{is_html}?$slip->{content}:'
'.$slip->{content}.'
'; +} $template->param( - slip => $slip->{content}, + slip => $slipContent, caller => 'article-request', - plain => !$slip->{is_html}, + plain => 0, ); output_html_with_http_headers $cgi, $cookie, $template->output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt @@ -46,7 +46,13 @@ Print slip + [% ELSE %] + + + Print slip + [% END %] + @@ -442,6 +448,16 @@ window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); } + function PrintMultipleSlip() { + var ids = []; + $( active_tab + " input[type='checkbox']:checked").each(function() { + ids.push($(this).attr('reqid')); + }); + var link = 'article-request-slip.pl?multi=1&id='+ids.join(','); + window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); + + } + function Cancel( id, a ) { // last_cancel_reason: undefined means 'prompt for new reason' // a null value indicates that prompt was cancelled --