Lines 56-61
use Koha::ItemTypes;
Link Here
|
56 |
use Koha::Ratings; |
56 |
use Koha::Ratings; |
57 |
use Koha::Virtualshelves; |
57 |
use Koha::Virtualshelves; |
58 |
use Koha::Library::Groups; |
58 |
use Koha::Library::Groups; |
|
|
59 |
use Koha::Patrons; |
59 |
|
60 |
|
60 |
use POSIX qw(ceil floor strftime); |
61 |
use POSIX qw(ceil floor strftime); |
61 |
use URI::Escape; |
62 |
use URI::Escape; |
Lines 641-646
for (my $i=0;$i<@servers;$i++) {
Link Here
|
641 |
} |
642 |
} |
642 |
$hits = 0 unless @newresults; |
643 |
$hits = 0 unless @newresults; |
643 |
|
644 |
|
|
|
645 |
my $categorycode; # needed for may_article_request |
646 |
if( $borrowernumber && C4::Context->preference('ArticleRequests') ) { |
647 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
648 |
$categorycode = $patron ? $patron->categorycode : undef; |
649 |
} |
650 |
|
644 |
foreach my $res (@newresults) { |
651 |
foreach my $res (@newresults) { |
645 |
|
652 |
|
646 |
# must define a value for size if not present in DB |
653 |
# must define a value for size if not present in DB |
Lines 696-701
for (my $i=0;$i<@servers;$i++) {
Link Here
|
696 |
$res->{ratings} = $ratings; |
703 |
$res->{ratings} = $ratings; |
697 |
$res->{my_rating} = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef; |
704 |
$res->{my_rating} = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef; |
698 |
} |
705 |
} |
|
|
706 |
|
707 |
# BZ17530: 'Intelligent' guess if result can be article requested |
708 |
$res->{artreqpossible} = Koha::Biblio->may_article_request({ |
709 |
categorycode => $categorycode, |
710 |
itemtype => $res->{itemtype}, |
711 |
}); |
699 |
} |
712 |
} |
700 |
|
713 |
|
701 |
if ($results_hashref->{$server}->{"hits"}){ |
714 |
if ($results_hashref->{$server}->{"hits"}){ |
702 |
- |
|
|