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

(-)a/C4/Biblio.pm (-1 / +2 lines)
Lines 1564-1570 sub GetAuthorisedValueDesc { Link Here
1564
1564
1565
        #---- branch
1565
        #---- branch
1566
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
1566
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
1567
            return Koha::Libraries->find($value)->branchname;
1567
            my $branch = Koha::Libraries->find($value);
1568
            return $branch? $branch->branchname: q{};
1568
        }
1569
        }
1569
1570
1570
        #---- itemtypes
1571
        #---- itemtypes
(-)a/C4/Search.pm (-4 / +3 lines)
Lines 2116-2122 sub searchResults { Link Here
2116
                $onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber};
2116
                $onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber};
2117
                $onloan_items->{$key}->{description}    = $item->{description};
2117
                $onloan_items->{$key}->{description}    = $item->{description};
2118
                $onloan_items->{$key}->{imageurl} =
2118
                $onloan_items->{$key}->{imageurl} =
2119
                  getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} );
2119
                  getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype} }->{imageurl} );
2120
2120
2121
                # if something's checked out and lost, mark it as 'long overdue'
2121
                # if something's checked out and lost, mark it as 'long overdue'
2122
                if ( $item->{itemlost} ) {
2122
                if ( $item->{itemlost} ) {
Lines 2215-2222 sub searchResults { Link Here
2215
                else {
2215
                else {
2216
                    $can_place_holds = 1;
2216
                    $can_place_holds = 1;
2217
                    $available_count++;
2217
                    $available_count++;
2218
					$available_items->{$prefix}->{count}++ if $item->{$hbranch};
2218
                    $available_items->{$prefix}->{count}++ if $item->{$hbranch};
2219
					foreach (qw(branchname itemcallnumber description)) {
2219
                    foreach (qw(branchname itemcallnumber description)) {
2220
                        $available_items->{$prefix}->{$_} = $item->{$_};
2220
                        $available_items->{$prefix}->{$_} = $item->{$_};
2221
                    }
2221
                    }
2222
                    $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
2222
                    $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
Lines 2246-2252 sub searchResults { Link Here
2246
2246
2247
        # XSLT processing of some stuff
2247
        # XSLT processing of some stuff
2248
        # we fetched the sysprefs already before the loop through all retrieved record!
2248
        # we fetched the sysprefs already before the loop through all retrieved record!
2249
        my $interface = $search_context->{'interface'} eq 'opac' ? 'OPAC' : '';
2250
        if (!$scan && $xslfile) {
2249
        if (!$scan && $xslfile) {
2251
            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang);
2250
            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang);
2252
        }
2251
        }
(-)a/opac/opac-ISBDdetail.pl (-5 / +3 lines)
Lines 78-88 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
78
    }
78
    }
79
);
79
);
80
80
81
my $patron = Koha::Patrons->find( $loggedinuser );
81
my $borcat = q{};
82
my $borcat = q{};
82
if ( C4::Context->preference('OpacHiddenItemsExceptions') ) {
83
if ( $patron && C4::Context->preference('OpacHiddenItemsExceptions') ) {
83
    # we need to fetch the borrower info here, so we can pass the category
84
    $borcat = $patron->categorycode;
84
    my $patron = Koha::Patrons->find( { borrowernumber => $loggedinuser } );
85
    $borcat = $patron ? $patron->categorycode : $borcat;
86
}
85
}
87
86
88
my $record = GetMarcBiblio({
87
my $record = GetMarcBiblio({
Lines 179-185 my $res = GetISBDView({ Link Here
179
});
178
});
180
179
181
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
180
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
182
my $patron = Koha::Patrons->find( $loggedinuser );
183
for my $itm (@all_items) {
181
for my $itm (@all_items) {
184
    my $item = Koha::Items->find( $itm->{itemnumber} );
182
    my $item = Koha::Items->find( $itm->{itemnumber} );
185
    $norequests = 0
183
    $norequests = 0
(-)a/opac/opac-basket.pl (-2 / +4 lines)
Lines 18-23 Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use CGI qw ( -utf8 );
20
use CGI qw ( -utf8 );
21
use List::Util qw/none/; # well just one :)
22
21
use C4::Koha;
23
use C4::Koha;
22
use C4::Biblio;
24
use C4::Biblio;
23
use C4::Items;
25
use C4::Items;
Lines 59-66 if (C4::Context->preference('TagsEnabled')) { Link Here
59
my $borcat = q{};
61
my $borcat = q{};
60
if ( C4::Context->preference('OpacHiddenItemsExceptions') ) {
62
if ( C4::Context->preference('OpacHiddenItemsExceptions') ) {
61
    # we need to fetch the borrower info here, so we can pass the category
63
    # we need to fetch the borrower info here, so we can pass the category
62
    my $borrower = Koha::Patron->find( { borrowernumber -> $borrowernumber } );
64
    my $patron = Koha::Patrons->find($borrowernumber);
63
    $borcat = $borrower ? $borrower->categorycode : $borcat;
65
    $borcat = $patron ? $patron->categorycode : $borcat;
64
}
66
}
65
67
66
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
68
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 85-91 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
85
my @all_items = GetItemsInfo($biblionumber);
85
my @all_items = GetItemsInfo($biblionumber);
86
my @hiddenitems;
86
my @hiddenitems;
87
my $patron = Koha::Patrons->find( $borrowernumber );
87
my $patron = Koha::Patrons->find( $borrowernumber );
88
my $borcat= q{};
88
our $borcat= q{};
89
if ( C4::Context->preference('OpacHiddenItemsExceptions') ) {
89
if ( C4::Context->preference('OpacHiddenItemsExceptions') ) {
90
    $borcat = $patron ? $patron->categorycode : q{};
90
    $borcat = $patron ? $patron->categorycode : q{};
91
}
91
}
(-)a/opac/opac-search.pl (-3 / +1 lines)
Lines 125-130 else { Link Here
125
    authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
125
    authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
126
    }
126
    }
127
);
127
);
128
my $patron = Koha::Patrons->find( $borrowernumber );
128
129
129
my $lang = C4::Languages::getlanguage($cgi);
130
my $lang = C4::Languages::getlanguage($cgi);
130
131
Lines 627-634 my @sup_results_array; Link Here
627
my $search_context = {};
628
my $search_context = {};
628
$search_context->{'interface'} = 'opac';
629
$search_context->{'interface'} = 'opac';
629
if (C4::Context->preference('OpacHiddenItemsExceptions')){
630
if (C4::Context->preference('OpacHiddenItemsExceptions')){
630
    # we need to fetch the borrower info here, so we can pass the category
631
    my $patron = Koha::Patrons->find( { borrowernumber => $borrowernumber } );
632
    $search_context->{'category'} = $patron ? $patron->categorycode : q{};
631
    $search_context->{'category'} = $patron ? $patron->categorycode : q{};
633
}
632
}
634
633
Lines 655-661 for (my $i=0;$i<@servers;$i++) { Link Here
655
654
656
        my $art_req_itypes;
655
        my $art_req_itypes;
657
        if( C4::Context->preference('ArticleRequests') ) {
656
        if( C4::Context->preference('ArticleRequests') ) {
658
            my $patron = $borrowernumber ? Koha::Patrons->find( $borrowernumber ) : undef;
659
            $art_req_itypes = Koha::IssuingRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () });
657
            $art_req_itypes = Koha::IssuingRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () });
660
        }
658
        }
661
659
(-)a/t/db_dependent/Koha/BiblioUtils/Iterator.t (-1 / +1 lines)
Lines 22-29 use Test::More tests => 3; Link Here
22
use_ok('Koha::BiblioUtils');
22
use_ok('Koha::BiblioUtils');
23
use_ok('Koha::BiblioUtils::Iterator');
23
use_ok('Koha::BiblioUtils::Iterator');
24
24
25
use C4::Biblio;
26
use C4::Items;
25
use C4::Items;
26
use C4::Biblio;
27
use DBI;
27
use DBI;
28
use t::lib::TestBuilder;
28
use t::lib::TestBuilder;
29
use t::lib::Mocks;
29
use t::lib::Mocks;
(-)a/t/db_dependent/Labels/t_Label.t (-2 / +1 lines)
Lines 26-33 use MARC::Record; Link Here
26
use MARC::Field;
26
use MARC::Field;
27
use Data::Dumper;
27
use Data::Dumper;
28
28
29
use C4::Biblio;
30
use C4::Items;
29
use C4::Items;
30
use C4::Biblio;
31
use C4::Labels::Layout;
31
use C4::Labels::Layout;
32
32
33
use Koha::Database;
33
use Koha::Database;
34
- 

Return to bug 14385