Bugzilla – Attachment 78783 Details for
Bug 20819
GDPR: Add a consent field for processing personal data in account menu and self-registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20819: Add Koha object classes for patron consents
Bug-20819-Add-Koha-object-classes-for-patron-conse.patch (text/plain), 5.36 KB, created by
Biblibre Sandboxes
on 2018-09-14 22:25:01 UTC
(
hide
)
Description:
Bug 20819: Add Koha object classes for patron consents
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2018-09-14 22:25:01 UTC
Size:
5.36 KB
patch
obsolete
>From 015f86e184c143537ad282e7d143954cc98226c1 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 28 May 2018 13:05:53 +0200 >Subject: [PATCH] Bug 20819: Add Koha object classes for patron consents >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Introduces Koha::Patron::Consent[s] for new table. >Adds basic CRUD test. > >Test plan: >Run t/db_dependent/Koha/Patron/Consents.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > Koha/Patron/Consent.pm | 44 ++++++++++++++++++++++++++++ > Koha/Patron/Consents.pm | 55 +++++++++++++++++++++++++++++++++++ > t/db_dependent/Koha/Patron/Consents.t | 48 ++++++++++++++++++++++++++++++ > 3 files changed, 147 insertions(+) > create mode 100644 Koha/Patron/Consent.pm > create mode 100644 Koha/Patron/Consents.pm > create mode 100644 t/db_dependent/Koha/Patron/Consents.t > >diff --git a/Koha/Patron/Consent.pm b/Koha/Patron/Consent.pm >new file mode 100644 >index 0000000..fb731bd >--- /dev/null >+++ b/Koha/Patron/Consent.pm >@@ -0,0 +1,44 @@ >+package Koha::Patron::Consent; >+ >+# Copyright 2018 Rijksmuseum >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::Patron::Consent >+ >+=head1 DESCRIPTION >+ >+Koha::Object class for handling patron consents >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'PatronConsent'; >+} >+ >+1; >diff --git a/Koha/Patron/Consents.pm b/Koha/Patron/Consents.pm >new file mode 100644 >index 0000000..e169177 >--- /dev/null >+++ b/Koha/Patron/Consents.pm >@@ -0,0 +1,55 @@ >+package Koha::Patron::Consents; >+ >+# Copyright 2018 Rijksmuseum >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use base qw(Koha::Objects); >+use Koha::Patron::Consent; >+ >+=head1 NAME >+ >+Koha::Patron::Consents >+ >+=head1 DESCRIPTION >+ >+Koha::Objects class for handling patron consents >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'PatronConsent'; >+} >+ >+=head3 object_class >+ >+=cut >+ >+sub object_class { >+ return 'Koha::Patron::Consent'; >+} >+ >+1; >diff --git a/t/db_dependent/Koha/Patron/Consents.t b/t/db_dependent/Koha/Patron/Consents.t >new file mode 100644 >index 0000000..ab9ed66 >--- /dev/null >+++ b/t/db_dependent/Koha/Patron/Consents.t >@@ -0,0 +1,48 @@ >+#!/usr/bin/perl >+ >+# Copyright 2018 Rijksmuseum >+# >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 1; >+ >+use t::lib::TestBuilder; >+ >+use Koha::Database; >+use Koha::DateUtils qw/dt_from_string/; >+use Koha::Patron::Consents; >+ >+our $builder = t::lib::TestBuilder->new; >+our $schema = Koha::Database->new->schema; >+ >+subtest 'Basic tests for Koha::Patron::Consent' => sub { >+ plan tests => 2; >+ $schema->storage->txn_begin; >+ >+ my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $consent1 = Koha::Patron::Consent->new({ >+ borrowernumber => $patron1->borrowernumber, >+ type => 'GDPR_PROCESSING', >+ given_on => dt_from_string, >+ })->store; >+ is( Koha::Patron::Consents->search({ borrowernumber => $patron1->borrowernumber })->count, 1, 'One consent for new borrower' ); >+ $consent1->delete; >+ is( Koha::Patron::Consents->search({ borrowernumber => $patron1->borrowernumber })->count, 0, 'No consents left for new borrower' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20819
:
75765
|
75766
|
75767
|
75818
|
75819
|
75820
|
76781
|
76782
|
76783
|
76784
|
76785
|
77264
|
77265
|
77266
|
77267
|
77268
|
77269
|
78369
|
78370
|
78371
|
78372
|
78373
|
78374
|
78779
|
78781
|
78783
|
78784
|
78786
|
78788
|
79059
|
79062
|
79063
|
79064
|
79065
|
79066
|
79067
|
79129
|
79130
|
79131
|
79132
|
79133
|
79134
|
79135
|
79175
|
79190