Bugzilla – Attachment 101048 Details for
Bug 24151
Add a pseudonymization process for patrons and transactions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24151: Add items.homebranch to the list
Bug-24151-Add-itemshomebranch-to-the-list.patch (text/plain), 5.90 KB, created by
Jonathan Druart
on 2020-03-19 16:24:53 UTC
(
hide
)
Description:
Bug 24151: Add items.homebranch to the list
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-19 16:24:53 UTC
Size:
5.90 KB
patch
obsolete
>From 6b274467643d1ac73651fb7431c45a27dccf9443 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 17 Mar 2020 17:36:05 +0100 >Subject: [PATCH] Bug 24151: Add items.homebranch to the list > >Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr> >--- > Koha/PseudonymizedTransaction.pm | 4 ++++ > installer/data/mysql/atomicupdate/bug_24151.perl | 3 ++- > installer/data/mysql/kohastructure.sql | 1 + > .../prog/en/modules/admin/preferences/patrons.pref | 1 + > t/db_dependent/Koha/Pseudonymization.t | 5 +++-- > 5 files changed, 11 insertions(+), 3 deletions(-) > >diff --git a/Koha/PseudonymizedTransaction.pm b/Koha/PseudonymizedTransaction.pm >index c5b0e8836f..c7802dc839 100644 >--- a/Koha/PseudonymizedTransaction.pm >+++ b/Koha/PseudonymizedTransaction.pm >@@ -53,6 +53,9 @@ sub new_from_statistic { > if ( grep { $_ eq 'holdingbranch' } @t_fields_to_copy ) { > $values->{holdingbranch} = $statistic->item->holdingbranch; > } >+ if ( grep { $_ eq 'homebranch' } @t_fields_to_copy ) { >+ $values->{homebranch} = $statistic->item->homebranch; >+ } > if ( grep { $_ eq 'transaction_type' } @t_fields_to_copy ) { > $values->{transaction_type} = $statistic->type; > } >@@ -64,6 +67,7 @@ sub new_from_statistic { > @t_fields_to_copy = grep { > $_ ne 'transaction_branchcode' > && $_ ne 'holdingbranch' >+ && $_ ne 'homebranch' > && $_ ne 'transaction_type' > && $_ ne 'itemcallnumber' > } @t_fields_to_copy; >diff --git a/installer/data/mysql/atomicupdate/bug_24151.perl b/installer/data/mysql/atomicupdate/bug_24151.perl >index 62fd64db9e..f5a83d2d29 100644 >--- a/installer/data/mysql/atomicupdate/bug_24151.perl >+++ b/installer/data/mysql/atomicupdate/bug_24151.perl >@@ -23,6 +23,7 @@ if( CheckVersion( $DBversion ) ) { > `itemnumber` int(11) default NULL, > `itemtype` varchar(10) default NULL, > `holdingbranch` varchar(10) default null, >+ `homebranch` varchar(10) default null, > `location` varchar(80) default NULL, > `itemcallnumber` varchar(255) default NULL, > `ccode` varchar(80) default NULL, >@@ -44,7 +45,7 @@ if( CheckVersion( $DBversion ) ) { > |); > $dbh->do(q| > INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) >- VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple') >+ VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,homebranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple') > |); > > unless( TableExists( 'pseudonymized_borrower_attributes' ) ) { >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 9819e7d297..0900e8951a 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1911,6 +1911,7 @@ CREATE TABLE `pseudonymized_transactions` ( > `itemnumber` int(11) default NULL, > `itemtype` varchar(10) default NULL, > `holdingbranch` varchar(10) default null, >+ `homebranch` varchar(10) default null, > `location` varchar(80) default NULL, > `itemcallnumber` varchar(255) default NULL, > `ccode` varchar(80) default NULL, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 52a4e193bf..2f554c3d63 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -287,6 +287,7 @@ Patrons: > itemnumber: "Itemnumber" > itemtype: "Item type" > holdingbranch: "Holding branch" >+ homebranch: "Home branch" > location: "Location" > itemcallnumber: "Item's callnumber" > ccode: "Collection code" >diff --git a/t/db_dependent/Koha/Pseudonymization.t b/t/db_dependent/Koha/Pseudonymization.t >index 4e29dcbd47..0124e08475 100644 >--- a/t/db_dependent/Koha/Pseudonymization.t >+++ b/t/db_dependent/Koha/Pseudonymization.t >@@ -73,7 +73,7 @@ subtest 'Config does not exist' => sub { > > subtest 'Koha::Anonymized::Transactions tests' => sub { > >- plan tests => 11; >+ plan tests => 12; > > $schema->storage->txn_begin; > >@@ -92,7 +92,7 @@ subtest 'Koha::Anonymized::Transactions tests' => sub { > 'No pseudonymized transaction if Pseudonymization is off' ); > > t::lib::Mocks::mock_preference( 'Pseudonymization', 1 ); >- t::lib::Mocks::mock_preference( 'PseudonymizationTransactionFields', 'datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode' >+ t::lib::Mocks::mock_preference( 'PseudonymizationTransactionFields', 'datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,homebranch,location,itemcallnumber,ccode' > ); > $item = $builder->build_sample_item; > t::lib::Mocks::mock_userenv({ branchcode => $item->homebranch }); >@@ -108,6 +108,7 @@ subtest 'Koha::Anonymized::Transactions tests' => sub { > is( $pseudonymized->itemnumber, $item->itemnumber ); > is( $pseudonymized->itemtype, $item->effective_itemtype ); > is( $pseudonymized->holdingbranch, $item->holdingbranch ); >+ is( $pseudonymized->homebranch, $item->homebranch ); > is( $pseudonymized->location, $item->location ); > is( $pseudonymized->itemcallnumber, $item->itemcallnumber ); > is( $pseudonymized->ccode, $item->ccode ); >-- >2.20.1
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 24151
:
95959
|
95960
|
95961
|
95962
|
95963
|
95964
|
95965
|
95966
|
95967
|
95968
|
95969
|
95970
|
95971
|
95972
|
95973
|
95974
|
95975
|
95976
|
97240
|
97241
|
97242
|
97243
|
97244
|
97245
|
97246
|
97247
|
97248
|
97249
|
97250
|
97251
|
97252
|
101034
|
101035
|
101036
|
101037
|
101038
|
101039
|
101040
|
101041
|
101042
|
101043
|
101044
|
101045
|
101046
|
101047
|
101048
|
101049
|
105801
|
105802
|
105803
|
105804
|
105805
|
105806
|
105807
|
105808
|
105809
|
105810
|
105811
|
105812
|
105813
|
105814
|
105815
|
105816
|
106032
|
106033
|
106034
|
106035
|
106036
|
106037
|
106038
|
106039
|
106040
|
106041
|
106042
|
106043
|
106044
|
106045
|
106046
|
106047
|
106048
|
106049
|
106195
|
106255
|
107127
|
107225