use Koha::CirculationRules;
#Setting variables
-my $input = new CGI;
+my $input = CGI->new;
unless ( C4::Context->preference('Version') ) {
print $input->redirect("/cgi-bin/koha/installer/install.pl");
my $secondpassword = $input->param('password2') || '';
my $cardnumber = $input->param('cardnumber');
my $userid = $input->param('userid');
+ my $categorycode = $input->param('categorycode_entry');
+ my $patron_category =
+ Koha::Patron::Categories->find( $categorycode );
+
+ my ( $is_valid, $passworderror ) =
+ Koha::AuthUtils::is_password_valid( $firstpassword,
+ $patron_category );
- my ( $is_valid, $passworderror) = Koha::AuthUtils::is_password_valid( $firstpassword );
if ( my $error_code = checkcardnumber($cardnumber) ) {
if ( $error_code == 1 ) {
firstname => scalar $input->param('firstname'),
cardnumber => scalar $input->param('cardnumber'),
branchcode => scalar $input->param('libraries'),
- categorycode => scalar $input->param('categorycode_entry'),
+ categorycode => $categorycode,
userid => scalar $input->param('userid'),
privacy => "default",
address => "",
flags => 1, # Will be superlibrarian
};
- my $patron_category =
- Koha::Patron::Categories->find( $patron_data->{categorycode} );
$patron_data->{dateexpiry} =
$patron_category->get_expiry_date( $patron_data->{dateenrolled} );
hardduedatecompare => -1,
holds_per_day => $holds_per_day,
holds_per_record => $holds_per_record,
- maxissueqty => "",
+ maxissueqty => $maxissueqty,
maxonsiteissueqty => "",
maxsuspensiondays => "",
no_auto_renewal_after => "",
rentaldiscount => 0,
reservesallowed => $reservesallowed,
suspension_chargeperiod => undef,
+ decreaseloanholds => undef,
}
};
warn $@;
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' };
- }
+ push @messages, { code => 'success_on_insert_circ_rule' };
}
}
template_name => "onboarding/onboardingstep${step}.tt",
query => $input,
type => "intranet",
- authnotrequired => 0,
debug => 1,
}
);