Lines 159-164
if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) {
Link Here
|
159 |
|
159 |
|
160 |
$borrower_data = $patron->unblessed; |
160 |
$borrower_data = $patron->unblessed; |
161 |
$borrower_data->{category_type} = $patron->category->category_type; |
161 |
$borrower_data->{category_type} = $patron->category->category_type; |
|
|
162 |
} else { |
163 |
$patron = Koha::Patron->new; |
162 |
} |
164 |
} |
163 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
165 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
164 |
my $category_type = $input->param('category_type') || ''; |
166 |
my $category_type = $input->param('category_type') || ''; |
Lines 280-291
$newdata{'lang'} = $input->param('lang') if defined($input->param('lang'))
Link Here
|
280 |
if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ ) { |
282 |
if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ ) { |
281 |
if ( ( defined $newdata{'firstname'} ) && ( defined $newdata{'surname'} ) ) { |
283 |
if ( ( defined $newdata{'firstname'} ) && ( defined $newdata{'surname'} ) ) { |
282 |
# Full page edit, firstname and surname input zones are present |
284 |
# Full page edit, firstname and surname input zones are present |
283 |
$newdata{'userid'} = Generate_Userid( $borrowernumber, $newdata{'firstname'}, $newdata{'surname'} ); |
285 |
$patron->firstname($newdata{firstname}); |
|
|
286 |
$patron->surname($newdata{surname}); |
287 |
$newdata{'userid'} = $patron->generate_userid; |
284 |
} |
288 |
} |
285 |
elsif ( ( defined $data{'firstname'} ) && ( defined $data{'surname'} ) ) { |
289 |
elsif ( ( defined $data{'firstname'} ) && ( defined $data{'surname'} ) ) { |
286 |
# Partial page edit (access through "Details"/"Library details" tab), firstname and surname input zones are not used |
290 |
# Partial page edit (access through "Details"/"Library details" tab), firstname and surname input zones are not used |
287 |
# Still, if the userid field is erased, we can create a new userid with available firstname and surname |
291 |
# Still, if the userid field is erased, we can create a new userid with available firstname and surname |
288 |
$newdata{'userid'} = Generate_Userid( $borrowernumber, $data{'firstname'}, $data{'surname'} ); |
292 |
# FIXME clean thiscode newdata vs data is very confusing |
|
|
293 |
$patron->firstname($data{firstname}); |
294 |
$patron->surname($data{surname}); |
295 |
$newdata{'userid'} = $patron->generate_userid; |
289 |
} |
296 |
} |
290 |
else { |
297 |
else { |
291 |
$newdata{'userid'} = $data{'userid'}; |
298 |
$newdata{'userid'} = $data{'userid'}; |
292 |
- |
|
|