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

(-)a/Koha/ILL/Request.pm (+41 lines)
Lines 2218-2223 sub can_patron_place_ill_in_opac { Link Here
2218
    return 1;
2218
    return 1;
2219
}
2219
}
2220
2220
2221
=head3 pseudonymize_illrequestattributes
2222
2223
    $illrequest->pseudonymize_illrequestattributes($transaction);
2224
2225
This method creates a Koha::PseudonymizedTransaction object, adding pseudonymized ILL request attributes and backend info as metadata values.
2226
2227
=cut
2228
2229
sub pseudonymize_illrequestattributes {
2230
    my ( $self, $transaction ) = @_;
2231
2232
    my @attributes_to_pseudonymize = qw(
2233
        type
2234
    );
2235
2236
    my $extended_attributes = $self->extended_attributes;
2237
    while ( my $attribute = $extended_attributes->next ) {
2238
        if ( grep { $_ eq $attribute->type } @attributes_to_pseudonymize ) {
2239
            $transaction->_result->create_related(
2240
                'pseudonymized_metadata_values',
2241
                {
2242
                    key       => $attribute->type,
2243
                    value     => $attribute->value,
2244
                    tablename => 'illrequestattributes',
2245
                }
2246
            ) if $attribute->value ne '';
2247
        }
2248
    }
2249
2250
    if ( $self->backend ) {
2251
        $transaction->_result->create_related(
2252
            'pseudonymized_metadata_values',
2253
            {
2254
                key       => 'backend',
2255
                value     => $self->backend,
2256
                tablename => 'illrequestattributes',
2257
            }
2258
        );
2259
    }
2260
}
2261
2221
=head3 get_op_param_deprecation
2262
=head3 get_op_param_deprecation
2222
2263
2223
    my $op = $req->check_url_param_deprecation($params);
2264
    my $op = $req->check_url_param_deprecation($params);
(-)a/Koha/PseudonymizedTransaction.pm (-1 / +8 lines)
Lines 22-27 use List::MoreUtils qw(any); Link Here
22
use Koha::Database;
22
use Koha::Database;
23
use Koha::Exceptions::Config;
23
use Koha::Exceptions::Config;
24
use Koha::Patrons;
24
use Koha::Patrons;
25
use Koha::ILL::Requests;
25
26
26
use base qw(Koha::Object);
27
use base qw(Koha::Object);
27
28
Lines 111-116 sub new_from_statistic { Link Here
111
        }
112
        }
112
    }
113
    }
113
114
115
    if ( $statistic->illrequest_id ) {
116
        my $illrequest = Koha::ILL::Requests->find( $statistic->illrequest_id );
117
        if ($illrequest) {
118
            $illrequest->pseudonymize_illrequestattributes($self);
119
        }
120
    }
121
114
    return $self;
122
    return $self;
115
}
123
}
116
124
117
- 

Return to bug 37901