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 |
} |