Lines 36-41
use DateTime;
Link Here
|
36 |
use C4::Auth; |
36 |
use C4::Auth; |
37 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
37 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
38 |
|
38 |
|
|
|
39 |
use Koha::Libraries; |
40 |
|
39 |
=head1 NAME |
41 |
=head1 NAME |
40 |
|
42 |
|
41 |
C4::ILS-DI::Services - ILS-DI Services |
43 |
C4::ILS-DI::Services - ILS-DI Services |
Lines 220-227
sub GetRecords {
Link Here
|
220 |
delete $item->{'more_subfields_xml'}; |
222 |
delete $item->{'more_subfields_xml'}; |
221 |
|
223 |
|
222 |
# Display branch names instead of branch codes |
224 |
# Display branch names instead of branch codes |
223 |
$item->{'homebranchname'} = GetBranchName( $item->{'homebranch'} ); |
225 |
my $home_library = Koha::Libraries->find( $item->{homebranch} ); |
224 |
$item->{'holdingbranchname'} = GetBranchName( $item->{'holdingbranch'} ); |
226 |
my $holding_library = Koha::Libraries->find( $item->{holdingbranch} ); |
|
|
227 |
$item->{'homebranchname'} = $home_library ? $home_library->branchname : ''; |
228 |
$item->{'holdingbranchname'} = $holding_library ? $holding_library->branchname : ''; |
225 |
} |
229 |
} |
226 |
|
230 |
|
227 |
# Hashref building... |
231 |
# Hashref building... |
Lines 366-372
sub GetPatronInfo {
Link Here
|
366 |
|
370 |
|
367 |
# Cleaning the borrower hashref |
371 |
# Cleaning the borrower hashref |
368 |
$borrower->{'charges'} = $borrower->{'flags'}->{'CHARGES'}->{'amount'}; |
372 |
$borrower->{'charges'} = $borrower->{'flags'}->{'CHARGES'}->{'amount'}; |
369 |
$borrower->{'branchname'} = GetBranchName( $borrower->{'branchcode'} ); |
373 |
my $library = Koha::Libraries->find( $borrower->{branchcode} ); |
|
|
374 |
$borrower->{'branchname'} = $library ? $library->branchname : ''; |
370 |
delete $borrower->{'flags'}; |
375 |
delete $borrower->{'flags'}; |
371 |
delete $borrower->{'userid'}; |
376 |
delete $borrower->{'userid'}; |
372 |
delete $borrower->{'password'}; |
377 |
delete $borrower->{'password'}; |
Lines 406-412
sub GetPatronInfo {
Link Here
|
406 |
|
411 |
|
407 |
# Get additional informations |
412 |
# Get additional informations |
408 |
my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef ); |
413 |
my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef ); |
409 |
my $branchname = GetBranchName( $reserve->{'branchcode'} ); |
414 |
my $library = Koha::Libraries->find( $reserve->{branchcode} ); |
|
|
415 |
my $branchname = $library ? $library->branchname : ''; |
410 |
|
416 |
|
411 |
# Remove unwanted fields |
417 |
# Remove unwanted fields |
412 |
delete $item->{'marc'}; |
418 |
delete $item->{'marc'}; |
Lines 640-646
sub HoldTitle {
Link Here
|
640 |
# Hashref building |
646 |
# Hashref building |
641 |
my $out; |
647 |
my $out; |
642 |
$out->{'title'} = $title; |
648 |
$out->{'title'} = $title; |
643 |
$out->{'pickup_location'} = GetBranchName($branch); |
649 |
my $library = Koha::Libraries->find( $branch ); |
|
|
650 |
$out->{'pickup_location'} = $library ? $library->branchname : ''; |
644 |
|
651 |
|
645 |
# TODO $out->{'date_available'} = ''; |
652 |
# TODO $out->{'date_available'} = ''; |
646 |
|
653 |
|
Lines 716-722
sub HoldItem {
Link Here
|
716 |
|
723 |
|
717 |
# Hashref building |
724 |
# Hashref building |
718 |
my $out; |
725 |
my $out; |
719 |
$out->{'pickup_location'} = GetBranchName($branch); |
726 |
my $library = Koha::Libraries->find( $branch ); |
|
|
727 |
$out->{'pickup_location'} = $library ? $library->branchname : ''; |
720 |
|
728 |
|
721 |
# TODO $out->{'date_available'} = ''; |
729 |
# TODO $out->{'date_available'} = ''; |
722 |
|
730 |
|
Lines 772-778
sub _availability {
Link Here
|
772 |
} |
780 |
} |
773 |
|
781 |
|
774 |
my $biblionumber = $item->{'biblioitemnumber'}; |
782 |
my $biblionumber = $item->{'biblioitemnumber'}; |
775 |
my $location = GetBranchName( $item->{'holdingbranch'} ); |
783 |
my $library = Koha::Libraries->find( $item->{holdingbranch} ); |
|
|
784 |
my $location = $library ? $library->branchname : ''; |
776 |
|
785 |
|
777 |
if ( $item->{'notforloan'} ) { |
786 |
if ( $item->{'notforloan'} ) { |
778 |
return ( $biblionumber, 'not available', 'Not for loan', $location ); |
787 |
return ( $biblionumber, 'not available', 'Not for loan', $location ); |