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

(-)a/Koha/Patron/Consents.pm (-7 / +4 lines)
Lines 42-49 Koha::Objects class for handling patron consents Link Here
42
    Returns an HASHref of available consent types like:
42
    Returns an HASHref of available consent types like:
43
        { type1 => {}, type2 => {}, .. }
43
        { type1 => {}, type2 => {}, .. }
44
44
45
    Checks preferences OPACCustomConsentTypes and PrivacyPolicyConsent.
45
    Checks PrivacyPolicyConsent preference and any patron_consent_type plugins (if pref enabled).
46
    Calls patron_consent_type plugins (if pref enabled).
47
46
48
    Note: The plugins return an ARRAYref with type, title and description like:
47
    Note: The plugins return an ARRAYref with type, title and description like:
49
        [ my_type => { title => { lang => 1, .. }, description => { lang => 2, .. } } ]
48
        [ my_type => { title => { lang => 1, .. }, description => { lang => 2, .. } } ]
Lines 54-64 sub available_types { Link Here
54
    my ($self) = shift;
53
    my ($self) = shift;
55
    my $response = {};
54
    my $response = {};
56
    $response->{GDPR_PROCESSING} = 1 if C4::Context->preference('PrivacyPolicyConsent');
55
    $response->{GDPR_PROCESSING} = 1 if C4::Context->preference('PrivacyPolicyConsent');
57
    if ( C4::Context->preference('OPACCustomConsentTypes') ) {
56
    foreach my $return ( Koha::Plugins->call('patron_consent_type') ) {
58
        foreach my $return ( Koha::Plugins->call('patron_consent_type') ) {
57
        next if ref($return) ne 'ARRAY' or @$return != 2;    # ignoring bad input
59
            next if ref($return) ne 'ARRAY' or @$return != 2;    # ignoring bad input
58
        $response->{ $return->[0] } = $return->[1];
60
            $response->{ $return->[0] } = $return->[1];
61
        }
62
    }
59
    }
63
    return $response;
60
    return $response;
64
}
61
}
(-)a/Koha/Template/Plugin/KohaPlugins.pm (-1 / +1 lines)
Lines 291-297 This method returns true if the passed plugin hook method name is found to be in Link Here
291
=cut
291
=cut
292
292
293
sub feature_enabled {
293
sub feature_enabled {
294
    my ($self, $method) = @_;
294
    my ( $self, $method ) = @_;
295
295
296
    my $p = Koha::Plugins->new();
296
    my $p = Koha::Plugins->new();
297
    return 0 unless $p;
297
    return 0 unless $p;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc (-2 / +2 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaPlugins %]
2
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %]
3
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %]
3
    <div id="menu">
4
    <div id="menu">
4
        <ul>
5
        <ul>
Lines 24-30 Link Here
24
            [% END %]
25
            [% END %]
25
                <a href="/cgi-bin/koha/opac-memberentry.pl">Personal details</a></li>
26
                <a href="/cgi-bin/koha/opac-memberentry.pl">Personal details</a></li>
26
27
27
            [% IF Koha.Preference('PrivacyPolicyConsent') || Koha.Preference('CookieConsent') || Koha.Preference('OPACCustomConsentTypes') %]
28
            [% IF Koha.Preference('PrivacyPolicyConsent') || Koha.Preference('CookieConsent') || KohaPlugins.feature_enabled('patron_consent_type') %]
28
                [% IF consentview %]<li class="active">[% ELSE %]<li>[% END %]
29
                [% IF consentview %]<li class="active">[% ELSE %]<li>[% END %]
29
                    <a href="/cgi-bin/koha/opac-patron-consent.pl">Consents</a>
30
                    <a href="/cgi-bin/koha/opac-patron-consent.pl">Consents</a>
30
                </li>
31
                </li>
31
- 

Return to bug 31503