Lines 230-261
sub GetRecords {
Link Here
|
230 |
my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; |
230 |
my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; |
231 |
my $holds = $biblio->current_holds->unblessed; |
231 |
my $holds = $biblio->current_holds->unblessed; |
232 |
my $issues = GetBiblioIssues($biblionumber); |
232 |
my $issues = GetBiblioIssues($biblionumber); |
233 |
my $items = $biblio->items->unblessed; |
233 |
my @items = $biblio->items; |
|
|
234 |
|
235 |
$biblioitem->{items}->{item} = []; |
234 |
|
236 |
|
235 |
# We loop over the items to clean them |
237 |
# We loop over the items to clean them |
236 |
foreach my $item (@$items) { |
238 |
foreach my $item (@items) { |
|
|
239 |
my %item = %{ $item->unblessed }; |
237 |
|
240 |
|
238 |
# This hides additionnal XML subfields, we don't need these info |
241 |
# This hides additionnal XML subfields, we don't need these info |
239 |
delete $item->{'more_subfields_xml'}; |
242 |
delete $item{'more_subfields_xml'}; |
240 |
|
243 |
|
241 |
# Display branch names instead of branch codes |
244 |
# Display branch names instead of branch codes |
242 |
my $home_library = Koha::Libraries->find( $item->{homebranch} ); |
245 |
my $home_library = $item->home_branch; |
243 |
my $holding_library = Koha::Libraries->find( $item->{holdingbranch} ); |
246 |
my $holding_library = $item->holding_branch; |
244 |
$item->{'homebranchname'} = $home_library ? $home_library->branchname : ''; |
247 |
$item{'homebranchname'} = $home_library ? $home_library->branchname : ''; |
245 |
$item->{'holdingbranchname'} = $holding_library ? $holding_library->branchname : ''; |
248 |
$item{'holdingbranchname'} = $holding_library ? $holding_library->branchname : ''; |
246 |
|
249 |
|
247 |
my ($transferDate, $transferFrom, $transferTo) = GetTransfers($item->{itemnumber}); |
250 |
my $transfer = $item->get_transfer; |
248 |
if ($transferDate) { |
251 |
if ($transfer) { |
249 |
$item->{transfer} = { |
252 |
$item{transfer} = { |
250 |
datesent => $transferDate, |
253 |
datesent => $transfer->datesent, |
251 |
frombranch => $transferFrom, |
254 |
frombranch => $transfer->frombranch, |
252 |
tobranch => $transferTo, |
255 |
tobranch => $transfer->tobranch, |
253 |
}; |
256 |
}; |
254 |
} |
257 |
} |
|
|
258 |
|
259 |
push @{ $biblioitem->{items}->{item} }, \%item; |
255 |
} |
260 |
} |
256 |
|
261 |
|
257 |
# Hashref building... |
262 |
# Hashref building... |
258 |
$biblioitem->{'items'}->{'item'} = $items; |
|
|
259 |
$biblioitem->{'reserves'}->{'reserve'} = $holds; |
263 |
$biblioitem->{'reserves'}->{'reserve'} = $holds; |
260 |
$biblioitem->{'issues'}->{'issue'} = $issues; |
264 |
$biblioitem->{'issues'}->{'issue'} = $issues; |
261 |
|
265 |
|