Bugzilla – Attachment 58666 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 - Implemented minimum password length check, which will not allow a user to create a patron in the create patron screen of the onboarding tool if the patrons password is less than 3 characters.
Bug-17855---Implemented-minimum-password-length-ch.patch (text/plain), 35.86 KB, created by
Alex Buckley
on 2017-01-08 23:36:32 UTC
(
hide
)
Description:
Bug 17855 - Implemented minimum password length check, which will not allow a user to create a patron in the create patron screen of the onboarding tool if the patrons password is less than 3 characters.
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-01-08 23:36:32 UTC
Size:
35.86 KB
patch
obsolete
>From 3509f3ef0f0cfb86c963112976c51cb954447906 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Thu, 22 Dec 2016 21:00:21 +0000 >Subject: [PATCH] Bug 17855 - Implemented minimum password length check, which > will not allow a user to create a patron in the create patron screen of the > onboarding tool if the patrons password is less than 3 characters. > >Test plan: >1. Go through the web installer and onboarding tool (up >to the first create patron screen) as outlined here: >https://koha-community.org/manual/installation/html/ > >2. In the first create patron screen write in the same 2 character >password into the 'Password' and 'Confirm Password' text inputs >and submit the form > >3. Notice that there is an error message telling you the password is >too short > >Bug 17855 - Implemented properly formatted errors >to be shown after submitting the first create patron screen in the >onboarding tool if the inputted passwords do not match >and/or the inputted card number already exists. > >This prevents a software error being displayed to the >user. > >Test plan: >1. Go through the web installer (keeping the MACR21 and basic setup >default options selected) > >2. Select to install sample libraries, patron categories and patrons >in the web installer step 3 > >3. Finish the remainder of the web installer as outlined in the above >link > >4. Go through the onboarding tool noticing that the forms to create a >library, and patron category are skipped (with a skip message being >displayed in their place). > >5. On the create patron screen enter in the card number of 1 (which >already exists because you added sample patrons in the web installer) >and write in different passwords into the 'Password' and 'Confirm >password' input fields. > >6. Submit the Create patron form > >7. Notice the error messages in a properly formatted onboarding tool >screen. I.e. not software error messages. Click the 'Try again' button >which returns you to the create patron screen to refill out the >form again > >Bug 17855 - removed test displays of >template variables in the second create patron screen >of the onboarding tool > >Test plan: >1. Go through the web installer and onboarding tool >(up to the second create patron screen) as outlined here: >https://koha-community.org/manual/installation/html/ > >2. Notice that there is no text saying 'nok is ' at the >top of the second create patron screen > >Bug 17855 - Implemented html validation >on the text input boxes for the create >library screen in the onboarding >tool. > >Test plan: >1. Go through the web installer and up to the >create a library screen of the onboarding tool >as outlined here: >https://koha-community.org/manual/installation/html/ > >2. In the onboarding tool enter special >characters into the two text input boxes of the >create library screen and try to submit the form. > >3. Notice that the form will not >submit until the special characters have been removed from >the two text input fields > >Bug 17855 - Implemented a password check >into the create patron screen so that >when the user writes the patron password into >the 'Password' and 'Confirm password' input >boxes the password inputs are checked to make >sure they are consistent. > >If the passwords are not the same then the patron record is >not inserted into the datbase. > >Test plan: >1. Go through the web installer and onboarding tool >(up to the first create a patron screen) as outlined here: >https://koha-community.org/manual/installation/html/ > >2. Enter in a different password in the 'Confirm Password' input >to the 'Password' input. > >3. Notice that the patron record is not instered into the borrowers >table of the database when the passwords are not the same. > >HTML data validation of the library > >Trying to work out errors > >Working errors for password mismatch > >Password min length check is working for create a patron. Still need to fix user ID check and test if card number length is working. FOr now, Mika out! >--- > installer/onboarding.pl | 234 ++++++++++++--------- > .../prog/en/modules/installer/step3.tt | 4 +- > .../prog/en/modules/onboarding/onboardingstep1.tt | 6 +- > .../prog/en/modules/onboarding/onboardingstep2.tt | 19 +- > .../prog/en/modules/onboarding/onboardingstep3.tt | 141 +++++++++---- > 5 files changed, 249 insertions(+), 155 deletions(-) > >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index 5435db5..eab874b 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -4,11 +4,8 @@ use strict; > use warnings; > use diagnostics; > >- > use Modern::Perl; >- use C4::InstallAuth; >- >-#External modules >+use C4::InstallAuth; > use CGI qw ( -utf8 ); > use List::MoreUtils qw/uniq/; > use Digest::MD5 qw(md5_base64); >@@ -44,10 +41,6 @@ use Module::Load; > use Koha::IssuingRule; > use Koha::IssuingRules; > >- >- >- >- > #Setting variables > my $input = new CGI; > my $query = new CGI; >@@ -92,7 +85,7 @@ if ( $op && $op eq 'finish' ) { #If the value of $op equals 'finish' then redire > } > > >-#Store the value of the template input name='start' in the variable $start so we can check if the user has pressed this button and starting the onboarding tool process >+#Store the value of the template input name='start' in the variable $start so we can check if the user has pressed this button and started the onboarding tool process > my $start = $query->param('start'); > $template->param('start'=>$start); #Hand the start variable back to the template > if ( $start && $start eq 'Start setting up my Koha' ){ >@@ -108,8 +101,6 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > ] > ); > >- >-#Select any library records from the database and hand them back to the template in the libraries variable. > }elsif ( $start && $start eq 'Add a patron category' ){ > > #Select all the patron category records in the categories database table and store them in the newly declared variable $categories >@@ -122,12 +113,11 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > my $itemtypes = Koha::ItemTypes->search(); > $template->param( > itemtypes => $itemtypes, >- ); >+ );#Hand the variable itemtypes back to the template > > #Check if the $step variable equals 1 i.e. the user has clicked to create a library in the create library screen 1 > }elsif ( $step && $step == 1 ) { >- >- my $createlibrary = $query->param('createlibrary'); #Store the inputted library branch code and name in $createlibrary >+ my $createlibrary = $query->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 >@@ -136,20 +126,16 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > my $op = $input->param('op') || 'list'; > my $message; > my $library; >-#my @messages; > > #Take the text 'branchname' and store it in the @fields array > my @fields = qw( > branchname > ); > >- >-#test > $template->param('branchcode'=>$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 >+ #Create a new library object and store the branchcode and @fields array values in this new library object > $library = Koha::Library->new( > { branchcode => $branchcode, > ( map { $_ => scalar $input->param($_) || undef } @fields ) >@@ -157,29 +143,27 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > ); > > eval { $library->store; }; #Use the eval{} function to store the library object >- > if($library){ > $message = 'success_on_insert'; >- }else{ >+ }else{ > $message = 'error_on_insert'; >- } >+ } > >- $template->param('message' => $message); >+ $template->param('message' => $message); > > >-#Check if the $step vairable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 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 = $query->param('createcat'); #Store the inputted library branch code and name in $createlibrary >- $template->param('createcat'=>$createcat); # Hand the library values back to the template in the createlibrary variable >- >+ my $createcat = $query->param('createcat'); #Store the inputted category code and name in $createcat >+ $template->param('createcat'=>$createcat); > > #Initialising values >- my $input = new CGI; > my $searchfield = $input->param('description') // q||; > my $categorycode = $input->param('categorycode'); > my $op = $input->param('op') // 'list'; > my $message; > my $category; >+ $template->param('categorycode' =>$categorycode); > > my ( $template, $loggedinuser, $cookie ) = C4::InstallAuth::get_template_and_user( > { >@@ -194,7 +178,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > > #Once the user submits the page, this code validates the input and adds it > #to the database as a new patron category >- my $categorycode = $input->param('categorycode'); >+ $categorycode = $input->param('categorycode'); > my $description = $input->param('description'); > my $overduenoticerequired = $input->param('overduenoticerequired'); > my $category_type = $input->param('category_type'); >@@ -204,40 +188,53 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > > #Converts the string into a date format > if ( $enrolmentperioddate) { >- $enrolmentperioddate = output_pref( >- { >- dt => dt_from_string($enrolmentperioddate), >- dateformat => 'iso', >- dateonly => 1, >- } >- ); >- } >+ $enrolmentperioddate = output_pref( >+ { >+ dt => dt_from_string($enrolmentperioddate), >+ dateformat => 'iso', >+ dateonly => 1, >+ } >+ ); >+ } > >- #Adds to the database >+ #Adds a new patron category to the database > $category = Koha::Patron::Category->new({ >- categorycode=> $categorycode, >- description => $description, >- overduenoticerequired => $overduenoticerequired, >- category_type=> $category_type, >- default_privacy => $default_privacy, >- enrolmentperiod => $enrolmentperiod, >- enrolmentperioddate => $enrolmentperioddate, >+ categorycode=> $categorycode, >+ description => $description, >+ overduenoticerequired => $overduenoticerequired, >+ category_type=> $category_type, >+ default_privacy => $default_privacy, >+ enrolmentperiod => $enrolmentperiod, >+ enrolmentperioddate => $enrolmentperioddate, > }); >+ > eval { >- $category->store; >+ $category->store; > }; > > #Error messages > if($category){ >- $message = 'success_on_insert'; >+ $message = 'success_on_insert'; > }else{ >- $message = 'error_on_insert'; >+ $message = 'error_on_insert'; > } > > $template->param('message' => $message); > > #Create a patron > }elsif ( $step && $step == 3 ){ >+ my $firstpassword = $input->param('password'); >+ my $secondpassword = $input->param('password2'); >+ >+ >+ if ($firstpassword ne $secondpassword){ >+ my $DisplayError='Please rewrite the password'; >+ warn $DisplayError; >+ $template->param(DisplayError=>$DisplayError, >+ ); >+ } >+ >+#Find all library records in the database and hand them to the template to display in the library dropdown box > my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); > $template->param(libraries => $libraries, > group_types => [ >@@ -250,18 +247,65 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > ] > ); > >- my $categories; >- $categories= Koha::Patron::Categories->search(); >+#Find all patron categories in the database and hand them to the template to display in the patron category dropdown box >+ my $categories= Koha::Patron::Categories->search(); > $template->param( > categories => $categories, > ); > >- my $input = new CGI; > my $op = $input->param('op') // 'list'; >+ my $minpw = C4::Context->preference("minPasswordLength"); >+ $template->param("minPasswordLength" => $minpw); > > my @messages; > my @errors; >+ my $nok = $input->param('nok'); > >+ my $firstpassword = $input->param('password'); >+ my $secondpassword = $input->param('password2'); >+ my $cardnumber= $input->param('cardnumber'); >+ my $borrowernumber= $input->param('borrowernumber'); >+ my $userid=$input->param('userid'); >+ >+ if(my $error_code = checkcardnumber($cardnumber, $borrowernumber)){ >+ push @errors, $error_code == 1 >+ ? 'ERROR_cardnumber_already_exists' >+ :$error_code == 2 >+ ? 'ERROR_cardnumber_length' >+ :() >+ } >+ >+# unless(Check_Userid($userid, $borrowernumber)){ >+# push @errors, "ERROR_login_exist"; >+# } >+ push @errors, "ERROR_password_mismatch" if $firstpassword ne $secondpassword; >+ push @errors, "ERROR_short_password" if ($firstpassword && $minpw && $firstpassword ne '****' && (length($firstpassword) < $minpw)); >+# >+#Passing errors to template >+ $nok = $nok || scalar(@errors); >+ >+ if($nok){ >+ >+ foreach my $error (@errors){ >+ if ($error eq 'ERROR_password_mismatch'){ >+ $template->param(errorpasswordmismatch => 1); >+ } >+ if ($error eq 'ERROR_login_exist'){ >+ $template->param(errorloginexists =>1); >+ } >+ if ($error eq 'ERROR_cardnumber_already_exists'){ >+ $template->param(errorcardnumberexists => 1); >+ } >+ if ($error eq 'ERROR_cardnumber_length'){ >+ $template->param(errorcardnumberlength => 1); >+ } >+ if ($error eq 'ERROR_short_password'){ >+ $template->param(errorshortpassword => 1); >+ } >+ } >+ $template->param('nok' => 1); >+ warn $nok; >+ }else{ > my ($template, $loggedinuser, $cookie)= C4::InstallAuth::get_template_and_user({ > template_name => "/onboarding/onboardingstep3.tt", > query => $input, >@@ -287,21 +331,14 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > $newdata{dateexpiry} = '12/10/2016'; > $newdata{privacy} = "default"; > >- if(my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ >- push @errors, $error_code == 1 >- ? 'ERROR_cardnumber_already_exists' >- :$error_code == 2 >- ? 'ERROR_cardnumber_length' >- :() >- } >- >- > #Hand the newdata hash to the AddMember subroutine in the C4::Members module and it creates a patron and hands back a borrowernumber which is being stored > my $borrowernumber = &AddMember(%newdata); >-#Create a hash named member2 and fillit with the borrowernumber of the borrower that has just been created >+ >+#Create a hash named member2 and fill it with the borrowernumber of the borrower that has just been created > my %member2; > $member2{'borrowernumber'}=$borrowernumber; > >+#Perform data validation on the flag that has been handed to onboarding.pl by the template > my $flag = $input->param('flag'); > if ($input->param('newflags')) { > my $dbh=C4::Context->dbh(); >@@ -317,33 +354,33 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > } > } > >+ # construct flags >+ my $module_flags = 0; >+ my $sth=$dbh->prepare("SELECT bit,flag FROM userflags ORDER BY bit"); >+ $sth->execute(); >+ while (my ($bit, $flag) = $sth->fetchrow_array) { >+ if (exists $all_module_perms{$flag}) { >+ $module_flags += 2**$bit; >+ } >+ } > >- # construct flags >- my $module_flags = 0; >- my $sth=$dbh->prepare("SELECT bit,flag FROM userflags ORDER BY bit"); >- $sth->execute(); >- while (my ($bit, $flag) = $sth->fetchrow_array) { >- if (exists $all_module_perms{$flag}) { >- $module_flags += 2**$bit; >- } >- } >- >- $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?"); >- $sth->execute($module_flags, $borrowernumber); >- >- #Error handling checking if the patron was created successfully >- if(!$borrowernumber){ >- push @messages, {type=> 'error', code => 'error_on_insert'}; >- }else{ >- push @messages, {type=> 'message', code => 'success_on_insert'}; >- } >- } >+#Set the superlibrarian permission of the newly created patron to superlibrarian >+ $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?"); >+ $sth->execute($module_flags, $borrowernumber); >+ >+ #Error handling checking if the patron was created successfully >+ if(!$borrowernumber){ >+ push @messages, {type=> 'error', code => 'error_on_insert'}; >+ }else{ >+ push @messages, {type=> 'message', code => 'success_on_insert'}; >+ } >+ } >+ } > } > }elsif ( $step && $step == 4){ > my $createitemtype = $input->param('createitemtype'); > $template->param('createitemtype'=> $createitemtype ); > >- my $input = new CGI; > my $itemtype_code = $input->param('itemtype'); > my $op = $input->param('op') // 'list'; > my $message; >@@ -358,22 +395,18 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > } > ); > >- if($op eq 'add_form'){ >- my $itemtype = Koha::ItemTypes->find($itemtype_code); >- $template->param(itemtype=> $itemtype,); >- }elsif($op eq 'add_validate'){ >- my $itemtype = Koha::ItemTypes->find($itemtype_code); >+ if($op eq 'add_validate'){ > my $description = $input->param('description'); > > #store the input from the form - only 2 fields >- my $thisitemtype= Koha::ItemType->new( >+ my $itemtype= Koha::ItemType->new( > { itemtype => $itemtype_code, > description => $description, > } > ); >- eval{ $thisitemtype->store; }; >+ eval{ $itemtype->store; }; > #Error messages >- if($thisitemtype){ >+ if($itemtype){ > $message = 'success_on_insert'; > }else{ > $message = 'error_on_insert'; >@@ -382,20 +415,21 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > $template->param('message' => $message); > } > }elsif ( $step && $step == 5){ >- >- #Fetching all the existing categories to display in a drop down box >+ #Find all the existing categories to display in a dropdown box in the template > my $categories; > $categories= Koha::Patron::Categories->search(); > $template->param( > categories => $categories, > ); > >+ #Find all the exisiting item types to display in a dropdown box in the template > my $itemtypes; > $itemtypes= Koha::ItemTypes->search(); > $template->param( > itemtypes => $itemtypes, > ); > >+ #Find all the exisiting libraries to display in a dropdown box in the template > my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); > $template->param(libraries => $libraries, > group_types => [ >@@ -412,16 +446,16 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > my $dbh = C4::Context->dbh; > > my ($template, $loggedinuser, $cookie) = C4::InstallAuth::get_template_and_user({template_name => "/onboarding/onboardingstep5.tt", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => {parameters => 'manage_circ_rules'}, >- debug => 1, >- }); >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => {parameters => 'manage_circ_rules'}, >+ debug => 1, >+ }); > > my $branch = $input->param('branch'); >- unless ( $branch ) { >- if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { >+ unless ( $branch ) { >+ if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { > $branch = Koha::Libraries->search->count() == 1 ? undef : C4::Context::mybranch(); > } > else { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >index 732c0a9..8aa7826 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >@@ -217,11 +217,11 @@ function Hide(link) > [% END %] > <h3>All done!</h3> > <p>Installation complete.<br /> >- <p>Click on 'Finish' to complete and load the Koha Staff Interface. >+ <p>Click on 'Continue to onboarding tool' to complete and load the Koha onboarding tool. > <form name="finish"> > <input type="hidden" name="step" value="3" /> > <input type="hidden" name="op" value="finish" /> >- <input type="submit" value="Finish"/> >+ <input type="submit" value="Continue to Koha onboarding tool"/> > </form> > </p> > </p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >index bde6ca5..e9616e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >@@ -57,7 +57,7 @@ > <input type="hidden" name="step" value="2"/> > <h1 align="left"> New Library</h1> > <div> >- <p> Success: Library created! Your branchcode is [% branchcode %]</p> >+ <p> Success: Library created!</p> > <p> To add another library and for more settings, <br> > go to Tools->Administration->Libraries and Groups > </div> >@@ -87,12 +87,12 @@ > <ol> > <li> > <label for="branchcode" class="required">Library code: </label> >- <input type="text" style="text-transform: uppercase;"name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" /> >+ <input type="text" pattern="[A-Z]{3}" title="Please enter 3 capital letters" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" /> > <span class="required">Required</span> > </li> > <li> > <label for="branchname" class="required">Name: </label> >- <input type="text" style="text-transform:capitalize;" name="branchname" id="branchname" size="42" value="[% library.branchname |html %]" class=" required" required="required" style="width:200px;"> >+ <input type="text" pattern="[a-zA-Z ]+" title="Please enter a sentence of letters only" name="branchname" id="branchname" size="42" value="[% library.branchname |html %]" class=" required" required="required" style="width:200px;"> > <span class="required">Required</span> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >index f3a8276..7221a97 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >@@ -30,11 +30,6 @@ jQuery.validator.addMethod( "enrollment_period", function(){ > } > }, MSG_ONE_ENROLLMENTPERIOD); > >-//Testing the jquery >- >- >- >- > var debug = ""; > var dformat = "us"; > var sentmsg = 0; >@@ -192,10 +187,6 @@ $(document).ready(function(){ > }); > }); > >- >- >- >- > $(document).ready(function(){ > $("#category_form").validate({ > rules: { >@@ -266,13 +257,13 @@ $(document).ready(function(){ > </form> > > <!--else if the user has not previously imported sample patron categories check if the user has pressed the button name="add_validate" in the create patron category screen 1, and if they have pressed that button then display the below screen with a button to redirect the user to step 3--> >-[% ELSIF op == "add_validate" %] >+[% ELSIF createcat %] > [% IF message != "error_on_insert" %] > <form name="createcat" method="post" action="onboarding.pl"> > <input type="hidden" name="step" value="3"/> > <h1 align="left"> New patron category</h1> > <div> >- <p> Success: Patron category created! Your patron category code is [% category.categorycode %] </p> >+ <p> Success: Patron category created! </p> > <p> To add another patron category and for more settings<br> > go to More->Administration->Patrons & Circulation->Patron Categories</p> > </div> >@@ -297,17 +288,17 @@ $(document).ready(function(){ > <form id="category_form" method="post" action="onboarding.pl"> > <fieldset class="rows"> > <input type="hidden" name="step" value="2"/> >- <input type="hidden" name="op" value="add_validate" /> >+ <input type="hidden" name="createcat" value="createcat" /> > <ol> > <li> > <label for="categorycode" class="required">Category code: </label> >- <input type="text" style="text-transform: uppercase;" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> >+ <input type="text" pattern="^[A-Z]{1,2}" title="Please enter 1 or 2 capital letters" style="text-transform: uppercase;" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> > <span class="required">Required</span> > </li> > > <li> > <label for="description" class="required">Description: </label> >- <input type="text" style="text-transform:capitalize;" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" /> >+ <input type="text" pattern="[a-zA-Z ]+" title="Please enter a description sentence of letters only" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" /> > <span class="required">Required</span> > </li> > >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 ff0745b..c72a859 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >@@ -4,9 +4,7 @@ > [% USE Price %] > <!--[% USE Branches %]--> > [% INCLUDE 'doc-head-open.inc' %] >-[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >- >- >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END%] > [% INCLUDE 'installer-doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >@@ -16,45 +14,118 @@ > <title>Create Patron</title> > > <!--jQuery scripts for creating patron--> >-<!--<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script> >---> >+<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; >+} >+ >+$(document).ready(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 >+ }, >+ }, >+ 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> > <h1 align="center"> Welcome to Koha</h1> > <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> > </div> >+ >+[% IF (nok) %] >+ <form name="errors" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="3"/> >+ <h1 align="left">There was an error</h1> >+ <p>Try again </p> >+ <div> >+ <ul> >+ [% IF errorloginexists %] >+ <li id="ERROR_login_exist">Username/password already exists.</li> >+ [% END %] >+ [% IF errorcardnumberexists %] >+ <li id="ERROR_cardnumber">Cardnumber already in use.</li> >+ [% END %] >+ [% IF errorcardnumberlength %] >+ <li id="ERROR_cardnumber">Cardnumber length is incorrect</li> >+ [% END %] >+ [% IF errorshortpassword %] >+ <li id="ERROR_short_password">Password length is incorrect, must be at least [% minPasswordLength %] characters long.</li> >+ [% END %] >+ [% IF errorpasswordmismatch %] >+ <li id="ERROR_password_mismatch">Passwords do not match.</li> >+ [% END %] >+ </ul> >+ >+ </div> >+ <input type="submit" name="step" value="Try again"/> >+ </form> >+ >+ > <!--Create a patron screen 2--> >-[% IF op == 'add_validate' %] >- <!--New patron created--> >+[% ELSIF op == 'add_validate' %] >+ <!--New patron created--> > <form name="patrondone" method="post" action="onboarding.pl"> > <input type="hidden" name="step" value="4"/> > <h1 align="left"> New Patron </h1> >- <div> >+ <div> > <p> Success: New patron created!</p> > <p> To create another patron, go to Patrons > New Patron. <br> > More > Set Permissions in a user page to gain superlibrarian permissions. >- </div> >- Next up: >- <input type="submit" name="start" value="Add an item type"/> >+ </div> >+ Next up: >+ <input type="submit" name="start" value="Add an item type"/> > </form> >- <!--Implement a if statement to check if the patron was successfully created >- <div> >- <p> Oh no! Patron was not created</p> >- </div>--> >-[% ELSE %] >+[% ELSE %] > <!--Create a patron screen 1--> >- <h1 align="left"> Create a new Patron </h2> >+ <h1 align="left"> Create a new Patron </h1> >+ <legend id="library_management_lgd">Library Management</legend> >+ <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"> > <fieldset class="rows"> > <input type="hidden" name="step" value="3"/> > <input type="hidden" name="op" value="add_validate" /> >- <legend id="library_management_lgd">Library Management</legend> >- <p> >- Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions. >- </p> >- <ol> >- <h3>Patron Identity</h3> >+ <ol> >+ <h3>Patron Identity</h3> > <li> > <label for="surname" class="required">Surname: </label> > >@@ -66,10 +137,9 @@ > <input style= "text-transform:capitalize;" type="text" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> > <span class="required">Required</span> > </li> >- </ol> >- >- >- <ol> >+ </ol> >+ >+ <ol> > <li> > <label for="cardnumber" class="required">Card Number: </label> > <input type="number" min="1" id="cardnumber" class="noEnterSubmit valid" name="cardnumber" maxlength="[%maxlength_cardnumber%]" minlength="[%minlength_cardnumber%]" value="[% cardnumber | html %]" class="required" required="required"> >@@ -83,7 +153,7 @@ > [% FOREACH library IN libraries %] > <option name="libraries" value="[% library.branchcode %]"> [% library.branchname %] > [% END %] >- >+ > </select> > <span class="required"> Required</span> > </li> >@@ -96,18 +166,17 @@ > </select> > <span class="required">Required</span> > </li> >- </ol> >- >- <ol> >- >+ </ol> >+ >+ <ol> > <h3> Patron permissions</h3> > <input type="hidden" name="newflags" value="1"/> > <li> > <input type="hidden" class="flag parent" id="flag-0" name="flag" value="superlibrarian"/> > <label name="permissioncode" for="flag-0"> superlibrarian</label> >- </li> >- </ol> >- <ol> >+ </li> >+ </ol> >+ <ol> > <h3>OPAC/Staff Login</h3> > <li> > <label for="userid" class="required">Username: </label> >@@ -124,7 +193,7 @@ > <input type="password" id="password2" name="password2" size="20" value="" class="required" required="required"> > <span class="required">Required</span> > </li> >- </ol> >+ </ol> > </fieldset><br> > <input type="submit" class="action" value="Submit"/> > </form> >-- >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