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