Lines 252-269
if ( $op eq 'cud-insert' || $op eq 'edit_form' || $op eq 'cud-save' || $op eq 'd
Link Here
|
252 |
} |
252 |
} |
253 |
} |
253 |
} |
254 |
|
254 |
|
255 |
# Test uniqueness of surname, firstname and dateofbirth |
255 |
#Test uniqueness of fields in PatronDuplicateMatchingAddFields |
256 |
if ( ( $op eq 'cud-insert' ) and !$nodouble ) { |
256 |
if ( ( $op eq 'cud-insert' ) and !$nodouble ) { |
257 |
my @dup_fields = split '\|', C4::Context->preference('PatronDuplicateMatchingAddFields'); |
|
|
258 |
my $conditions; |
259 |
for my $f (@dup_fields) { |
260 |
$conditions->{$f} = $newdata{$f} if $newdata{$f}; |
261 |
} |
262 |
$nodouble = 1; |
257 |
$nodouble = 1; |
263 |
my $patrons = Koha::Patrons->search($conditions); |
258 |
my $match_result = Koha::Patrons->check_for_existing_matches( \%newdata ); |
264 |
if ( $patrons->count > 0 ) { |
259 |
if ( $match_result->{duplicate_found} ) { |
265 |
$nodouble = 0; |
260 |
$nodouble = 0; |
266 |
$check_patron = $patrons->next; |
261 |
$check_patron = $match_result->{matching_patrons}->next; |
267 |
$check_member = $check_patron->borrowernumber; |
262 |
$check_member = $check_patron->borrowernumber; |
268 |
} |
263 |
} |
269 |
} |
264 |
} |
270 |
- |
|
|