X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FILSDI%2FServices.pm;h=067afd7a985fa8fea995778b6849a4227c83223d;hb=f74da1e83442a730e2e56866f57b9f5aef93a3f5;hp=ba0c4290526313e640de4cf0bf9f4a462e44747a;hpb=b9ccc5184197e2bf4bf6697edfdb9e70963fdee6;p=koha_gimpoz diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index ba0c429052..067afd7a98 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -193,15 +193,12 @@ sub GetRecords { # Get the biblioitem from the biblionumber my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0]; if ( not $biblioitem->{'biblionumber'} ) { - $biblioitem = "RecordNotFound"; + $biblioitem->{code} = "RecordNotFound"; } # We don't want MARC to be displayed delete $biblioitem->{'marc'}; - # nor the XML declaration of MARCXML - $biblioitem->{'marcxml'} =~ s/<\?xml version="1.0" encoding="UTF-8"\?>//go; - # Get most of the needed data my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; my @reserves = GetReservesFromBiblionumber( $biblionumber, undef, undef ); @@ -224,8 +221,6 @@ sub GetRecords { $biblioitem->{'reserves'}->{'reserve'} = $reserves[1]; $biblioitem->{'issues'}->{'issue'} = $issues; - map { $biblioitem->{$_} = encode_entities( $biblioitem->{$_}, '&' ) } grep( !/marcxml/, keys %$biblioitem ); - push @records, $biblioitem; } @@ -256,18 +251,16 @@ sub GetAuthorityRecords { return { code => 'UnsupportedSchema' }; } - my $records; + my @records; # Let's loop over the authority IDs foreach my $authid ( split( / /, $cgi->param('id') ) ) { # Get the record as XML string, or error code - my $record = GetAuthorityXML($authid) || "RecordNotFound"; - $record =~ s/<\?xml(.*)\?>//go; - $records .= $record; + push @records, GetAuthorityXML($authid) || { code => 'RecordNotFound' }; } - return $records; + return { record => \@records }; } =head2 LookupPatron @@ -322,7 +315,7 @@ sub AuthenticatePatron { my ($cgi) = @_; # Check if borrower exists, using a C4::Auth function... - unless( checkpw( C4::Context->dbh, $cgi->param('username'), $cgi->param('password') ) ) { + unless( C4::Auth::checkpw( C4::Context->dbh, $cgi->param('username'), $cgi->param('password') ) ) { return { code => 'PatronNotFound' }; }