View | Details | Raw Unified | Return to bug 5639
Collapse All | Expand All

(-)a/C4/ILSDI/Services.pm (-11 / +4 lines)
Lines 193-207 sub GetRecords { Link Here
193
        # Get the biblioitem from the biblionumber
193
        # Get the biblioitem from the biblionumber
194
        my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0];
194
        my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0];
195
        if ( not $biblioitem->{'biblionumber'} ) {
195
        if ( not $biblioitem->{'biblionumber'} ) {
196
            $biblioitem = "RecordNotFound";
196
            $biblioitem->{code} = "RecordNotFound";
197
        }
197
        }
198
198
199
        # We don't want MARC to be displayed
199
        # We don't want MARC to be displayed
200
        delete $biblioitem->{'marc'};
200
        delete $biblioitem->{'marc'};
201
201
202
        # nor the XML declaration of MARCXML
203
        $biblioitem->{'marcxml'} =~ s/<\?xml version="1.0" encoding="UTF-8"\?>//go;
204
205
        # Get most of the needed data
202
        # Get most of the needed data
206
        my $biblioitemnumber = $biblioitem->{'biblioitemnumber'};
203
        my $biblioitemnumber = $biblioitem->{'biblioitemnumber'};
207
        my @reserves         = GetReservesFromBiblionumber( $biblionumber, undef, undef );
204
        my @reserves         = GetReservesFromBiblionumber( $biblionumber, undef, undef );
Lines 224-231 sub GetRecords { Link Here
224
        $biblioitem->{'reserves'}->{'reserve'} = $reserves[1];
221
        $biblioitem->{'reserves'}->{'reserve'} = $reserves[1];
225
        $biblioitem->{'issues'}->{'issue'}     = $issues;
222
        $biblioitem->{'issues'}->{'issue'}     = $issues;
226
223
227
        map { $biblioitem->{$_} = encode_entities( $biblioitem->{$_}, '&' ) } grep( !/marcxml/, keys %$biblioitem );
228
        
229
        push @records, $biblioitem;
224
        push @records, $biblioitem;
230
    }
225
    }
231
226
Lines 256-273 sub GetAuthorityRecords { Link Here
256
        return { code => 'UnsupportedSchema' };
251
        return { code => 'UnsupportedSchema' };
257
    }
252
    }
258
253
259
    my $records;
254
    my @records;
260
255
261
    # Let's loop over the authority IDs
256
    # Let's loop over the authority IDs
262
    foreach my $authid ( split( / /, $cgi->param('id') ) ) {
257
    foreach my $authid ( split( / /, $cgi->param('id') ) ) {
263
258
264
        # Get the record as XML string, or error code
259
        # Get the record as XML string, or error code
265
        my $record = GetAuthorityXML($authid) || "<record><code>RecordNotFound</code></record>";
260
        push @records, GetAuthorityXML($authid) || { code => 'RecordNotFound' };
266
        $record =~ s/<\?xml(.*)\?>//go;
267
        $records .= $record;
268
    }
261
    }
269
262
270
    return $records;
263
    return { record => \@records };
271
}
264
}
272
265
273
=head2 LookupPatron
266
=head2 LookupPatron
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt (-22 / +22 lines)
Lines 120-125 Link Here
120
    &lt;biblioitemnumber&gt;1&lt;/biblioitemnumber&gt;
120
    &lt;biblioitemnumber&gt;1&lt;/biblioitemnumber&gt;
121
    &lt;isbn&gt;9782862749198&lt;/isbn&gt;
121
    &lt;isbn&gt;9782862749198&lt;/isbn&gt;
122
    &lt;marcxml&gt;
122
    &lt;marcxml&gt;
123
      &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
123
      &lt;record
124
      &lt;record
124
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
125
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
125
          xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
126
          xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
Lines 208-213 Link Here
208
    &lt;biblioitemnumber&gt;2&lt;/biblioitemnumber&gt;
209
    &lt;biblioitemnumber&gt;2&lt;/biblioitemnumber&gt;
209
    &lt;isbn&gt;9782265078031&lt;/isbn&gt;
210
    &lt;isbn&gt;9782265078031&lt;/isbn&gt;
210
    &lt;marcxml&gt;
211
    &lt;marcxml&gt;
212
      &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
211
      &lt;record
213
      &lt;record
212
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
214
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
213
          xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
215
          xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
Lines 316-356 Link Here
316
                    ilsdi.pl?service=GetAuthorityRecords&id=1+2+99999
318
                    ilsdi.pl?service=GetAuthorityRecords&id=1+2+99999
317
                </a>
319
                </a>
318
                <h4>Example Response</h4>
320
                <h4>Example Response</h4>
319
<pre>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
321
<pre>&lt;xml version="1.0" encoding="UTF-8"&gt;;
320
&lt;GetAuthorityRecords&gt;
322
&lt;GetAuthorityRecords&gt;
323
  &lt;record&gt;
324
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
321
  &lt;record
325
  &lt;record
322
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
326
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
323
    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
327
    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
324
    xmlns="http://www.loc.gov/MARC21/slim"&gt;
328
    xmlns="http://www.loc.gov/MARC21/slim"&gt;
325
    &lt;leader&gt;00126nx  j2200073   4500 &lt;/leader&gt;
329
      &lt;leader&gt;00182     2200085   4500&lt;/leader&gt;
326
    &lt;controlfield tag="001"&gt;1&lt;/controlfield&gt;
330
    &lt;controlfield tag="001"&gt;1&lt;/controlfield&gt;
327
    &lt;datafield tag="250" ind1=" " ind2=" "&gt;
331
      &lt;datafield tag="200" ind1=" " ind2=" "&gt;
328
      &lt;subfield code="a"&gt;TECHNIQUE&lt;/subfield&gt;
332
        &lt;subfield code="a"&gt;Hugo&lt;/subfield&gt;
333
        &lt;subfield code="b"&gt;Victor&lt;/subfield&gt;
329
    &lt;/datafield&gt;
334
    &lt;/datafield&gt;
330
    &lt;datafield tag="100" ind1=" " ind2=" "&gt;
335
      &lt;datafield tag="801" ind1=" " ind2=" "&gt;
331
      &lt;subfield code="a"&gt;20071210afrey50      ba0&lt;/subfield&gt;
336
        &lt;subfield code="a"&gt;France&lt;/subfield&gt;
332
    &lt;/datafield&gt;
337
        &lt;subfield code="b"&gt;Nimes&lt;/subfield&gt;
333
    &lt;datafield tag="152" ind1=" " ind2=" "&gt;
338
        &lt;subfield code="c"&gt;2010/04/13&lt;/subfield&gt;
334
      &lt;subfield code="b"&gt;NC&lt;/subfield&gt;
335
    &lt;/datafield&gt;
336
  &lt;/record&gt;
337
  &lt;record
338
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
339
    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
340
    xmlns="http://www.loc.gov/MARC21/slim"&gt;
341
    &lt;leader&gt;00130nx  j2200073   4500 &lt;/leader&gt;
342
    &lt;controlfield tag="001"&gt;2&lt;/controlfield&gt;
343
    &lt;datafield tag="250" ind1=" " ind2=" "&gt;
344
      &lt;subfield code="a"&gt;CHEMIN DE FER&lt;/subfield&gt;
345
    &lt;/datafield&gt;
339
    &lt;/datafield&gt;
346
    &lt;datafield tag="100" ind1=" " ind2=" "&gt;
340
    &lt;datafield tag="100" ind1=" " ind2=" "&gt;
347
      &lt;subfield code="a"&gt;20071210afrey50      ba0&lt;/subfield&gt;
341
        &lt;subfield code="a"&gt;20100413     50                    &lt;/subfield&gt;
348
    &lt;/datafield&gt;
342
    &lt;/datafield&gt;
349
    &lt;datafield tag="152" ind1=" " ind2=" "&gt;
343
    &lt;datafield tag="152" ind1=" " ind2=" "&gt;
350
      &lt;subfield code="b"&gt;NC&lt;/subfield&gt;
344
        &lt;subfield code="b"&gt;NP&lt;/subfield&gt;
351
    &lt;/datafield&gt;
345
    &lt;/datafield&gt;
352
  &lt;/record&gt;
346
  &lt;/record&gt;
353
  &lt;record&gt;RecordNotFound&lt;/record&gt;
347
  &lt;/record&gt;
348
  &lt;record&gt;
349
    &lt;code&gt;RecordNotFound&lt;/code&gt;
350
  &lt;/record&gt;
351
  &lt;record&gt;
352
    &lt;code&gt;RecordNotFound&lt;/code&gt;
353
  &lt;/record&gt;
354
&lt;/GetAuthorityRecords&gt;</pre>
354
&lt;/GetAuthorityRecords&gt;</pre>
355
355
356
[% ELSIF ( LookupPatron ) %]
356
[% ELSIF ( LookupPatron ) %]
(-)a/opac/ilsdi.pl (-2 lines)
Lines 233-239 print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8'); Link Here
233
print XMLout(
233
print XMLout(
234
    $out,
234
    $out,
235
    noattr        => 1,
235
    noattr        => 1,
236
    noescape      => 1,
237
    nosort        => 1,
236
    nosort        => 1,
238
    xmldecl       => '<?xml version="1.0" encoding="UTF-8" ?>',
237
    xmldecl       => '<?xml version="1.0" encoding="UTF-8" ?>',
239
    RootName      => $service,
238
    RootName      => $service,
240
- 

Return to bug 5639