X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=serials%2Frouting-preview.pl;h=db0984c059732b6f14dbcaecb316c30ef75ad36a;hb=e20270fec4f6d34f01050bea4c5765d5b3c4ed33;hp=6746f53938d7ac85ae1199bd6c842aa7aa730d7e;hpb=324615e396be7fadc8ba3cfa1a9f6025e900df3a;p=srvgit diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 6746f53938..db0984c059 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -20,7 +20,7 @@ # of reserves for the serial use strict; use warnings; -use CGI; +use CGI qw ( -utf8 ); use C4::Koha; use C4::Auth; use C4::Dates; @@ -71,8 +71,9 @@ if($ok){ if (C4::Context->preference('RoutingListAddReserves')){ # get existing reserves ..... - my ($count,$reserves) = GetReservesFromBiblionumber($biblio); - my $totalcount = $count; + my $reserves = GetReservesFromBiblionumber({ biblionumber => $biblio }); + my $count = scalar( @$reserves ); + my $totalcount = $count; foreach my $res (@$reserves) { if ($res->{'found'} eq 'W') { $count--; @@ -87,7 +88,12 @@ if($ok){ my $reserve = $sth->fetchrow_hashref; if($routing->{borrowernumber} == $reserve->{borrowernumber}){ - ModReserve($routing->{ranking},$biblio,$routing->{borrowernumber},$branch); + ModReserve({ + rank => $routing->{ranking}, + biblionumber => $biblio, + borrowernumber => $routing->{borrowernumber}, + branchcode => $branch + }); } else { AddReserve($branch,$routing->{borrowernumber},$biblio,$const,\@bibitems,$routing->{ranking}, undef, undef, $notes,$title); } @@ -95,21 +101,21 @@ if($ok){ } ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "serials/routing-preview-slip.tmpl", += get_template_and_user({template_name => "serials/routing-preview-slip.tt", query => $query, type => "intranet", authnotrequired => 0, - flagsrequired => {serials => 'routing'}, + flagsrequired => {serials => '*'}, debug => 1, }); $template->param("libraryname"=>$branchname); } else { ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "serials/routing-preview.tmpl", += get_template_and_user({template_name => "serials/routing-preview.tt", query => $query, type => "intranet", authnotrequired => 0, - flagsrequired => {serials => 'routing'}, + flagsrequired => {serials => '*'}, debug => 1, }); } @@ -127,11 +133,13 @@ $routingnotes =~ s/\n/\
/g; $template->param( title => $subs->{'bibliotitle'}, issue => $issue, - issue_escaped => URI::Escape::uri_escape($issue), + issue_escaped => URI::Escape::uri_escape_utf8($issue), subscriptionid => $subscriptionid, memberloop => $memberloop, routingnotes => $routingnotes, + generalroutingnote => C4::Context->preference('RoutingListNote'), hasRouting => check_routing($subscriptionid), + (uc(C4::Context->preference("marcflavour"))) => 1 ); output_html_with_http_headers $query, $cookie, $template->output;