View | Details | Raw Unified | Return to bug 14962
Collapse All | Expand All

(-)a/opac/opac-detail.pl (-24 / +12 lines)
Lines 744-779 if ( not $viewallitems and $items->count > $max_items_to_display ) { Link Here
744
        $item_info->{holding_branch} = $item->holding_branch;
744
        $item_info->{holding_branch} = $item->holding_branch;
745
        $item_info->{home_branch}    = $item->home_branch;
745
        $item_info->{home_branch}    = $item->home_branch;
746
746
747
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_homebranch ) {
747
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_home_library ) {
748
            my $effective_homebranch           = $item->effective_homebranch;
748
            my $effective_home_library           = $item->effective_home_library;
749
            my $effective_homebranch_id        = $item->effective_homebranch->branchcode;
749
            my $effective_home_library_opac_info = $effective_home_library->opac_info( { lang => $lang } );
750
            my $effective_homebranch_opac_info = $item->effective_homebranch->opac_info( { lang => $lang } );
751
750
752
            $item_info->{home_library_info} = $effective_homebranch_opac_info
751
            $item_info->{home_library_info} = $effective_home_library_opac_info
753
                if ($effective_homebranch_opac_info);
752
                if ($effective_home_library_opac_info);
754
753
755
            # If it starts with "DISPLAY:", use it as-is, otherwise look it up
754
            $item_info->{home_branch} = $effective_home_library;
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
        }
755
        }
762
756
763
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_holdingbranch ) {
757
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_holding_library ) {
764
            my $effective_holdingbranch           = $item->effective_holdingbranch;
758
            my $effective_holding_library           = $item->effective_holding_library;
765
            my $effective_holdingbranch_id        = $item->effective_holdingbranch->branchcode;
759
            my $effective_holding_library_opac_info = $effective_holding_library->opac_info( { lang => $lang } );
766
            my $effective_holdingbranch_opac_info = $item->effective_homebranch->opac_info( { lang => $lang } );
767
760
768
            $item_info->{holding_library_info} = $effective_holdingbranch_opac_info
761
            $item_info->{holding_library_info} = $effective_holding_library_opac_info
769
                if ($effective_holdingbranch_opac_info);
762
                if ($effective_holding_library_opac_info);
770
763
771
            # If it starts with "DISPLAY:", use it as-is, otherwise look it up
764
            $item_info->{holding_branch} = $effective_holding_library;
772
            if ( $effective_holdingbranch_id =~ /^DISPLAY:/ ) {
773
                $item_info->{holding_branch} = $effective_holdingbranch_id;
774
            } else {
775
                $item_info->{holding_branch} = $effective_holdingbranch;
776
            }
777
        }
765
        }
778
766
779
        my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
767
        my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
(-)a/opac/opac-reserve.pl (-25 / +6 lines)
Lines 350-357 foreach my $biblioNumber (@biblionumbers) { Link Here
350
350
351
    foreach my $item ( $items->as_list ) {
351
    foreach my $item ( $items->as_list ) {
352
        $item->{'ccode'} = $item->effective_collection_code;
352
        $item->{'ccode'} = $item->effective_collection_code;
353
        $item->holdingbranch( $item->effective_holdingbranch->branchcode );
353
        $item->holdingbranch( $item->effective_holdingbranch );
354
        $item->homebranch( $item->effective_homebranch->branchcode );
354
        $item->homebranch( $item->effective_homebranch );
355
355
356
        push @{ $biblioData->{items} }, $item;    # FIXME Potentially a lot in memory here!
356
        push @{ $biblioData->{items} }, $item;    # FIXME Potentially a lot in memory here!
357
    }
357
    }
Lines 441-469 foreach my $biblioNum (@biblionumbers) { Link Here
441
        $item_info->{'ccode'} = $item->effective_collection_code
441
        $item_info->{'ccode'} = $item->effective_collection_code
442
            if ( C4::Context->preference('UseDisplayModule') && $item->effective_collection_code );
442
            if ( C4::Context->preference('UseDisplayModule') && $item->effective_collection_code );
443
443
444
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_homebranch ) {
444
        $item_info->{home_branch} = $item->effective_homebranch
445
            my $effective_homebranch    = $item->effective_homebranch;
445
            if ( C4::Context->preference('UseDisplayModule') && $item->effective_homebranch );
446
            my $effective_homebranch_id = $item->effective_homebranch->branchcode;
447
446
448
            # If it starts with "DISPLAY:", use it as-is, otherwise look it up
447
        $item_info->{holding_branch} = $item->effective_holdingbranch
449
            if ( $effective_homebranch_id =~ /^DISPLAY:/ ) {
448
            if ( C4::Context->preference('UseDisplayModule') && $item->effective_holdingbranch );
450
                $item_info->{holding_branch} = $effective_homebranch_id;
451
            } else {
452
                $item_info->{holding_branch} = $effective_homebranch;
453
            }
454
        }
455
456
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_holdingbranch ) {
457
            my $effective_holdingbranch    = $item->effective_holdingbranch;
458
            my $effective_holdingbranch_id = $item->effective_holdingbranch->branchcode;
459
460
            # If it starts with "DISPLAY:", use it as-is, otherwise look it up
461
            if ( $effective_holdingbranch_id =~ /^DISPLAY:/ ) {
462
                $item_info->{home_branch} = $effective_holdingbranch_id;
463
            } else {
464
                $item_info->{home_branch} = $effective_holdingbranch;
465
            }
466
        }
467
449
468
        if ($itemLevelTypes) {
450
        if ($itemLevelTypes) {
469
            my $itemtype = $item->itemtype;
451
            my $itemtype = $item->itemtype;
470
- 

Return to bug 14962