|
Lines 143-150
elsif ( $start && $start eq 'Minimal item type setup' ) {
Link Here
|
| 143 |
$template->param( itemtypes => $itemtypes, ); |
143 |
$template->param( itemtypes => $itemtypes, ); |
| 144 |
} |
144 |
} |
| 145 |
elsif ( $step && $step == 1 ) { |
145 |
elsif ( $step && $step == 1 ) { |
| 146 |
my $createlibrary = $input->param('createlibrary'); #Store the inputted library branch code and name in $createlibrary variable |
146 |
my $createlibrary = $input->param('createlibrary') |
| 147 |
$template->param( 'createlibrary' => $createlibrary ); # Hand the library values back to the template in the createlibrary variable |
147 |
; #Store the inputted library branch code and name in $createlibrary variable |
|
|
148 |
$template->param( 'createlibrary' => $createlibrary ) |
| 149 |
; # Hand the library values back to the template in the createlibrary variable |
| 148 |
|
150 |
|
| 149 |
#store inputted parameters in variables |
151 |
#store inputted parameters in variables |
| 150 |
my $branchcode = $input->param('branchcode'); |
152 |
my $branchcode = $input->param('branchcode'); |
|
Lines 160-166
elsif ( $step && $step == 1 ) {
Link Here
|
| 160 |
); |
162 |
); |
| 161 |
|
163 |
|
| 162 |
$template->param( 'branchcode' => $branchcode ); |
164 |
$template->param( 'branchcode' => $branchcode ); |
| 163 |
$branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode |
165 |
$branchcode =~ s|\s||g |
|
|
166 |
; # Use a regular expression to check the value of the inputted branchcode |
| 164 |
|
167 |
|
| 165 |
#Create a new library object and store the branchcode and @fields array values in this new library object |
168 |
#Create a new library object and store the branchcode and @fields array values in this new library object |
| 166 |
my $library = Koha::Library->new( |
169 |
my $library = Koha::Library->new( |
|
Lines 182-188
elsif ( $step && $step == 1 ) {
Link Here
|
| 182 |
#Check if the $step variable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 1 |
185 |
#Check if the $step variable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 1 |
| 183 |
} |
186 |
} |
| 184 |
elsif ( $step && $step == 2 ) { |
187 |
elsif ( $step && $step == 2 ) { |
| 185 |
my $createcat = $input->param('createcat'); #Store the inputted category code and name in $createcat |
188 |
my $createcat = $input->param('createcat') |
|
|
189 |
; #Store the inputted category code and name in $createcat |
| 186 |
$template->param( 'createcat' => $createcat ); |
190 |
$template->param( 'createcat' => $createcat ); |
| 187 |
|
191 |
|
| 188 |
#Initialising values |
192 |
#Initialising values |
|
Lines 306-311
elsif ( $step && $step == 3 ) {
Link Here
|
| 306 |
my $borrowernumber = $input->param('borrowernumber'); |
310 |
my $borrowernumber = $input->param('borrowernumber'); |
| 307 |
my $userid = $input->param('userid'); |
311 |
my $userid = $input->param('userid'); |
| 308 |
|
312 |
|
|
|
313 |
# function to designate mandatory fields (visually with css) |
| 314 |
my $check_BorrowerMandatoryField = |
| 315 |
C4::Context->preference("BorrowerMandatoryField"); |
| 316 |
my @field_check = split( /\|/, $check_BorrowerMandatoryField ); |
| 317 |
foreach (@field_check) { |
| 318 |
$template->param( "mandatory$_" => 1 ); |
| 319 |
$template->param( |
| 320 |
BorrowerMandatoryField => |
| 321 |
C4::Context->preference("BorrowerMandatoryField") |
| 322 |
, #field to test with javascript |
| 323 |
); |
| 324 |
} |
| 325 |
|
| 309 |
#If the entered cardnumber causes an error hand this error to the @errors array |
326 |
#If the entered cardnumber causes an error hand this error to the @errors array |
| 310 |
if ( my $error_code = checkcardnumber( $cardnumber, $borrowernumber ) ) { |
327 |
if ( my $error_code = checkcardnumber( $cardnumber, $borrowernumber ) ) { |
| 311 |
push @errors, |
328 |
push @errors, |
|
Lines 649-654
elsif ( $step && $step == 5 ) {
Link Here
|
| 649 |
); |
666 |
); |
| 650 |
$sth_search->execute($branch); |
667 |
$sth_search->execute($branch); |
| 651 |
my $res = $sth_search->fetchrow_hashref(); |
668 |
my $res = $sth_search->fetchrow_hashref(); |
|
|
669 |
|
| 652 |
if ( $res->{total} ) { |
670 |
if ( $res->{total} ) { |
| 653 |
$sth_update->execute( $onshelfholds, $branch ); |
671 |
$sth_update->execute( $onshelfholds, $branch ); |
| 654 |
} |
672 |
} |
|
Lines 665-671
elsif ( $step && $step == 5 ) {
Link Here
|
| 665 |
if ($issuingrule) { |
683 |
if ($issuingrule) { |
| 666 |
$issuingrule->set($params)->store(); |
684 |
$issuingrule->set($params)->store(); |
| 667 |
push @messages, |
685 |
push @messages, |
| 668 |
{ type => 'error', code => 'error_on_insert' |
686 |
{ |
|
|
687 |
type => 'error', |
| 688 |
code => 'error_on_insert' |
| 669 |
}; #Stops crash of the onboarding tool if someone makes a circulation rule with the same item type, library and patron categroy as an exisiting circulation rule. |
689 |
}; #Stops crash of the onboarding tool if someone makes a circulation rule with the same item type, library and patron categroy as an exisiting circulation rule. |
| 670 |
|
690 |
|
| 671 |
} |
691 |
} |