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

(-)a/Koha/PseudonymizedTransaction.pm (+4 lines)
Lines 53-58 sub new_from_statistic { Link Here
53
    if ( grep { $_ eq 'holdingbranch' } @t_fields_to_copy ) {
53
    if ( grep { $_ eq 'holdingbranch' } @t_fields_to_copy ) {
54
        $values->{holdingbranch} = $statistic->item->holdingbranch;
54
        $values->{holdingbranch} = $statistic->item->holdingbranch;
55
    }
55
    }
56
    if ( grep { $_ eq 'homebranch' } @t_fields_to_copy ) {
57
        $values->{homebranch} = $statistic->item->homebranch;
58
    }
56
    if ( grep { $_ eq 'transaction_type' } @t_fields_to_copy ) {
59
    if ( grep { $_ eq 'transaction_type' } @t_fields_to_copy ) {
57
        $values->{transaction_type} = $statistic->type;
60
        $values->{transaction_type} = $statistic->type;
58
    }
61
    }
Lines 64-69 sub new_from_statistic { Link Here
64
    @t_fields_to_copy = grep {
67
    @t_fields_to_copy = grep {
65
             $_ ne 'transaction_branchcode'
68
             $_ ne 'transaction_branchcode'
66
          && $_ ne 'holdingbranch'
69
          && $_ ne 'holdingbranch'
70
          && $_ ne 'homebranch'
67
          && $_ ne 'transaction_type'
71
          && $_ ne 'transaction_type'
68
          && $_ ne 'itemcallnumber'
72
          && $_ ne 'itemcallnumber'
69
    } @t_fields_to_copy;
73
    } @t_fields_to_copy;
(-)a/installer/data/mysql/atomicupdate/bug_24151.perl (-1 / +2 lines)
Lines 23-28 if( CheckVersion( $DBversion ) ) { Link Here
23
              `itemnumber` int(11) default NULL,
23
              `itemnumber` int(11) default NULL,
24
              `itemtype` varchar(10) default NULL,
24
              `itemtype` varchar(10) default NULL,
25
              `holdingbranch` varchar(10) default null,
25
              `holdingbranch` varchar(10) default null,
26
              `homebranch` varchar(10) default null,
26
              `location` varchar(80) default NULL,
27
              `location` varchar(80) default NULL,
27
              `itemcallnumber` varchar(255) default NULL,
28
              `itemcallnumber` varchar(255) default NULL,
28
              `ccode` varchar(80) default NULL,
29
              `ccode` varchar(80) default NULL,
Lines 44-50 if( CheckVersion( $DBversion ) ) { Link Here
44
    |);
45
    |);
45
    $dbh->do(q|
46
    $dbh->do(q|
46
        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
47
        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
47
        VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple')
48
        VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,homebranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple')
48
    |);
49
    |);
49
50
50
    unless( TableExists( 'pseudonymized_borrower_attributes' ) ) {
51
    unless( TableExists( 'pseudonymized_borrower_attributes' ) ) {
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1911-1916 CREATE TABLE `pseudonymized_transactions` ( Link Here
1911
  `itemnumber` int(11) default NULL,
1911
  `itemnumber` int(11) default NULL,
1912
  `itemtype` varchar(10) default NULL,
1912
  `itemtype` varchar(10) default NULL,
1913
  `holdingbranch` varchar(10) default null,
1913
  `holdingbranch` varchar(10) default null,
1914
  `homebranch` varchar(10) default null,
1914
  `location` varchar(80) default NULL,
1915
  `location` varchar(80) default NULL,
1915
  `itemcallnumber` varchar(255) default NULL,
1916
  `itemcallnumber` varchar(255) default NULL,
1916
  `ccode` varchar(80) default NULL,
1917
  `ccode` varchar(80) default NULL,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+1 lines)
Lines 287-292 Patrons: Link Here
287
             itemnumber: "Itemnumber"
287
             itemnumber: "Itemnumber"
288
             itemtype: "Item type"
288
             itemtype: "Item type"
289
             holdingbranch: "Holding branch"
289
             holdingbranch: "Holding branch"
290
             homebranch: "Home branch"
290
             location: "Location"
291
             location: "Location"
291
             itemcallnumber: "Item's callnumber"
292
             itemcallnumber: "Item's callnumber"
292
             ccode: "Collection code"
293
             ccode: "Collection code"
(-)a/t/db_dependent/Koha/Pseudonymization.t (-3 / +3 lines)
Lines 73-79 subtest 'Config does not exist' => sub { Link Here
73
73
74
subtest 'Koha::Anonymized::Transactions tests' => sub {
74
subtest 'Koha::Anonymized::Transactions tests' => sub {
75
75
76
    plan tests => 11;
76
    plan tests => 12;
77
77
78
    $schema->storage->txn_begin;
78
    $schema->storage->txn_begin;
79
79
Lines 92-98 subtest 'Koha::Anonymized::Transactions tests' => sub { Link Here
92
        'No pseudonymized transaction if Pseudonymization is off' );
92
        'No pseudonymized transaction if Pseudonymization is off' );
93
93
94
    t::lib::Mocks::mock_preference( 'Pseudonymization', 1 );
94
    t::lib::Mocks::mock_preference( 'Pseudonymization', 1 );
95
    t::lib::Mocks::mock_preference( 'PseudonymizationTransactionFields', 'datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode'
95
    t::lib::Mocks::mock_preference( 'PseudonymizationTransactionFields', 'datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,homebranch,location,itemcallnumber,ccode'
96
    );
96
    );
97
    $item = $builder->build_sample_item;
97
    $item = $builder->build_sample_item;
98
    t::lib::Mocks::mock_userenv({ branchcode => $item->homebranch });
98
    t::lib::Mocks::mock_userenv({ branchcode => $item->homebranch });
Lines 108-113 subtest 'Koha::Anonymized::Transactions tests' => sub { Link Here
108
    is( $pseudonymized->itemnumber,             $item->itemnumber );
108
    is( $pseudonymized->itemnumber,             $item->itemnumber );
109
    is( $pseudonymized->itemtype,               $item->effective_itemtype );
109
    is( $pseudonymized->itemtype,               $item->effective_itemtype );
110
    is( $pseudonymized->holdingbranch,          $item->holdingbranch );
110
    is( $pseudonymized->holdingbranch,          $item->holdingbranch );
111
    is( $pseudonymized->homebranch,             $item->homebranch );
111
    is( $pseudonymized->location,               $item->location );
112
    is( $pseudonymized->location,               $item->location );
112
    is( $pseudonymized->itemcallnumber,         $item->itemcallnumber );
113
    is( $pseudonymized->itemcallnumber,         $item->itemcallnumber );
113
    is( $pseudonymized->ccode,                  $item->ccode );
114
    is( $pseudonymized->ccode,                  $item->ccode );
114
- 

Return to bug 24151