From 4d32e46388c89343e065a757232c94ced5e12439 Mon Sep 17 00:00:00 2001 From: "@alexbuckley" <@alexbuckley> Date: Thu, 12 Jan 2017 21:24:00 +0000 Subject: [PATCH] Bug 17855 -Fifth update following tester feedback. Implemented Javascript password check to determine if the values in the 'password' and 'confirm password' fields are consistent. If passwords are not consistent a message informing the user is displayed and they only have to change the password values rather than re-fill out the whole form. Signed-off-by: Mark Tompsett --- installer/onboarding.pl | 30 ++++++++-- .../prog/en/modules/onboarding/onboardingstep3.tt | 68 ++++++++++------------ 2 files changed, 57 insertions(+), 41 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 85d2afa..eb20b44 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -143,8 +143,10 @@ elsif ( $start && $start eq 'Minimal item type setup' ) { $template->param( itemtypes => $itemtypes, ); } elsif ( $step && $step == 1 ) { - my $createlibrary = $input->param('createlibrary'); #Store the inputted library branch code and name in $createlibrary variable - $template->param( 'createlibrary' => $createlibrary ); # Hand the library values back to the template in the createlibrary variable + my $createlibrary = $input->param('createlibrary') + ; #Store the inputted library branch code and name in $createlibrary variable + $template->param( 'createlibrary' => $createlibrary ) + ; # Hand the library values back to the template in the createlibrary variable #store inputted parameters in variables my $branchcode = $input->param('branchcode'); @@ -160,7 +162,8 @@ elsif ( $step && $step == 1 ) { ); $template->param( 'branchcode' => $branchcode ); - $branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode + $branchcode =~ s|\s||g + ; # Use a regular expression to check the value of the inputted branchcode #Create a new library object and store the branchcode and @fields array values in this new library object my $library = Koha::Library->new( @@ -182,7 +185,8 @@ elsif ( $step && $step == 1 ) { #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 } elsif ( $step && $step == 2 ) { - my $createcat = $input->param('createcat'); #Store the inputted category code and name in $createcat + my $createcat = $input->param('createcat') + ; #Store the inputted category code and name in $createcat $template->param( 'createcat' => $createcat ); #Initialising values @@ -306,6 +310,19 @@ elsif ( $step && $step == 3 ) { my $borrowernumber = $input->param('borrowernumber'); my $userid = $input->param('userid'); + # function to designate mandatory fields (visually with css) + my $check_BorrowerMandatoryField = + C4::Context->preference("BorrowerMandatoryField"); + my @field_check = split( /\|/, $check_BorrowerMandatoryField ); + foreach (@field_check) { + $template->param( "mandatory$_" => 1 ); + $template->param( + BorrowerMandatoryField => + C4::Context->preference("BorrowerMandatoryField") + , #field to test with javascript + ); + } + #If the entered cardnumber causes an error hand this error to the @errors array if ( my $error_code = checkcardnumber( $cardnumber, $borrowernumber ) ) { push @errors, @@ -649,6 +666,7 @@ elsif ( $step && $step == 5 ) { ); $sth_search->execute($branch); my $res = $sth_search->fetchrow_hashref(); + if ( $res->{total} ) { $sth_update->execute( $onshelfholds, $branch ); } @@ -665,7 +683,9 @@ elsif ( $step && $step == 5 ) { if ($issuingrule) { $issuingrule->set($params)->store(); push @messages, - { type => 'error', code => 'error_on_insert' + { + type => 'error', + code => 'error_on_insert' }; #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. } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt index f901707..171601a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt @@ -13,53 +13,48 @@ - + + -
@@ -118,7 +113,7 @@ $(document).ready(function(){

Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions.

-
+
@@ -179,6 +174,7 @@ $(document).ready(function(){

    OPAC/Staff Login

  1. + Required @@ -195,6 +191,6 @@ $(document).ready(function(){

- +
[% END %] -- 2.1.4