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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (-2 / +6 lines)
Lines 319-325 Link Here
319
                                                    [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
319
                                                    [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
320
                                                        <li>
320
                                                        <li>
321
                                                            <strong>[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]</strong>
321
                                                            <strong>[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]</strong>
322
                                                            <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span>
322
                                                            <span class="shelvingloc"
323
                                                                >[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.effective_location, opac => 1 ) | html %]</span
324
                                                            >
323
                                                            [% IF ( ITEM_RESULT.itemcallnumber ) %]
325
                                                            [% IF ( ITEM_RESULT.itemcallnumber ) %]
324
                                                                ([% ITEM_RESULT.itemcallnumber | html %])
326
                                                                ([% ITEM_RESULT.itemcallnumber | html %])
325
                                                            [% END %]
327
                                                            [% END %]
Lines 401-407 Link Here
401
                                                        >[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
403
                                                        >[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
402
                                                            <li>
404
                                                            <li>
403
                                                                [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
405
                                                                [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
404
                                                                <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span>
406
                                                                <span class="shelvingloc"
407
                                                                    >[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.effective_location, opac => 1 ) | html %]</span
408
                                                                >
405
                                                                <span class="ccode">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ITEM_RESULT.ccode, opac => 1 ) | html %]</span>
409
                                                                <span class="ccode">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ITEM_RESULT.ccode, opac => 1 ) | html %]</span>
406
                                                                [% IF ( ITEM_RESULT.itemcallnumber ) %]
410
                                                                [% IF ( ITEM_RESULT.itemcallnumber ) %]
407
                                                                    ([% ITEM_RESULT.itemcallnumber | html %])
411
                                                                    ([% ITEM_RESULT.itemcallnumber | html %])
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-6 / +25 lines)
Lines 1309-1314 Link Here
1309
                <th id="item_url" data-colname="item_url" class="url">URL</th>
1309
                <th id="item_url" data-colname="item_url" class="url">URL</th>
1310
                <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>
1310
                <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>
1311
                <th id="item_status" data-colname="item_status" class="status">Status</th>
1311
                <th id="item_status" data-colname="item_status" class="status">Status</th>
1312
                <th id="item_displays" data-colname="item_displays" class="displays">Displays</th>
1312
                <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>
1313
                <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>
1313
                <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
1314
                <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
1314
                <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>
1315
                <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>
Lines 1355-1362 Link Here
1355
                    [% END %]
1356
                    [% END %]
1356
                    [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1357
                    [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1357
                        [%# Show opac_info or branchurl from holding library %]
1358
                        [%# Show opac_info or branchurl from holding library %]
1358
                        [% SET holding_library_name = Branches.GetName( ITEM_RESULT.holdingbranch ) %]
1359
                        [% SET holding_library_name = ITEM_RESULT.holding_branch.branchname %]
1359
                        [% SET holding_library_url = Branches.GetURL( ITEM_RESULT.holdingbranch ) %]
1360
                        [% SET holding_library_url = Branches.GetURL( ITEM_RESULT.holding_branch.branchcode ) %]
1360
                        <td class="location" property="seller" data-order="[% holding_library_name | html %]">
1361
                        <td class="location" property="seller" data-order="[% holding_library_name | html %]">
1361
                            <link property="itemOffered" href="#record" />
1362
                            <link property="itemOffered" href="#record" />
1362
                            <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut" />
1363
                            <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut" />
Lines 1381-1388 Link Here
1381
1382
1382
                    [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1383
                    [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1383
                        [%# Show opac_info or branchurl from home library %]
1384
                        [%# Show opac_info or branchurl from home library %]
1384
                        [% SET home_library_name = Branches.GetName( ITEM_RESULT.homebranch ) %]
1385
                        [% SET home_library_name = ITEM_RESULT.home_branch.branchname %]
1385
                        [% SET home_library_url = Branches.GetURL( ITEM_RESULT.homebranch ) %]
1386
                        [% SET home_library_url = Branches.GetURL( ITEM_RESULT.home_branch.branchcode ) %]
1386
                        <td class="location" property="seller" data-order="[% home_library_name | html %]">
1387
                        <td class="location" property="seller" data-order="[% home_library_name | html %]">
1387
                            <link property="itemOffered" href="#record" />
1388
                            <link property="itemOffered" href="#record" />
1388
                            <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut" />
1389
                            <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut" />
Lines 1532-1539 Link Here
1532
1533
1533
                    <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT.object include_schema_org = 1 %]</td>
1534
                    <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT.object include_schema_org = 1 %]</td>
1534
1535
1535
                    [% IF ( itemdata_itemnotes ) %]
1536
                    [% IF ( itemdata_displays ) %]
1536
                        <td class="notes" property="description">[% ITEM_RESULT.itemnotes | $raw %]</td>
1537
                        <td class="displays">
1538
                            <ul>
1539
                                [% FOREACH display IN ITEM_RESULT.displays %]
1540
                                    <li>[% display.display_name | html %]</li>
1541
                                [% END %]
1542
                            </ul>
1543
                        </td>
1544
                    [% ELSE %]
1545
                        [% hidden_columns_force.$table_id.push('item_displays') %]
1546
                        <td></td>
1547
                    [% END %]
1548
1549
                    [% IF ( itemdata_itemnotes || itemdata_displaynotes ) %]
1550
                        <td class="notes" property="description">
1551
                            [% ITEM_RESULT.itemnotes | $raw %]
1552
                            [% IF ( ITEM_RESULT.displaynotes ) %]
1553
                                <p><span class="on_display public_note">[% ITEM_RESULT.displaynotes | $raw %]</span></p>
1554
                            [% END %]
1555
                        </td>
1537
                    [% ELSE %]
1556
                    [% ELSE %]
1538
                        [% hidden_columns_force.$table_id.push('item_notes') %]
1557
                        [% hidden_columns_force.$table_id.push('item_notes') %]
1539
                        <td></td>
1558
                        <td></td>
(-)a/opac/opac-detail.pl (-11 / +67 lines)
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
(-)a/opac/opac-reserve.pl (-2 / +35 lines)
Lines 348-354 foreach my $biblioNumber (@biblionumbers) { Link Here
348
        { prefetch => [ 'issue', 'homebranch', 'holdingbranch' ] }
348
        { prefetch => [ 'issue', 'homebranch', 'holdingbranch' ] }
349
    )->filter_by_visible_in_opac( { patron => $patron } );
349
    )->filter_by_visible_in_opac( { patron => $patron } );
350
350
351
    $biblioData->{items} = [ $items->as_list ];    # FIXME Potentially a lot in memory here!
351
    foreach my $item ( $items->as_list ) {
352
        $item->{'ccode'} = $item->effective_collection_code;
353
        $item->holdingbranch( $item->effective_holdingbranch->branchcode );
354
        $item->homebranch( $item->effective_homebranch->branchcode );
355
356
        push @{ $biblioData->{items} }, $item;    # FIXME Potentially a lot in memory here!
357
    }
352
358
353
    # Compute the priority rank.
359
    # Compute the priority rank.
354
    $biblioData->{object} = $biblio;
360
    $biblioData->{object} = $biblio;
Lines 431-436 foreach my $biblioNum (@biblionumbers) { Link Here
431
        my $item_info = $item->unblessed;
437
        my $item_info = $item->unblessed;
432
        $item_info->{holding_branch} = $item->holding_branch;
438
        $item_info->{holding_branch} = $item->holding_branch;
433
        $item_info->{home_branch}    = $item->home_branch;
439
        $item_info->{home_branch}    = $item->home_branch;
440
441
        $item_info->{'ccode'} = $item->effective_collection_code
442
            if ( C4::Context->preference('UseDisplayModule') && $item->effective_collection_code );
443
444
        if ( C4::Context->preference('UseDisplayModule') && $item->effective_homebranch ) {
445
            my $effective_homebranch    = $item->effective_homebranch;
446
            my $effective_homebranch_id = $item->effective_homebranch->branchcode;
447
448
            # If it starts with "DISPLAY:", use it as-is, otherwise look it up
449
            if ( $effective_homebranch_id =~ /^DISPLAY:/ ) {
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
434
        if ($itemLevelTypes) {
468
        if ($itemLevelTypes) {
435
            my $itemtype = $item->itemtype;
469
            my $itemtype = $item->itemtype;
436
            $item_info->{'imageurl'} = getitemtypeimagelocation(
470
            $item_info->{'imageurl'} = getitemtypeimagelocation(
437
- 

Return to bug 14962