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

(-)a/C4/Auth.pm (-1 / +3 lines)
Lines 501-507 sub get_template_and_user { Link Here
501
501
502
    # Decide if the patron can make suggestions in the OPAC
502
    # Decide if the patron can make suggestions in the OPAC
503
    my $can_make_suggestions;
503
    my $can_make_suggestions;
504
    if ( C4::Context->userenv && C4::Context->userenv->{'number'} ) {
504
    if ( C4::Context->preference('Suggestion') && C4::Context->preference('AnonSuggestions') ) {
505
        $can_make_suggestions = 1;
506
    } elsif ( C4::Context->userenv && C4::Context->userenv->{'number'} ) {
505
        $can_make_suggestions = Koha::Patrons->find(C4::Context->userenv->{'number'})->category->can_make_suggestions;
507
        $can_make_suggestions = Koha::Patrons->find(C4::Context->userenv->{'number'})->category->can_make_suggestions;
506
    }
508
    }
507
509
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-1 / +1 lines)
Lines 329-335 Link Here
329
                            <a href="/cgi-bin/koha/opac-browse.pl">Browse search</a>
329
                            <a href="/cgi-bin/koha/opac-browse.pl">Browse search</a>
330
                        </li>
330
                        </li>
331
                    [% END %]
331
                    [% END %]
332
                    [% IF Koha.Preference( 'suggestion' ) == 1 %]
332
                    [% IF suggestion %]
333
                        [% IF Koha.Preference( 'AnonSuggestions' ) == 1 || Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
333
                        [% IF Koha.Preference( 'AnonSuggestions' ) == 1 || Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
334
                            <li class="nav-item">
334
                            <li class="nav-item">
335
                                <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">Purchase suggestions</a>
335
                                <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">Purchase suggestions</a>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-1 / +1 lines)
Lines 549-555 Link Here
549
                    [% END # / IF total %]
549
                    [% END # / IF total %]
550
550
551
                    [%# Display "Not finding what you're looking for" for suggestion or ILL %]
551
                    [%# Display "Not finding what you're looking for" for suggestion or ILL %]
552
                    [% IF suggestion && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername ) || ( Koha.Preference( 'ILLModule' ) == 1 && loggedinusername ) %]
552
                    [% IF suggestion || ( Koha.Preference( 'ILLModule' ) == 1 && loggedinusername ) %]
553
                        <div class="suggestion">
553
                        <div class="suggestion">
554
                            Not finding what you're looking for?
554
                            Not finding what you're looking for?
555
                            <ul>
555
                            <ul>
(-)a/opac/opac-suggestions.pl (-4 / +5 lines)
Lines 94-102 else { Link Here
94
}
94
}
95
95
96
# If suggestions are turned off, or this patron belongs to a category not allowed to make suggestions (suggestionPatronCategoryExceptions syspref) we redirect to 404 error. This will also redirect guest suggestions
96
# If suggestions are turned off, or this patron belongs to a category not allowed to make suggestions (suggestionPatronCategoryExceptions syspref) we redirect to 404 error. This will also redirect guest suggestions
97
if ( !Koha::Patrons->find( $borrowernumber )->category->can_make_suggestions ) {
97
if ( defined $borrowernumber ) {
98
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
98
    if ( (!Koha::Patrons->find( $borrowernumber )->category->can_make_suggestions) ) {
99
    exit;
99
        print $input->redirect("/cgi-bin/koha/errors/404.pl");
100
        exit;
101
    }
100
}
102
}
101
103
102
my $suggested_by;
104
my $suggested_by;
103
- 

Return to bug 31333