Lines 45-50
use Koha::LibraryCategories;
Link Here
|
45 |
use Koha::Database; |
45 |
use Koha::Database; |
46 |
use Koha::DateUtils; |
46 |
use Koha::DateUtils; |
47 |
use Koha::Patron::Categories; |
47 |
use Koha::Patron::Categories; |
|
|
48 |
use Koha::Patron::Category; |
48 |
use Koha::Patron::HouseboundRole; |
49 |
use Koha::Patron::HouseboundRole; |
49 |
use Koha::Patron::HouseboundRoles; |
50 |
use Koha::Patron::HouseboundRoles; |
50 |
use Koha::Token; |
51 |
use Koha::Token; |
Lines 91-97
my $dbh = DBI->connect(
Link Here
|
91 |
); |
92 |
); |
92 |
|
93 |
|
93 |
#Store the value of the template input name='op' in the variable $op so we can check if the user has pressed the button with the name="op" and value="finish" meaning the user has finished the onboarding tool. |
94 |
#Store the value of the template input name='op' in the variable $op so we can check if the user has pressed the button with the name="op" and value="finish" meaning the user has finished the onboarding tool. |
94 |
my $op = $input->param('op'); |
95 |
my $op = $input->param('op') || ""; |
95 |
$template->param( 'op' => $op ); |
96 |
$template->param( 'op' => $op ); |
96 |
|
97 |
|
97 |
if ( $op && $op eq 'finish' ) |
98 |
if ( $op && $op eq 'finish' ) |
Lines 241-248
elsif ( $step && $step == 2 ) {
Link Here
|
241 |
#Create a patron |
242 |
#Create a patron |
242 |
} |
243 |
} |
243 |
elsif ( $step && $step == 3 ) { |
244 |
elsif ( $step && $step == 3 ) { |
244 |
my $firstpassword = $input->param('password'); |
245 |
my $firstpassword = $input->param('password') || ""; |
245 |
my $secondpassword = $input->param('password2'); |
246 |
my $secondpassword = $input->param('password2') || ""; |
246 |
|
247 |
|
247 |
|
248 |
|
248 |
#Find all patron records in the database and hand them to the template |
249 |
#Find all patron records in the database and hand them to the template |
Lines 280-285
elsif ( $step && $step == 3 ) {
Link Here
|
280 |
my $categories = Koha::Patron::Categories->search(); |
281 |
my $categories = Koha::Patron::Categories->search(); |
281 |
$template->param( 'categories' => $categories, ); |
282 |
$template->param( 'categories' => $categories, ); |
282 |
|
283 |
|
|
|
284 |
|
285 |
|
286 |
|
283 |
#Incrementing the highest existing patron cardnumber to prevent duplicate cardnumber entry |
287 |
#Incrementing the highest existing patron cardnumber to prevent duplicate cardnumber entry |
284 |
my $exisiting_cardnumber = my $sth_search = |
288 |
my $exisiting_cardnumber = my $sth_search = |
285 |
$dbh->prepare("SELECT MAX(cardnumber) FROM borrowers"); |
289 |
$dbh->prepare("SELECT MAX(cardnumber) FROM borrowers"); |
Lines 378-385
elsif ( $step && $step == 3 ) {
Link Here
|
378 |
$newdata{userid} = $input->param('userid'); |
382 |
$newdata{userid} = $input->param('userid'); |
379 |
$newdata{password} = $input->param('password'); |
383 |
$newdata{password} = $input->param('password'); |
380 |
$newdata{password2} = $input->param('password2'); |
384 |
$newdata{password2} = $input->param('password2'); |
381 |
$newdata{dateexpiry} = '12/10/2016'; |
|
|
382 |
$newdata{privacy} = "default"; |
385 |
$newdata{privacy} = "default"; |
|
|
386 |
$newdata{address} = ""; |
387 |
$newdata{city} = ""; |
388 |
|
389 |
#Determine the dateexpiry of the patron based on the patron category it is created from |
390 |
my $patron_category = Koha::Patron::Categories->find( $newdata{categorycode} ); |
391 |
$newdata{dateexpiry} = $patron_category->get_expiry_date( $newdata{dateenrolled} ); |
383 |
|
392 |
|
384 |
#Hand the newdata hash to the AddMember subroutine in the C4::Members module and it creates a patron and hands back a borrowernumber which is being stored |
393 |
#Hand the newdata hash to the AddMember subroutine in the C4::Members module and it creates a patron and hands back a borrowernumber which is being stored |
385 |
my $borrowernumber = &AddMember(%newdata); |
394 |
my $borrowernumber = &AddMember(%newdata); |
386 |
- |
|
|