Bug 12598: Re-add some missing stuffs

This patch will have to be squashed with previous ones, but for
readability I prefer to let it alone for now.

It reintroduces 2 missing changes:
  commit fd12390365
    Bug 15010: Import patron tool creates 'duplicate' restrictions (
    debarments )
  commit 011d8e9855
    Bug 12543 - Add userid as matchpoint for "Import patrons" tool

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-07-25 10:19:20 -03:00
parent c9c0697ca5
commit b361ff2d7d
1 changed files with 5 additions and 1 deletions

View File

@ -165,6 +165,9 @@ sub import_patrons {
if ( defined($matchpoint) && ( $matchpoint eq 'cardnumber' ) && ( $borrower{'cardnumber'} ) ) {
$member = Koha::Patrons->find( { cardnumber => $borrower{'cardnumber'} } );
}
elsif ( ($matchpoint eq 'userid') && ($borrower{'userid'}) ) {
$member = Koha::Patrons->find( { userid => $borrower{userid} } );
}
elsif ($extended) {
if ( defined($matchpoint_attr_type) ) {
foreach my $attr (@$patron_attributes) {
@ -244,7 +247,8 @@ sub import_patrons {
);
next LINE;
}
if ( $borrower{debarred} ) {
# Don't add a new restriction if the existing 'combined' restriction matches this one
if ( $borrower{debarred} && ( ( $borrower{debarred} ne $member->{debarred} ) || ( $borrower{debarredcomment} ne $member->{debarredcomment} ) ) ) {
# Check to see if this debarment already exists
my $debarrments = GetDebarments(