X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Filsdi.pl;h=d68f09af8466cd022b537b58b129b98376db1194;hb=92d021f989227fa798b13f63abae4ebf53744d17;hp=4f4b17736e029b0269e95fb2b0f9a36bfd13aa47;hpb=f3581a594e77ebd282be560d20775e2d7a16259f;p=koha_fer diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 4f4b17736e..d68f09af84 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -20,6 +20,8 @@ use strict; use warnings; +use List::MoreUtils qw(any); + use C4::ILSDI::Services; use C4::Auth; use C4::Output; @@ -141,6 +143,10 @@ if ( $cgi->param('service') eq "Describe" and any { $cgi->param('verb') eq $_ } exit 0; } +# any output after this point will be UTF-8 XML +binmode STDOUT, ':encoding(UTF-8)'; +print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8'); + my $out; # If ILS-DI module is disabled in System->Preferences, redirect to 404 @@ -205,8 +211,7 @@ if ( $service and any { $service eq $_ } @services ) { # GetAvailability is a special case, as it cannot use XML::Simple if ( $service eq "GetAvailability" ) { - print CGI::header('text/xml'); - print C4::ILSDI::GetAvailability($cgi); + print C4::ILSDI::Services::GetAvailability($cgi); exit 0; } else { @@ -226,11 +231,9 @@ if ( $service and any { $service eq $_ } @services ) { } # Output XML by passing the hashref to XMLOut -print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8'); print XMLout( $out, noattr => 1, - noescape => 1, nosort => 1, xmldecl => '', RootName => $service,