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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-1 / +1 lines)
Lines 507-513 Link Here
507
                                                        [% END # IF RequestOnOpac %]
507
                                                        [% END # IF RequestOnOpac %]
508
508
509
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
509
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
510
                                                            [% IF Koha.Preference('ArticleRequests') %]
510
                                                            [% IF SEARCH_RESULT.artreqpossible %]
511
                                                                <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Request article</a></span>
511
                                                                <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Request article</a></span>
512
                                                            [% END %]
512
                                                            [% END %]
513
                                                        [% END %]
513
                                                        [% END %]
(-)a/opac/opac-search.pl (-1 / +13 lines)
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
- 

Return to bug 17530