use C4::InstallAuth;
use CGI qw ( -utf8 );
use C4::Output;
+use C4::Members qw(checkcardnumber);
use Koha::Patrons;
use Koha::Libraries;
use Koha::Database;
branchcode => scalar $input->param('libraries'),
categorycode => scalar $input->param('categorycode_entry'),
userid => scalar $input->param('userid'),
- password => scalar $input->param('password'),
- password2 => scalar $input->param('password2'),
privacy => "default",
address => "",
city => "",
- flags => 1, # Will be superlibrarian
+ flags => 1, # Will be superlibrarian
};
my $patron_category =
$patron_category->get_expiry_date( $patron_data->{dateenrolled} );
eval {
- Koha::Patron->new($patron_data)->store;
+ my $patron = Koha::Patron->new($patron_data)->store;
+ $patron->set_password({ password => $firstpassword });
};
#Error handling checking if the patron was created successfully
push @messages, { code => 'success_on_insert_patron' };
}
else {
+ warn $@;
push @messages, { code => 'error_on_insert_patron' };
}
}
branchcode => $branchcode,
categorycode => $categorycode,
itemtype => $itemtype,
- maxissueqty => $maxissueqty,
renewalsallowed => $renewalsallowed,
renewalperiod => $renewalperiod,
issuelength => $issuelength,
my $issuingrule = Koha::IssuingRule->new($params);
eval { $issuingrule->store; };
- unless ($@) {
- push @messages, { code => 'success_on_insert_circ_rule' };
- }
- else {
+ if ($@) {
push @messages, { code => 'error_on_insert_circ_rule' };
+ } else {
+
+ eval {
+ Koha::CirculationRules->set_rules(
+ {
+ categorycode => $categorycode,
+ itemtype => $itemtype,
+ branchcode => $branchcode,
+ rules => {
+ maxissueqty => $maxissueqty,
+ }
+ }
+ );
+ };
+
+ unless ($@) {
+ push @messages, { code => 'success_on_insert_circ_rule' };
+ }
+ else {
+ push @messages, { code => 'error_on_insert_circ_rule' };
+ }
}
}