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 644-649
for (my $i=0;$i<@servers;$i++) {
Link Here
|
644 |
} |
645 |
} |
645 |
$hits = 0 unless @newresults; |
646 |
$hits = 0 unless @newresults; |
646 |
|
647 |
|
|
|
648 |
my $categorycode; # needed for may_article_request |
649 |
if( $borrowernumber && C4::Context->preference('ArticleRequests') ) { |
650 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
651 |
$categorycode = $patron ? $patron->categorycode : undef; |
652 |
} |
653 |
|
647 |
foreach my $res (@newresults) { |
654 |
foreach my $res (@newresults) { |
648 |
|
655 |
|
649 |
# must define a value for size if not present in DB |
656 |
# must define a value for size if not present in DB |
Lines 699-704
for (my $i=0;$i<@servers;$i++) {
Link Here
|
699 |
$res->{ratings} = $ratings; |
706 |
$res->{ratings} = $ratings; |
700 |
$res->{my_rating} = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef; |
707 |
$res->{my_rating} = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef; |
701 |
} |
708 |
} |
|
|
709 |
|
710 |
# BZ17530: 'Intelligent' guess if result can be article requested |
711 |
$res->{artreqpossible} = Koha::Biblio->may_article_request({ |
712 |
categorycode => $categorycode, |
713 |
itemtype => $res->{itemtype}, |
714 |
}); |
702 |
} |
715 |
} |
703 |
|
716 |
|
704 |
if ($results_hashref->{$server}->{"hits"}){ |
717 |
if ($results_hashref->{$server}->{"hits"}){ |
705 |
- |
|
|