Bugzilla – Attachment 58903 Details for
Bug 17855
New onboarding tool feature to guide users through setting up Koha, and minor web installer UI improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17855 -Fifth update following tester feedback.
Bug-17855--Fifth-update-following-tester-feedback.patch (text/plain), 8.50 KB, created by
Mark Tompsett
on 2017-01-13 02:37:26 UTC
(
hide
)
Description:
Bug 17855 -Fifth update following tester feedback.
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-01-13 02:37:26 UTC
Size:
8.50 KB
patch
obsolete
>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 <mtompset@hotmail.com> >--- > 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 @@ > > <!--jQuery scripts for creating patron--> > <script type-"text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> >-<script type="text/javascipt"> >- var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron"); >- var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match"); >- var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces."); >-function check_password(password){ >- if(password.match(/^\s/) || password.match(/\s$/)){ >- return false; >- }return true; >-} >+ >+<script type="text/javascript"> >+ var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); >+ var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them")); >+ </script> >+ >+<script type="text/javascript"> >+jQuery.validator.addMethod( "password_match", function(value,element){ >+ var MSG_PASSWORD_MISMATCH = (_("The passwords entered do not match")); >+ var password = document.getElementById('password').value >+ var confirmpassword = document.getElementById('password2').value >+ >+ if ( password != confirmpassword ){ >+ return false; >+ } >+ else{ >+ return true >+ } >+ }, MSG_PASSWORD_MISMATCH >+); >+ >+ > > $(document).ready(function(){ >- $("#createpatron").validate({ >+ >+ $("#Submit").click(function(){ >+ $("#createpatron").validate({ > rules: { >- borrowernumber: { >- required: true, >- digits: true >- }, >- surname:{ >- required: true, >- letters: true >- }, >- firstname:{ >- required:true, >- letters:true >- }, >- userid: { >- required: true; >- letters_numbers: true >- }, > password: { >- letters_numbers: true >- }, >+ password_match:true >+ } > }, > messages: { > password: { > required: MSG_PASSWORD_MISMATCH > }, >- userid: { >- required: MSG_DUPLICATE_PATRON >- } > } > > }); >- >-}) >+}); >+}); > </script> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script> > </head> > > <div> >@@ -118,7 +113,7 @@ $(document).ready(function(){ > <p> > Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions. > </p> >- <form name="createpatron" method="post" action="onboarding.pl"> >+ <form name="createpatron" id="createpatron" method="post" action="onboarding.pl"> > <fieldset class="rows"> > <input type="hidden" name="step" value="3"/> > <input type="hidden" name="op" value="add_validate" /> >@@ -179,6 +174,7 @@ $(document).ready(function(){ > <ol> > <h3>OPAC/Staff Login</h3> > <li> >+ <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] /> > <label for="userid" class="required">Username: </label> > <input type="text" name="userid" id ="userid" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this username field" size="20" value="[% userid %]" class="required" required="required" /> > <span class="required">Required</span> >@@ -195,6 +191,6 @@ $(document).ready(function(){ > </li> > </ol> > </fieldset><br> >- <input type="submit" class="action" value="Submit"/> >+ <input type="submit" id="Submit" class="action" value="Submit"/> > </form> > [% END %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17855
:
58657
|
58658
|
58659
|
58660
|
58661
|
58662
|
58663
|
58664
|
58665
|
58666
|
58667
|
58668
|
58669
|
58781
|
58782
|
58783
|
58784
|
58785
|
58792
|
58793
|
58794
|
58846
|
58860
|
58861
|
58862
|
58886
|
58892
|
58893
|
58894
|
58895
|
58896
|
58897
|
58898
|
58899
|
58900
|
58901
|
58902
|
58903
|
58904
|
58905
|
58906
|
58907
|
59037
|
59051
|
59140
|
59141
|
59174
|
59188
|
59277
|
59279
|
59280
|
59281
|
59628
|
59703
|
59705
|
59706
|
59707
|
59708
|
59709
|
59710
|
59711
|
59712
|
59742
|
59826
|
59830
|
59840
|
59841
|
59842
|
59856
|
59857
|
60092
|
61667
|
61668
|
61986
|
62186
|
62191
|
62192
|
62193
|
62220
|
62221
|
62222
|
62223
|
62231
|
62233
|
62234
|
62235
|
62236
|
62237
|
62238
|
62239
|
62240
|
62241
|
62242
|
62243
|
62251
|
62252
|
62253
|
62254
|
62255
|
62256
|
62257
|
62258
|
62259
|
62260
|
62261
|
62262
|
62263
|
62281
|
62282
|
62283
|
62284
|
62285
|
62286
|
62287
|
62288
|
62668
|
62669
|
62670
|
62671
|
62672
|
62673
|
62674
|
62675