Lines 84-90
Parameters:
Link Here
|
84 |
=head3 id (Required) |
84 |
=head3 id (Required) |
85 |
|
85 |
|
86 |
list of either biblionumbers or itemnumbers |
86 |
list of either biblionumbers or itemnumbers |
87 |
|
|
|
88 |
=head3 id_type (Required) |
87 |
=head3 id_type (Required) |
89 |
|
88 |
|
90 |
defines the type of record identifier being used in the request, |
89 |
defines the type of record identifier being used in the request, |
Lines 299-314
Parameters:
Link Here
|
299 |
- id_type (Optional) |
298 |
- id_type (Optional) |
300 |
the type of the identifier, possible values: |
299 |
the type of the identifier, possible values: |
301 |
- cardnumber |
300 |
- cardnumber |
302 |
- firstname |
|
|
303 |
- userid |
301 |
- userid |
|
|
302 |
- email |
304 |
- borrowernumber |
303 |
- borrowernumber |
|
|
304 |
- firstname |
305 |
- surname |
305 |
|
306 |
|
306 |
=cut |
307 |
=cut |
307 |
|
308 |
|
308 |
sub LookupPatron { |
309 |
sub LookupPatron { |
309 |
my ($cgi) = @_; |
310 |
my ($cgi) = @_; |
310 |
|
311 |
|
311 |
my $patrons = Koha::Patrons->search( { $cgi->param('id_type') => $cgi->param('id') } ); |
312 |
my $patrons; |
|
|
313 |
|
314 |
if(!$cgi->param('id')) { |
315 |
return { message => 'PatronNotFound' }; |
316 |
} |
317 |
|
318 |
if($cgi->param('id_type')) { |
319 |
$patrons = Koha::Patrons->search( { $cgi->param('id_type') => $cgi->param('id') } ); |
320 |
} else { |
321 |
foreach my $id_type ('cardnumber', 'userid', 'email', 'borrowernumber', |
322 |
'surname', 'firstname') { |
323 |
$patrons = Koha::Patrons->search( { $id_type => $cgi->param('id') } ); |
324 |
last if($patrons->count); |
325 |
} |
326 |
} |
312 |
unless ( $patrons->count ) { |
327 |
unless ( $patrons->count ) { |
313 |
return { message => 'PatronNotFound' }; |
328 |
return { message => 'PatronNotFound' }; |
314 |
} |
329 |
} |