|
Lines 727-737
if ( not $viewallitems and $items->count > $max_items_to_display ) {
Link Here
|
| 727 |
$can_holds_be_placed || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); |
727 |
$can_holds_be_placed || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); |
| 728 |
|
728 |
|
| 729 |
# get collection code description, too |
729 |
# get collection code description, too |
| 730 |
my $ccode = $item->ccode; |
730 |
my $ccode = $item->effective_collection_code; |
| 731 |
$item_info->{'ccode'} = $collections->{$ccode} |
731 |
$item_info->{'ccode'} = $collections->{$ccode} |
| 732 |
if defined($ccode) |
732 |
if defined($ccode) && $collections && exists( $collections->{$ccode} ); |
| 733 |
&& $collections |
733 |
|
| 734 |
&& exists( $collections->{$ccode} ); |
734 |
my $location = $item->effective_location; |
|
|
735 |
$item_info->{'location_description'} = $shelflocations->{$location} |
| 736 |
if defined($location) && $shelflocations && exists( $shelflocations->{$location} ); |
| 735 |
|
737 |
|
| 736 |
my $copynumber = $item->copynumber; |
738 |
my $copynumber = $item->copynumber; |
| 737 |
$item_info->{copynumber} = $copynumbers->{$copynumber} |
739 |
$item_info->{copynumber} = $copynumbers->{$copynumber} |
|
Lines 739-749
if ( not $viewallitems and $items->count > $max_items_to_display ) {
Link Here
|
| 739 |
&& defined($copynumber) |
741 |
&& defined($copynumber) |
| 740 |
&& exists( $copynumbers->{$copynumber} ) ); |
742 |
&& exists( $copynumbers->{$copynumber} ) ); |
| 741 |
|
743 |
|
| 742 |
if ( defined $item->location ) { |
744 |
$item_info->{holding_branch} = $item->holding_branch; |
| 743 |
$item_info->{'location_description'} = $shelflocations->{ $item->location }; |
745 |
$item_info->{home_branch} = $item->home_branch; |
|
|
746 |
|
| 747 |
if ( C4::Context->preference('UseDisplayModule') && $item->effective_homebranch ) { |
| 748 |
my $effective_homebranch = $item->effective_homebranch; |
| 749 |
my $effective_homebranch_id = $item->effective_homebranch->branchcode; |
| 750 |
my $effective_homebranch_opac_info = $item->effective_homebranch->opac_info( { lang => $lang } ); |
| 751 |
|
| 752 |
$item_info->{home_library_info} = $effective_homebranch_opac_info |
| 753 |
if ($effective_homebranch_opac_info); |
| 754 |
|
| 755 |
# If it starts with "DISPLAY:", use it as-is, otherwise look it up |
| 756 |
if ( $effective_homebranch_id =~ /^DISPLAY:/ ) { |
| 757 |
$item_info->{home_branch} = $effective_homebranch_id; |
| 758 |
} else { |
| 759 |
$item_info->{home_branch} = $effective_homebranch; |
| 760 |
} |
| 761 |
} |
| 762 |
|
| 763 |
if ( C4::Context->preference('UseDisplayModule') && $item->effective_holdingbranch ) { |
| 764 |
my $effective_holdingbranch = $item->effective_holdingbranch; |
| 765 |
my $effective_holdingbranch_id = $item->effective_holdingbranch->branchcode; |
| 766 |
my $effective_holdingbranch_opac_info = $item->effective_homebranch->opac_info( { lang => $lang } ); |
| 767 |
|
| 768 |
$item_info->{holding_library_info} = $effective_holdingbranch_opac_info |
| 769 |
if ($effective_holdingbranch_opac_info); |
| 770 |
|
| 771 |
# If it starts with "DISPLAY:", use it as-is, otherwise look it up |
| 772 |
if ( $effective_holdingbranch_id =~ /^DISPLAY:/ ) { |
| 773 |
$item_info->{holding_branch} = $effective_holdingbranch_id; |
| 774 |
} else { |
| 775 |
$item_info->{holding_branch} = $effective_holdingbranch; |
| 776 |
} |
| 744 |
} |
777 |
} |
| 745 |
|
778 |
|
| 746 |
my $itemtype = $item->itemtype; |
779 |
my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype ); |
| 747 |
$item_info->{'imageurl'} = getitemtypeimagelocation( |
780 |
$item_info->{'imageurl'} = getitemtypeimagelocation( |
| 748 |
'opac', |
781 |
'opac', |
| 749 |
$itemtypes->{ $itemtype->itemtype }->{'imageurl'} |
782 |
$itemtypes->{ $itemtype->itemtype }->{'imageurl'} |
|
Lines 754-761
if ( not $viewallitems and $items->count > $max_items_to_display ) {
Link Here
|
| 754 |
$item_info->{checkout} = $item->checkout; |
787 |
$item_info->{checkout} = $item->checkout; |
| 755 |
if ( $item_info->{checkout} && $item_info->{checkout} > 0 ) { $item_checkouts = 1; } |
788 |
if ( $item_info->{checkout} && $item_info->{checkout} > 0 ) { $item_checkouts = 1; } |
| 756 |
|
789 |
|
|
|
790 |
if ( C4::Context->preference('UseDisplayModule') ) { |
| 791 |
my @displays; |
| 792 |
my @display_items = Koha::DisplayItems->search( |
| 793 |
{ itemnumber => $item->itemnumber }, |
| 794 |
{ |
| 795 |
order_by => { '-desc' => 'date_added' }, |
| 796 |
} |
| 797 |
)->as_list; |
| 798 |
|
| 799 |
foreach my $display_item (@display_items) { |
| 800 |
push @displays, $display_item->display; |
| 801 |
} |
| 802 |
|
| 803 |
foreach my $display (@displays) { |
| 804 |
$item_info->{displaynotes} .= $display->public_note |
| 805 |
if ( $display->public_note ); |
| 806 |
} |
| 807 |
|
| 808 |
$item_info->{display_items} = \@display_items if @display_items; |
| 809 |
$item_info->{displays} = \@displays if @displays; |
| 810 |
} |
| 811 |
|
| 757 |
foreach my $field ( |
812 |
foreach my $field ( |
| 758 |
qw(ccode materials enumchron copynumber itemnotes location_description uri barcode itemcallnumber)) |
813 |
qw(ccode materials enumchron copynumber itemnotes location_description uri barcode itemcallnumber displaynotes displays display_items) |
|
|
814 |
) |
| 759 |
{ |
815 |
{ |
| 760 |
$itemfields{$field} = 1 if $item_info->{$field}; |
816 |
$itemfields{$field} = 1 if $item_info->{$field}; |
| 761 |
} |
817 |
} |
|
Lines 777-785
if ( not $viewallitems and $items->count > $max_items_to_display ) {
Link Here
|
| 777 |
$item_info->{course_reserves} = GetItemCourseReservesInfo( itemnumber => $item->itemnumber ); |
833 |
$item_info->{course_reserves} = GetItemCourseReservesInfo( itemnumber => $item->itemnumber ); |
| 778 |
} |
834 |
} |
| 779 |
|
835 |
|
| 780 |
$item_info->{holding_branch} = $item->holding_branch; |
|
|
| 781 |
$item_info->{home_branch} = $item->home_branch; |
| 782 |
|
| 783 |
my $itembranch = $item->$separatebranch; |
836 |
my $itembranch = $item->$separatebranch; |
| 784 |
if ( $currentbranch |
837 |
if ( $currentbranch |
| 785 |
and C4::Context->preference('OpacSeparateHoldings') ) |
838 |
and C4::Context->preference('OpacSeparateHoldings') ) |
|
Lines 837-842
$template->param(
Link Here
|
| 837 |
itemdata_location => $itemfields{location_description}, |
890 |
itemdata_location => $itemfields{location_description}, |
| 838 |
itemdata_barcode => $itemfields{barcode}, |
891 |
itemdata_barcode => $itemfields{barcode}, |
| 839 |
itemdata_itemcallnumber => $itemfields{itemcallnumber}, |
892 |
itemdata_itemcallnumber => $itemfields{itemcallnumber}, |
|
|
893 |
itemdata_displaynotes => $itemfields{displaynotes}, |
| 894 |
itemdata_displays => $itemfields{displays}, |
| 895 |
itemdata_display_items => $itemfields{display_items}, |
| 840 |
OpacStarRatings => C4::Context->preference("OpacStarRatings"), |
896 |
OpacStarRatings => C4::Context->preference("OpacStarRatings"), |
| 841 |
); |
897 |
); |
| 842 |
|
898 |
|