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 364-370
sub GetPatronInfo {
Link Here
|
364 |
|
368 |
|
365 |
# Cleaning the borrower hashref |
369 |
# Cleaning the borrower hashref |
366 |
$borrower->{'charges'} = $borrower->{'flags'}->{'CHARGES'}->{'amount'}; |
370 |
$borrower->{'charges'} = $borrower->{'flags'}->{'CHARGES'}->{'amount'}; |
367 |
$borrower->{'branchname'} = GetBranchName( $borrower->{'branchcode'} ); |
371 |
my $library = Koha::Libraries->find( $borrower->{branchcode} ); |
|
|
372 |
$borrower->{'branchname'} = $library ? $library->branchname : ''; |
368 |
delete $borrower->{'flags'}; |
373 |
delete $borrower->{'flags'}; |
369 |
delete $borrower->{'userid'}; |
374 |
delete $borrower->{'userid'}; |
370 |
delete $borrower->{'password'}; |
375 |
delete $borrower->{'password'}; |
Lines 404-410
sub GetPatronInfo {
Link Here
|
404 |
|
409 |
|
405 |
# Get additional informations |
410 |
# Get additional informations |
406 |
my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef ); |
411 |
my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef ); |
407 |
my $branchname = GetBranchName( $reserve->{'branchcode'} ); |
412 |
my $library = Koha::Libraries->find( $reserve->{branchcode} ); |
|
|
413 |
my $branchname = $library ? $library->branchname : ''; |
408 |
|
414 |
|
409 |
# Remove unwanted fields |
415 |
# Remove unwanted fields |
410 |
delete $item->{'marc'}; |
416 |
delete $item->{'marc'}; |
Lines 638-644
sub HoldTitle {
Link Here
|
638 |
# Hashref building |
644 |
# Hashref building |
639 |
my $out; |
645 |
my $out; |
640 |
$out->{'title'} = $title; |
646 |
$out->{'title'} = $title; |
641 |
$out->{'pickup_location'} = GetBranchName($branch); |
647 |
my $library = Koha::Libraries->find( $branch ); |
|
|
648 |
$out->{'pickup_location'} = $library ? $library->branchname : ''; |
642 |
|
649 |
|
643 |
# TODO $out->{'date_available'} = ''; |
650 |
# TODO $out->{'date_available'} = ''; |
644 |
|
651 |
|
Lines 714-720
sub HoldItem {
Link Here
|
714 |
|
721 |
|
715 |
# Hashref building |
722 |
# Hashref building |
716 |
my $out; |
723 |
my $out; |
717 |
$out->{'pickup_location'} = GetBranchName($branch); |
724 |
my $library = Koha::Libraries->find( $branch ); |
|
|
725 |
$out->{'pickup_location'} = $library ? $library->branchname : ''; |
718 |
|
726 |
|
719 |
# TODO $out->{'date_available'} = ''; |
727 |
# TODO $out->{'date_available'} = ''; |
720 |
|
728 |
|
Lines 770-776
sub _availability {
Link Here
|
770 |
} |
778 |
} |
771 |
|
779 |
|
772 |
my $biblionumber = $item->{'biblioitemnumber'}; |
780 |
my $biblionumber = $item->{'biblioitemnumber'}; |
773 |
my $location = GetBranchName( $item->{'holdingbranch'} ); |
781 |
my $library = Koha::Libraries->find( $item->{holdingbranch} ); |
|
|
782 |
my $location = $library ? $library->branchname : ''; |
774 |
|
783 |
|
775 |
if ( $item->{'notforloan'} ) { |
784 |
if ( $item->{'notforloan'} ) { |
776 |
return ( $biblionumber, 'not available', 'Not for loan', $location ); |
785 |
return ( $biblionumber, 'not available', 'Not for loan', $location ); |