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 509-515 Link Here
509
                                                        [% END # IF RequestOnOpac %]
509
                                                        [% END # IF RequestOnOpac %]
510
510
511
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
511
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
512
                                                            [% IF Koha.Preference('ArticleRequests') %]
512
                                                            [% IF SEARCH_RESULT.artreqpossible %]
513
                                                                <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a></span>
513
                                                                <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a></span>
514
                                                            [% END %]
514
                                                            [% END %]
515
                                                        [% END %]
515
                                                        [% 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 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
- 

Return to bug 17530