|
Lines 173-184
if ( $step == 3 ) {
Link Here
|
| 173 |
branchcode => scalar $input->param('libraries'), |
173 |
branchcode => scalar $input->param('libraries'), |
| 174 |
categorycode => scalar $input->param('categorycode_entry'), |
174 |
categorycode => scalar $input->param('categorycode_entry'), |
| 175 |
userid => scalar $input->param('userid'), |
175 |
userid => scalar $input->param('userid'), |
| 176 |
password => scalar $input->param('password'), |
|
|
| 177 |
password2 => scalar $input->param('password2'), |
| 178 |
privacy => "default", |
176 |
privacy => "default", |
| 179 |
address => "", |
177 |
address => "", |
| 180 |
city => "", |
178 |
city => "", |
| 181 |
flags => 1, # Will be superlibrarian |
179 |
flags => 1, # Will be superlibrarian |
| 182 |
}; |
180 |
}; |
| 183 |
|
181 |
|
| 184 |
my $patron_category = |
182 |
my $patron_category = |
|
Lines 187-193
if ( $step == 3 ) {
Link Here
|
| 187 |
$patron_category->get_expiry_date( $patron_data->{dateenrolled} ); |
185 |
$patron_category->get_expiry_date( $patron_data->{dateenrolled} ); |
| 188 |
|
186 |
|
| 189 |
eval { |
187 |
eval { |
| 190 |
Koha::Patron->new($patron_data)->store; |
188 |
my $patron = Koha::Patron->new($patron_data)->store; |
|
|
189 |
$patron->update_password($patron->userid, $firstpassword); |
| 191 |
}; |
190 |
}; |
| 192 |
|
191 |
|
| 193 |
#Error handling checking if the patron was created successfully |
192 |
#Error handling checking if the patron was created successfully |
|
Lines 195-200
if ( $step == 3 ) {
Link Here
|
| 195 |
push @messages, { code => 'success_on_insert_patron' }; |
194 |
push @messages, { code => 'success_on_insert_patron' }; |
| 196 |
} |
195 |
} |
| 197 |
else { |
196 |
else { |
|
|
197 |
warn $@; |
| 198 |
push @messages, { code => 'error_on_insert_patron' }; |
198 |
push @messages, { code => 'error_on_insert_patron' }; |
| 199 |
} |
199 |
} |
| 200 |
} |
200 |
} |
| 201 |
- |
|
|