X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Filsdi.pl;h=efd759b50389d8322e507a80b7b2738a3efe2b27;hb=0489f9d72fda5060cab2d9436a76b2184055d724;hp=419c0f2101b347c1051c6ad45273f90bf24567e2;hpb=5900dfff9a455bbb60b33919faa9299843c42fd3;p=koha.git diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 419c0f2101..efd759b503 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -27,7 +27,7 @@ use C4::Auth; use C4::Output; use C4::Context; use XML::Simple; -use CGI; +use CGI qw ( -utf8 ); =head1 DLF ILS-DI for Koha @@ -117,7 +117,7 @@ my %optional = ( # If no service is requested, display the online documentation unless ( $cgi->param('service') ) { my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { template_name => "ilsdi.tmpl", + { template_name => "ilsdi.tt", query => $cgi, type => "opac", authnotrequired => 1, @@ -131,7 +131,7 @@ unless ( $cgi->param('service') ) { # If user requested a service description, then display it if ( $cgi->param('service') eq "Describe" and any { $cgi->param('verb') eq $_ } @services ) { my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { template_name => "ilsdi.tmpl", + { template_name => "ilsdi.tt", query => $cgi, type => "opac", authnotrequired => 1, @@ -143,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 @@ -207,7 +211,6 @@ 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::Services::GetAvailability($cgi); exit 0; } else { @@ -228,8 +231,6 @@ if ( $service and any { $service eq $_ } @services ) { } # Output XML by passing the hashref to XMLOut -binmode STDOUT, ':encoding(UTF-8)'; -print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8'); print XMLout( $out, noattr => 1,