|
Lines 304-310
if ( $op eq 'view' ) {
Link Here
|
| 304 |
$art_req_itypes = Koha::CirculationRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () }); |
304 |
$art_req_itypes = Koha::CirculationRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () }); |
| 305 |
} |
305 |
} |
| 306 |
|
306 |
|
| 307 |
my @items; |
307 |
my @items_info; |
| 308 |
while ( my $content = $contents->next ) { |
308 |
while ( my $content = $contents->next ) { |
| 309 |
my $biblionumber = $content->biblionumber; |
309 |
my $biblionumber = $content->biblionumber; |
| 310 |
my $this_item = GetBiblioData($biblionumber); |
310 |
my $this_item = GetBiblioData($biblionumber); |
|
Lines 317-335
if ( $op eq 'view' ) {
Link Here
|
| 317 |
}); |
317 |
}); |
| 318 |
$record_processor->process($record); |
318 |
$record_processor->process($record); |
| 319 |
|
319 |
|
| 320 |
if ($xslfile) { |
|
|
| 321 |
my $variables = { |
| 322 |
anonymous_session => ($loggedinuser) ? 0 : 1 |
| 323 |
}; |
| 324 |
$this_item->{XSLTBloc} = XSLTParse4Display( |
| 325 |
$biblionumber, $record, |
| 326 |
"OPACXSLTListsDisplay", 1, |
| 327 |
undef, $sysxml, |
| 328 |
$xslfile, $lang, |
| 329 |
$variables |
| 330 |
); |
| 331 |
} |
| 332 |
|
| 333 |
my $marcflavour = C4::Context->preference("marcflavour"); |
320 |
my $marcflavour = C4::Context->preference("marcflavour"); |
| 334 |
my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype; |
321 |
my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype; |
| 335 |
$itemtype = Koha::ItemTypes->find( $itemtype ); |
322 |
$itemtype = Koha::ItemTypes->find( $itemtype ); |
|
Lines 352-361
if ( $op eq 'view' ) {
Link Here
|
| 352 |
$this_item->{size} = q||; |
339 |
$this_item->{size} = q||; |
| 353 |
} |
340 |
} |
| 354 |
|
341 |
|
| 355 |
# Getting items infos for location display |
|
|
| 356 |
my @items_infos = &GetItemsLocationInfo( $biblionumber ); |
| 357 |
$this_item->{'ITEM_RESULTS'} = \@items_infos; |
| 358 |
|
| 359 |
if (C4::Context->preference('TagsEnabled') and C4::Context->preference('TagsShowOnList')) { |
342 |
if (C4::Context->preference('TagsEnabled') and C4::Context->preference('TagsShowOnList')) { |
| 360 |
$this_item->{TagLoop} = get_tags({ |
343 |
$this_item->{TagLoop} = get_tags({ |
| 361 |
biblionumber => $biblionumber, approved=>1, 'sort'=>'-weight', |
344 |
biblionumber => $biblionumber, approved=>1, 'sort'=>'-weight', |
|
Lines 363-372
if ( $op eq 'view' ) {
Link Here
|
| 363 |
}); |
346 |
}); |
| 364 |
} |
347 |
} |
| 365 |
|
348 |
|
|
|
349 |
my @items; |
| 366 |
my $items = $biblio->items; |
350 |
my $items = $biblio->items; |
|
|
351 |
my $allow_onshelf_holds; |
| 352 |
my @hidden_items; |
| 367 |
while ( my $item = $items->next ) { |
353 |
while ( my $item = $items->next ) { |
| 368 |
$this_item->{allow_onshelf_holds} = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); |
354 |
if ( $item->hidden_in_opac({rules => C4::Context->yaml_preference('OpacHiddenItems')} ) ) { |
| 369 |
last if $this_item->{allow_onshelf_holds}; |
355 |
push @hidden_items, $item->itemnumber; |
|
|
356 |
next; |
| 357 |
} |
| 358 |
|
| 359 |
$allow_onshelf_holds ||= Koha::CirculationRules->get_onshelfholds_policy( |
| 360 |
{ item => $item, patron => $patron } ); |
| 361 |
|
| 362 |
push @items, $item; # This is for non-xslt only |
| 363 |
} |
| 364 |
$this_item->{allow_onshelf_holds} = $allow_onshelf_holds; |
| 365 |
$this_item->{'ITEM_RESULTS'} = \@items; |
| 366 |
|
| 367 |
if ($xslfile) { |
| 368 |
my $variables = { |
| 369 |
anonymous_session => ($loggedinuser) ? 0 : 1 |
| 370 |
}; |
| 371 |
$this_item->{XSLTBloc} = XSLTParse4Display( |
| 372 |
$biblionumber, $record, |
| 373 |
"OPACXSLTListsDisplay", 1, |
| 374 |
\@hidden_items, $sysxml, |
| 375 |
$xslfile, $lang, |
| 376 |
$variables |
| 377 |
); |
| 370 |
} |
378 |
} |
| 371 |
|
379 |
|
| 372 |
if ( grep {$_ eq $biblionumber} @cart_list) { |
380 |
if ( grep {$_ eq $biblionumber} @cart_list) { |
|
Lines 375-381
if ( $op eq 'view' ) {
Link Here
|
| 375 |
|
383 |
|
| 376 |
$this_item->{biblio_object} = $biblio; |
384 |
$this_item->{biblio_object} = $biblio; |
| 377 |
$this_item->{biblionumber} = $biblionumber; |
385 |
$this_item->{biblionumber} = $biblionumber; |
| 378 |
push @items, $this_item; |
386 |
push @items_info, $this_item; |
| 379 |
} |
387 |
} |
| 380 |
|
388 |
|
| 381 |
$template->param( |
389 |
$template->param( |
|
Lines 383-389
if ( $op eq 'view' ) {
Link Here
|
| 383 |
can_delete_shelf => $shelf->can_be_deleted($loggedinuser), |
391 |
can_delete_shelf => $shelf->can_be_deleted($loggedinuser), |
| 384 |
can_remove_biblios => $shelf->can_biblios_be_removed($loggedinuser), |
392 |
can_remove_biblios => $shelf->can_biblios_be_removed($loggedinuser), |
| 385 |
can_add_biblios => $shelf->can_biblios_be_added($loggedinuser), |
393 |
can_add_biblios => $shelf->can_biblios_be_added($loggedinuser), |
| 386 |
itemsloop => \@items, |
394 |
itemsloop => \@items_info, |
| 387 |
sortfield => $sortfield, |
395 |
sortfield => $sortfield, |
| 388 |
direction => $direction, |
396 |
direction => $direction, |
| 389 |
csv_profiles => [ |
397 |
csv_profiles => [ |
| 390 |
- |
|
|