Bugzilla – Attachment 58668 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 - Finished updated web installer and onboarding tool.
Bug-17855---Finished-updated-web-installer-and-onb.patch (text/plain), 61.69 KB, created by
Alex Buckley
on 2017-01-08 23:37:32 UTC
(
hide
)
Description:
Bug 17855 - Finished updated web installer and onboarding tool.
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-01-08 23:37:32 UTC
Size:
61.69 KB
patch
obsolete
>From 35116ff825550eff7a9f72bfce45d69fcf19b78e Mon Sep 17 00:00:00 2001 >From: "@alexbuckley" <alexbuckley@catalyst.net.nz> >Date: Wed, 28 Dec 2016 00:08:51 +0000 >Subject: [PATCH] Bug 17855 - Finished updated web installer and onboarding > tool. > > Test plan: > 1. Go through the web installer > as outlined in the below link. But go through the web installer 4 > times to test the basic and advanced setup modes of the web > installer: > https://koha-community.org/manual/installation/html/ > > Note: Each time you have finished > the web installer restart memcached service with: sudo service memcached restart > and drop and recreate the database. > > 2. > Attempt 1 : Choose basic and MARC21. Notice the bulletpoints for > default sample data on web installer step 3, and unticked checkboxes for > optional data values. > > Attempt 2: Choose basic and UNIMARC, make the same observation as > above. > > Attempt 3: Choose advanced and MACR21 notice all data values have > unticked checkboxes (including the default data values) > > Attempt 4: Choose advanced and UNIMARC and make same observation as > above. > > 3. After your fourth attempt do not restart memcached or drop and > recreate the database. You will be redirected to the onboarding tool > automatically after finishing the web installer. > > 4. Go through the onboarding tool as outlined here: > https://koha-community.org/manual/installation/html/ > > 5. Whilst going through the onboarding tool write in special characters to all text input fields of the > onboarding tool and try to submit the form. You should not be able to, > due to html regexes being implemented. > > 6. In the create patron category form try to input a value into both the > 'Months:' and 'Until date:' input fields. A message should appear > beside the input boxes telling the you to only write in one date value > > 7. Select a date from the datepicker of the create patron category form > > 8. Continue through the rest of the onboarding tool as outlined in that > above link > > 9. Once you have finished the onboarding tool and have logged in with > the patron account you created in the onboarding tool, try to create a > library, patron category, patron, item type and circulation rule. > > If you can create these then you know that the onboarding tool has > successfully set up Koha for you. Therefore the onboarding tool is > working as intended. > >Bug 17855 - In the onboarding tool the following >has been implemented: >* Pre-filled card number input field to prevent >the user having to write in a number which could >already exist thereby causing a duplicate >cardnumber entry error. > >* Working html regexes on all inputs in the >create patron category form as well as all >other input fields in the onboarding tool. > >* Working datepicker in the create patron category form. >It is working because when the user clicks on the calendar >icon by the 'Until date:' input box a calendar appears and >the user may select a date which is displayed in the said >input box. > >* Working detection of invalid dates in >the create patron category form > >* Fixed the bug in categories.pl >which allowed users to write in an invalid >date to the date input box and submit the form >So now if the user writes in an invalid date a >message box appears telling them what they entered was >invalid > >Test plan: >1. Go through the web installer and onboarding tool (further >instructions for onboaridng tool below) as outlined here: >https://koha-community.org/manual/installation/html/ > >2. Test every text input fields html regex in the onboarding tool >by writing in special characters and then trying to submit the form. >None of the forms should submit with special characters in any of the >text input fields > >3. Use the datepicker in the first create patron category screen, to choose a date from the calendar. > >4. Try writing in an invalid date (e.g. 40/20/2018) to the 'Until Date:' field of the >create patron category form. A messagebox should appear immediately and >tell you the date you entered is invalid > >5. Try writing a date in the 'Until date:' input >and a number of months in the 'Months:' input. Because only one of these >two fields should contain a value a message should appear alongside >these fields to tell you to only input one date value. > >6. Continue the onboarding tool as specified in the above link > >7. Login using the newly created patron account > >8. Go to More->Administration->Patron categories->New category >try writing an invalid date into the 'Until date:' input. As with the >onboarding tool a messagebox should appear asutomatically to tell you >that the date you entered was invalid > >Bug 17855 - Implemented in the onboarding tool >working html validation on all fields except >the text inputs fields in the create patron category >screen > >Test plan: >1. Go through the web installer as outlined here: >https://koha-community.org/manual/installation/html/ > >2. Try writing in special characters to all text input >fields in the onboarding tool (except the create patron >form text input fields which do not yet have working html regexes) > >You should not be able to submit the form with special characters >in the text input fields > >Working html data validation of >all onboarding tool steps > >Testing of the onboarding version > >Testing of version (second test) > >Working data validation of the patron >categories > >Testing of version (second test) > >Testing the patron category > >Working insertion of all fields, and all except patron categories >have successful data validation > >Tidied code with additional comments added and >test text removed > >Valid cardnumber pre-written into patron form > >Prevents duplicate cardnumber entry > >Working regex on patron catgeory form > >Working patron category datepicker > >Does not allow user to use datepicker > >Working datepicker and month input check > >Form now only allows only one dateperiod input > >Working detection of invalid dates > >Fixed categories.pl invalid date check > >All neccisary functionality in onboarding tool > >User can still choose any patron category in patron form >--- > installer/install.pl | 17 + > installer/onboarding.pl | 189 +++++---- > .../prog/en/modules/admin/categories.tt | 2 +- > .../prog/en/modules/onboarding/onboardingstep0.tt | 33 +- > .../prog/en/modules/onboarding/onboardingstep1.tt | 44 +- > .../prog/en/modules/onboarding/onboardingstep2.tt | 454 +++++++++++---------- > .../prog/en/modules/onboarding/onboardingstep3.tt | 20 +- > .../prog/en/modules/onboarding/onboardingstep4.tt | 4 +- > .../prog/en/modules/onboarding/onboardingstep5.tt | 16 +- > 9 files changed, 399 insertions(+), 380 deletions(-) > >diff --git a/installer/install.pl b/installer/install.pl >index 17d01e9..a71a5c0 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -1,5 +1,22 @@ > #!/usr/bin/perl > >+# This file is part of Koha. >+# # >+# # Copyright (C) YEAR YOURNAME-OR-YOUREMPLOYER >+# # >+# # Koha is free software; you can redistribute it and/or modify it >+# # under the terms of the GNU General Public License as published by >+# # the Free Software Foundation; either version 3 of the License, or >+# # (at your option) any later version. >+# # >+# # Koha is distributed in the hope that it will be useful, but >+# # WITHOUT ANY WARRANTY; without even the implied warranty of >+# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# # GNU General Public License for more details. >+# # >+# # You should have received a copy of the GNU General Public License >+# # along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use strict; > use warnings; > use diagnostics; >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index ca085c0..5430e03 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -1,5 +1,23 @@ > #!/usr/bin/perl > #Recommended pragmas >+ >+# This file is part of Koha. >+# # >+# # Copyright (C) YEAR YOURNAME-OR-YOUREMPLOYER >+# # >+# # Koha is free software; you can redistribute it and/or modify it >+# # under the terms of the GNU General Public License as published by >+# # the Free Software Foundation; either version 3 of the License, or >+# # (at your option) any later version. >+# # >+# # Koha is distributed in the hope that it will be useful, but >+# # WITHOUT ANY WARRANTY; without even the implied warranty of >+# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# # GNU General Public License for more details. >+# # >+# # You should have received a copy of the GNU General Public License >+# # along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use strict; > use warnings; > use diagnostics; >@@ -100,6 +118,15 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > ] > ); > >+ >+}elsif ( $start && $start eq 'Add a patron category' ){ >+#Select all the patron category records in the categories database table and give them to the template >+ my $categories = Koha::Patron::Categories->search(); >+ $template->param( >+ categories => $categories, >+ ); >+ >+ > #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 variable >@@ -107,6 +134,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > > #store inputted parameters in variables > my $branchcode = $input->param('branchcode'); >+ $branchcode = uc($branchcode); > my $categorycode = $input->param('categorycode'); > my $op = $input->param('op') || 'list'; > my $message; >@@ -134,97 +162,85 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > $message = 'error_on_insert'; > } > >- $template->param('message' => $message); >+ $template->param('message' => $message); > > > #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 category code and name in $createcat >- $template->param('createcat'=>$createcat); >- >-#Select all the patron category records in the categories database table and give them to the template >- my $categories = Koha::Patron::Categories->search(); >- $template->param( >- categories => $categories, >- ); >- >- #Initialising values >- 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( >- { >+ my $createcat = $query->param('createcat'); #Store the inputted category code and name in $createcat >+ $template->param('createcat'=>$createcat); >+ >+ #Initialising values >+ 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( >+ { > template_name => "/onboarding/onboardingstep2.tt", > query => $input, > type => "intranet", > authnotrequired => 0, > flagsrequired => { parameters => 'parameters_remaining_permissions' }, > debug => 1, >- } >+ } > ); > >- #Once the user submits the page, this code validates the input and adds it >- #to the database as a new patron category >- $categorycode = $input->param('categorycode'); >- my $description = $input->param('description'); >- my $overduenoticerequired = $input->param('overduenoticerequired'); >- my $category_type = $input->param('category_type'); >- my $default_privacy = $input->param('default_privacy'); >- my $enrolmentperiod = $input->param('enrolmentperiod'); >- my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef; >- >- #Converts the string into a date format >- if ( $enrolmentperioddate) { >- $enrolmentperioddate = output_pref( >+#Once the user submits the page, this code validates the input and adds it >+#to the database as a new patron category >+ >+ $categorycode = $input->param('categorycode'); >+ $categorycode = uc($categorycode); >+ my $description = $input->param('description'); >+ my $overduenoticerequired = $input->param('overduenoticerequired'); >+ my $category_type = $input->param('category_type'); >+ my $default_privacy = $input->param('default_privacy'); >+ my $enrolmentperiod = $input->param('enrolmentperiod'); >+ my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef; >+ >+#Converts the string into a date format >+ if ( $enrolmentperioddate) { >+ $enrolmentperioddate = output_pref( > { >- dt => dt_from_string($enrolmentperioddate), >- dateformat => 'iso', >- dateonly => 1, >+ dt => dt_from_string($enrolmentperioddate), >+ dateformat => 'iso', >+ dateonly => 1, > } > ); >- } >- >- #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, >- }); >+ } > >- eval { >- $category->store; >- }; >+#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, >+ }); >+ >+ eval { >+ $category->store; >+ }; > >- #Error messages >- if($category){ >- $message = 'success_on_insert'; >- }else{ >- $message = 'error_on_insert'; >- } >+#Error messages >+ if($category){ >+ $message = 'success_on_insert'; >+ }else{ >+ $message = 'error_on_insert'; >+ } > >- $template->param('message' => $message); >+ $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, >@@ -244,6 +260,14 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > categories => $categories, > ); > >+#Incrementing the highest existing patron cardnumber to prevent duplicate cardnumber entry >+ my $exisiting_cardnumber = my $sth_search = $dbh->prepare("SELECT MAX(cardnumber) FROM borrowers"); >+ my $new_cardnumber = $exisiting_cardnumber + 1; >+ warn $new_cardnumber; >+ $template->param("newcardnumber" => $new_cardnumber); >+ >+ >+ > my $op = $input->param('op') // 'list'; > my $minpw = C4::Context->preference("minPasswordLength"); > $template->param("minPasswordLength" => $minpw); >@@ -251,13 +275,13 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > 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 the entered cardnumber causes an error hand this error to the @errors array > if(my $error_code = checkcardnumber($cardnumber, $borrowernumber)){ > push @errors, $error_code == 1 > ? 'ERROR_cardnumber_already_exists' >@@ -266,6 +290,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > :() > } > >+#If the entered password causes an error hand this error to the @errors array > push @errors, "ERROR_password_mismatch" if $firstpassword ne $secondpassword; > push @errors, "ERROR_short_password" if ($firstpassword && $minpw && $firstpassword ne '****' && (length($firstpassword) < $minpw)); > >@@ -273,8 +298,8 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > #Passing errors to template > $nok = $nok || scalar(@errors); > >+#If errors have been generated from the users inputted cardnumber or password then display the error and do not insert the patron into the borrowers table > if($nok){ >- > foreach my $error (@errors){ > if ($error eq 'ERROR_password_mismatch'){ > $template->param(errorpasswordmismatch => 1); >@@ -293,8 +318,9 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > } > } > $template->param('nok' => 1); >- warn $nok; >- }else{ >+ >+#Else if no errors have been caused by the users inputted card number or password then insert the patron into the borrowers table >+ }else{ > my ($template, $loggedinuser, $cookie)= C4::InstallAuth::get_template_and_user({ > template_name => "/onboarding/onboardingstep3.tt", > query => $input, >@@ -370,9 +396,6 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > my $createitemtype = $input->param('createitemtype'); > $template->param('createitemtype'=> $createitemtype ); > >- my $itemtype_code = $input->param('itemtype'); >- my $op = $input->param('op') // 'list'; >- my $message; > > my( $template, $borrowernumber, $cookie) = C4::InstallAuth::get_template_and_user( > { template_name => "/onboarding/onboardingstep4.tt", >@@ -386,15 +409,20 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > > if($op eq 'add_validate'){ > my $description = $input->param('description'); >- >- #store the input from the form - only 2 fields >+ my $itemtype_code = $input->param('itemtype'); >+ $itemtype_code = uc($itemtype_code); >+ #Create a new itemtype object using the user inputted itemtype and description > my $itemtype= Koha::ItemType->new( > { itemtype => $itemtype_code, > description => $description, > } > ); >+ > eval{ $itemtype->store; }; >- #Error messages >+ >+ my $message; >+ >+#Fill the $message variable with an error if the item type object was not successfully created and inserted into the itemtypes table > if($itemtype){ > $message = 'success_on_insert'; > }else{ >@@ -442,8 +470,9 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > debug => 1, > }); > >+#If no libraries exist then set the $branch value to * > my $branch = $input->param('branch'); >- unless ( $branch ) { >+ unless ( $branch ) { > if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { > $branch = Koha::Libraries->search->count() == 1 ? undef : C4::Context::mybranch(); > } >@@ -456,7 +485,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > > if($op eq 'add_validate'){ > my $type = $input->param('type'); >- my $br = $branch; >+ my $br = $input->param('branch'); > my $bor = $input->param('categorycode'); > my $itemtype = $input->param('itemtype'); > my $maxissueqty = $input->param('maxissueqty'); >@@ -541,7 +570,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > if ($res->{total}) { > $sth_update->execute($onshelfholds, $branch); > } else { >- $sth_insert->execute($branch, $onshelfholds); >+ $sth_insert->execute($branch, $onshelfholds); > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index 7f1fb53..4f3f119 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -93,7 +93,7 @@ > </li> > <li> > <label for="enrolmentperioddate" style="width:6em;">Until date: </label> >- <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> >+ <input type="text" class="enrollmentperiod datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> > </li> > </ol> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt >index 9d18344..e4fc3ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt >@@ -2,44 +2,15 @@ > [% INCLUDE 'doc-head-open.inc' %] > [% INCLUDE 'installer-doc-head-close.inc' %] > >- > <head> > <title>Welcome › to › Koha</title> >- >-<!--jQuery code for create library--> >-<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script> >-<script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function() { >- $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "iDisplayLength": 10, >- "sPaginationType": "four_button" >- })); >- >- [% UNLESS library %] >- $("#Aform").on("submit", function( event ) { >- if ( $("#branchcode").val().match(/\s/) ) { >- event.preventDefault(); >- alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code")); >- return false; >- } else { >- return true; >- } >- }); >- [% END %].. >- }); >- //]]> >- </script> >- </head> >+</head> > > <!--Header for the koha onboarding tool--> > <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> >- <h2 align="center"> You haven't installed some sample data, so we're just going to set up a few more things...</h2> >+ <h2 align="center"> We're just going to set up a few more things...</h2> > <form name="startkoha" method="post" action="onboarding.pl"> > <input type="hidden" name="step" value="1"/> > <input type="submit" name="start" value="Start setting up my Koha"/> >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 3e51368..c4a732d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >@@ -4,39 +4,11 @@ > > <head> > <title>Welcome › to › Koha</title> >- >-<!--jQuery code for create library--> >-<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script> >-<script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function() { >- $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "iDisplayLength": 10, >- "sPaginationType": "four_button" >- })); >- >- [% UNLESS library %] >- $("#Aform").on("submit", function( event ) { >- if ( $("#branchcode").val().match(/\s/) ) { >- event.preventDefault(); >- alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code")); >- return false; >- } else { >- return true; >- } >- }); >- [% END %].. >- }); >-//]]> >-</script> > </head> > > <!--Header for the koha onboarding tool--> > <div> >- <h1 align="center"> Welcome to Koha test if in correct repo</h1> >+ <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 libraries.count > 0 %] >@@ -59,7 +31,11 @@ > <div> > <p> Success: Library created!</p> > <p> To add another library and for more settings, <br> >- go to Tools->Administration->Libraries and Groups >+ go to:<br><br> >+ More->Administration->Libraries and groups<br> >+ OR<br> >+ Administration->Libraries and groups >+ </p> > </div> > Next up: > <input type="submit" name="start" value="Add a patron category"/> >@@ -87,12 +63,12 @@ > <ol> > <li> > <label for="branchcode" class="required">Library code: </label> >- <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" /> >+ <input type="text" pattern="^[A-Za-z]{0,10}$" 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" 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;"> >+ <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> >@@ -100,8 +76,8 @@ > <br> > <input type="submit" class="action" value="Submit"/> > </form> >-[% END %] >- >+[% END %] >+ > > > >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 7dc5d93..4687d62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >@@ -6,29 +6,9 @@ > <title> Add a patron category</title> > [% INCLUDE 'installer-doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >-<script type="text/javascript"> >- var MSG_CATEGORYCODE_CHARS = (_("Category code can only contain the following characters: letters, numbers, - and _.")); >- var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date.")); >-</script> >-<script type="text/javascript"> >-jQuery.validator.addMethod( "letters_numbers", function(value,element){ >- var patt = /^[a-zA-Z0-9\-_]+$/g; >- if (patt.test(element.value)) { >- return true; >- } else { >- return false; >- } >-}, MSG_CATEGORYCODE_CHARS); > >-jQuery.validator.addMethod( "enrollment_period", function(){ >- enrolmentperiod = $("#enrolmentperiod").val(); >- enrolmentperioddate = $("#enrolmentperioddate").val(); >- if ( $("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "" ) { >- return false; >- } else { >- return true; >- } >-}, MSG_ONE_ENROLLMENTPERIOD); >+<script type="text/javascript"> >+//<![CDATA[ > > var debug = ""; > var dformat = "us"; >@@ -37,207 +17,254 @@ if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug > var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s).")); > > function is_valid_date(date) { >- // An empty string is considered as a valid date for convenient reasons. >- if ( date === '' ) return 1; >- var dateformat = dateformat_str = 'us'; >- if ( dateformat == 'us' ) { >- if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; >- dateformat = 'mm/dd/yy'; >- } else if ( dateformat == 'metric' ) { >- if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; >- dateformat = 'dd/mm/yy'; >- } else if (dateformat == 'iso' ) { >- if ( date.search(/^\d{4}-\d{2}-\d{2}($|\s)/) == -1 ) return 0; >- dateformat = 'yy-mm-dd'; >- } else if ( dateformat == 'dmydot' ) { >- if ( date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1 ) return 0; >- dateformat = 'dd.mm.yy'; >- } >- try { >- $.datepicker.parseDate(dateformat, date); >- } catch (e) { >- return 0; >- }; >- return 1; >-} >- >-function get_dateformat_str(dateformat) { >- var dateformat_str; >- if ( dateformat == 'us' ) { >- dateformat_str = 'mm/dd/yyyy'; >- } else if ( dateformat == 'metric' ) { >- dateformat_str = 'dd/mm/yyyy'; >- } else if (dateformat == 'iso' ) { >- dateformat_str = 'yyyy-mm-dd'; >- } else if ( dateformat == 'dmydot' ) { >- dateformat_str = 'dd.mm.yyyy'; >- } >- return dateformat_str; >+ // An empty string is considered as a valid date for convenient reasons. >+ if ( date === '' ) return 1; >+ var dateformat = dateformat_str = 'us'; >+ if ( dateformat == 'us' ) { >+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; >+ dateformat = 'mm/dd/yy'; >+ } else if ( dateformat == 'metric' ) { >+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; >+ dateformat = 'dd/mm/yy'; >+ } else if (dateformat == 'iso' ) { >+ if ( date.search(/^\d{4}-\d{2}-\d{2}($|\s)/) == -1 ) return 0; >+ dateformat = 'yy-mm-dd'; >+ } else if ( dateformat == 'dmydot' ) { >+ if ( date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1 ) return 0; >+ dateformat = 'dd.mm.yy'; >+ } >+ try { >+ $.datepicker.parseDate(dateformat, date); >+ } catch (e) { >+ return 0; >+ }; >+ return 1; >+}function get_dateformat_str(dateformat) { >+ var dateformat_str; >+ if ( dateformat == 'us' ) { >+ dateformat_str = 'mm/dd/yyyy'; >+ } else if ( dateformat == 'metric' ) { >+ dateformat_str = 'dd/mm/yyyy'; >+ } else if (dateformat == 'iso' ) { >+ dateformat_str = 'yyyy-mm-dd'; >+ } else if ( dateformat == 'dmydot' ) { >+ dateformat_str = 'dd.mm.yyyy'; >+ } >+ return dateformat_str; > } > > function validate_date (dateText, inst) { >- if ( !is_valid_date(dateText) ) { >- var dateformat_str = get_dateformat_str( 'us' ); >- alert(MSG_PLEASE_ENTER_A_VALID_DATE.format(dateformat_str)); >- $('#'+inst.id).val(''); >- } >+ if ( !is_valid_date(dateText) ) { >+ var dateformat_str = get_dateformat_str( 'us' ); >+ alert(MSG_PLEASE_ENTER_A_VALID_DATE.format(dateformat_str)); >+ $('#'+inst.id).val(''); >+ } > } >- > function Date_from_syspref(dstring) { >- var dateX = dstring.split(/[-/.]/); >- if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >- if (dformat === "iso") { >- return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >- } else if (dformat === "us") { >- return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >- } else if (dformat === "metric") { >- return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >- } else if (dformat === "dmydot") { >- return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD.MM.YYYY to (YYYY,m(0-11),d) >- } else { >- if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >- return 0; >- } >+ var dateX = dstring.split(/[-/.]/); >+ if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >+ if (dformat === "iso") { >+ return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >+ } else if (dformat === "us") { >+ return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >+ } else if (dformat === "metric") { >+ return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >+ } else if (dformat === "dmydot") { >+ return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD.MM.YYYY to (YYYY,m(0-11),d) >+ } else { >+ if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >+ return 0; >+ } > } > > function DateTime_from_syspref(date_time) { >- var parts = date_time.split(" "); >- var date = parts[0]; >- var time = parts[1]; >- parts = time.split(":"); >- var hour = parts[0]; >- var minute = parts[1]; >- if ( hour < 0 || hour > 23 ) { >- return 0; >- } >- if ( minute < 0 || minute > 59 ) { >- return 0; >- } >- var datetime = Date_from_syspref( date ); >- if ( isNaN( datetime.getTime() ) ) { >- return 0; >- } >- datetime.setHours( hour ); >- datetime.setMinutes( minute ); >- return datetime; >+ var parts = date_time.split(" "); >+ var date = parts[0]; >+ var time = parts[1]; >+ parts = time.split(":"); >+ var hour = parts[0]; >+ var minute = parts[1]; >+ if ( hour < 0 || hour > 23 ) { >+ return 0; >+ } >+ if ( minute < 0 || minute > 59 ) { >+ return 0; >+ } >+ var datetime = Date_from_syspref( date ); >+ if ( isNaN( datetime.getTime() ) ) { >+ return 0; >+ } >+ datetime.setHours( hour ); >+ datetime.setMinutes( minute ); >+ return datetime; > } > >- > /* Instead of including multiple localization files as you would normally see with > jQueryUI we expose the localization strings in the default configuration */ > jQuery(function($){ >- $.datepicker.regional[''] = { >- closeText: _("Done"), >- prevText: _("Prev"), >- nextText: _("Next"), >- currentText: _("Today"), >- monthNames: [_("January"),_("February"),_("March"),_("April"),_("May"),_("June"), >- _("July"),_("August"),_("September"),_("October"),_("November"),_("December")], >- monthNamesShort: [_("Jan"), _("Feb"), _("Mar"), _("Apr"), _("May"), _("Jun"), >- _("Jul"), _("Aug"), _("Sep"), _("Oct"), _("Nov"), _("Dec")], >- dayNames: [_("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday")], >- dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], >- dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], >- weekHeader: _("Wk"), >- dateFormat: "mm/dd/yy", >- firstDay: 0, >- isRTL: false, >- showMonthAfterYear: false, >- yearSuffix: ''}; >- $.datepicker.setDefaults($.datepicker.regional['']); >-}); >+ $.datepicker.regional[''] = { >+ closeText: _("Done"), >+ prevText: _("Prev"), >+ nextText: _("Next"), >+ currentText: _("Today"), >+ monthNames: [_("January"),_("February"),_("March"),_("April"),_("May"),_("June"), >+ _("July"),_("August"),_("September"),_("October"),_("November"),_("December")], >+ monthNamesShort: [_("Jan"), _("Feb"), _("Mar"), _("Apr"), _("May"), _("Jun"), >+ _("Jul"), _("Aug"), _("Sep"), _("Oct"), _("Nov"), _("Dec")], >+ dayNames: [_("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday")], >+ dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], >+ dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], >+ weekHeader: _("Wk"), >+ dateFormat: "mm/dd/yy", >+ firstDay: 0, >+ isRTL: false, >+ showMonthAfterYear: false, >+ yearSuffix: ''}; >+ $.datepicker.setDefaults($.datepicker.regional['']); >+ }); > > $(document).ready(function(){ >- >- $.datepicker.setDefaults({ >- showOn: "both", >- changeMonth: true, >- changeYear: true, >- buttonImage: '/intranet-tmpl/prog/img/famfamfam/silk/calendar.png', >- buttonImageOnly: true, >- showButtonPanel: true, >- showOtherMonths: true, >- selectOtherMonths: true >- }); >- $( ".datepicker" ).datepicker({ >- onClose: function(dateText, inst) { >- validate_date(dateText, inst); >- }, >- }).on("change", function(e, value) { >- if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >- }); >- // http://jqueryui.com/demos/datepicker/#date-range >- var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "from" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- dates.not( this ).datepicker( "option", option, date ); >- }, >+ $.datepicker.setDefaults({ >+ showOn: "both", >+ changeMonth: true, >+ changeYear: true, >+ buttonImage: '/intranet-tmpl/prog/img/famfamfam/silk/calendar.png', >+ buttonImageOnly: true, >+ showButtonPanel: true, >+ showOtherMonths: true, >+ selectOtherMonths: true >+ }); >+ $( ".datepicker" ).datepicker({ > onClose: function(dateText, inst) { >- validate_date(dateText, inst); >+ validate_date(dateText, inst); > }, >- }).on("change", function(e, value) { >- if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >- }); >+ }).on("change", function(e, value) { >+ if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >+ }); >+ // http://jqueryui.com/demos/datepicker/#date-range >+ var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({ >+ changeMonth: true, >+ numberOfMonths: 1, >+ onSelect: function( selectedDate ) { >+ var option = this.id == "from" ? "minDate" : "maxDate", >+ instance = $( this ).data( "datepicker" ); >+ date = $.datepicker.parseDate( >+ instance.settings.dateFormat || >+ $.datepicker._defaults.dateFormat, >+ selectedDate, instance.settings ); >+ dates.not( this ).datepicker( "option", option, date ); >+ }, >+ onClose: function(dateText, inst) { >+ validate_date(dateText, inst); >+ }, >+ }).on("change", function(e, value) { >+ if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >+ }); > }); >+//]]> >+</script> > >-$(document).ready(function(){ >- $("#category_form").validate({ >- rules: { >- categorycode: { >- required: true, >- letters_numbers: true >- }, >- description: "required", >- enrolmentperiod: { >- required: function(element){ >- return $("#enrolmentperioddate").val() === ""; >- }, >- digits: true, >- enrollment_period: true >- }, >- enrolmentperioddate: { >- required: function(element){ >- return $("#enrolmentperiod").val() === ""; >- }, >- enrollment_period: true >- }, >- dateofbirthrequired: { >- digits: true >- }, >- upperagelimit: { >- digits: true >- }, >- enrolmentfee: { >- number: true >- }, >- reservefee: { >- number: true >- }, >- category_type: { >- required: true >- } >- }, >- messages: { >- enrolmentperiod: { >- required: MSG_ONE_ENROLLMENTPERIOD >- }, >- enrolmentperioddate: { >- required: MSG_ONE_ENROLLMENTPERIOD >- } >- } >- >- }); >- >-}) >+ >+<script type="text/javascript"> >+var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); >+var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date.")); >+var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period.")); >+var MSG_DESCRIPTION_LETTERS_ONLY=(_("Please only enter letters.")); > </script> > >+<script type="text/javascript"> >+jQuery.validator.addMethod( "category_code_check", function(value,element){ >+ var patt = /^[A-Za-z]{0,10}$/g; >+ if (patt.test(element.value)) { >+ return true; >+ } else { >+ return false; >+ } >+}, MSG_CATEGORYCODE_CHARS >+); >+jQuery.validator.addMethod( "letters_only", function(value,element){ >+ var patt =/^[A-Za-z ]{0,30}$/g; >+ if (patt.test(element.value)){ >+ return true; >+ } else { >+ return false; >+ } >+ }, MSG_DESCRIPTION_LETTERS_ONLY >+); >+ >+jQuery.validator.addMethod( "enrollment_period", function(){ >+ enrolmentperiod = $("#enrolmentperiod").val(); >+ enrolmentperioddate = $("#enrolmentperioddate").val(); >+ if (( $("#enrolmentperiod").val() == "" && $("#enrolmentperioddate").val() == "") || ($("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "")) { >+ return false; >+ } else { >+ return true; >+ } >+ }, MSG_ONLY_ONE_ENROLLMENTPERIOD >+); >+ >+$(document).ready(function() { >+ $("#enrolmentperioddate").datepicker({ >+ minDate: 1 >+ }); // Require that "until date" be in the future >+ if ($("#branches option:selected").length < 1) { >+ $("#branches option:first").attr("selected", "selected"); >+ } >+ $("#categorycode").on("blur",function(){ >+ toUC(this); >+ }); >+ $("#category_form").validate({ >+ rules: { >+ categorycode: { >+ required: true, >+ category_code_check: true >+ }, >+ description: { >+ required:true, >+ letters_only: true >+ }, >+ enrolmentperiod: { >+ required: function(element){ >+ return $("#enrolmentperioddate").val() === ""; >+ }, >+ digits: true, >+ enrollment_period: true, >+ }, >+ enrolmentperioddate: { >+ required: function(element){ >+ return $("#enrolmentperiod").val() === ""; >+ }, >+ enrollment_period: true, >+ // is_valid_date ($(#"enrolementperioddate").val()); >+ }, >+ dateofbirthrequired: { >+ digits: true >+ }, >+ upperagelimit: { >+ digits: true >+ }, >+ enrolmentfee: { >+ number: true >+ }, >+ reservefee: { >+ number: true >+ }, >+ category_type: { >+ required: true >+ } >+ }, >+ messages: { >+ enrolmentperiod: { >+ required: MSG_ONE_ENROLLMENTPERIOD >+ }, >+ enrolmentperioddate: { >+ required: MSG_ONE_ENROLLMENTPERIOD >+ } >+ } >+ }); >+}); >+ >+</script> > </head> > > <div> <!-- Header that appears at the top of every screen in the koha onboarding tool--> >@@ -265,7 +292,10 @@ $(document).ready(function(){ > <div> > <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> >+ go to:<br> >+ More->Administration->Patron categories<br> >+ OR<br> >+ Administration->Patron categories</p> > </div> > Next up:<br> > <input type="submit" name="start" value="Add a patron"><!-- When the user clicks on this button then redirect them to step 3 of the onboarding tool--> >@@ -280,19 +310,19 @@ $(document).ready(function(){ > </div> > <input type="submit" value="Try again"/> > </form> >- [% END %] >- >+ [% END %] >+ > > [% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category--> >- <h1 align="left"> Create a new Patron Category testing rwq</h1> >- <form id="category_form" method="post" action="onboarding.pl"> >+ <h1 align="left"> Create a new Patron Category</h1> >+ <form id="category_form" method="post" action="onboarding.pl"> > <fieldset class="rows"> > <input type="hidden" name="step" value="2"/> > <input type="hidden" name="createcat" value="createcat" /> > <ol> > <li> > <label for="categorycode" class="required">Category code: </label> >- <input type="text" pattern="^[A-Z]{1,2}" title="Please enter 1 or 2 capital letters" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> >+ <input type="text" pattern="^[A-Za-z]{0,10}$" title="Please enter 1 or 2 capital letters" id="categorycode" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> > <span class="required">Required</span> > </li> > >@@ -361,15 +391,11 @@ $(document).ready(function(){ > <ol> > <li> > <label for="enrolmentperiod" style="width:6em;">In months: </label> >- <input type="number" min="0" class="enrollmentperiod" name="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months >+ <input type="number" min="0" class="enrolmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months > </li> > <li> > <label for="enrolmentperioddate" style="width:6em;">Until date: </label> >- <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> >- <img class="ui-datepicker-trigger" src="/intranet-tmpl/prog/img/famfamfam/silk/calendar.png" alt="..." title="..."> >- >- >- >+ <input type="text" class="enrolmentperioddate datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> > </li> > </ol> > </fieldset> >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 c72a859..19381d3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >@@ -114,7 +114,7 @@ $(document).ready(function(){ > </form> > [% ELSE %] > <!--Create a patron screen 1--> >- <h1 align="left"> Create a new Patron </h1> >+ <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. >@@ -129,12 +129,12 @@ $(document).ready(function(){ > <li> > <label for="surname" class="required">Surname: </label> > >- <input type="text" style="text-transform:capitalize" id="surname" name="surname" value="[% surname %]" class="required" required="required" /> >+ <input type="text" pattern="[a-zA-Z- ]+" title="Please only enter letters in the surname field" id="surname" name="surname" value="[% surname %]" class="required" required="required" /> > <span class="required">Required</span> > </li> > <li> > <label for="firstname" class="required">First Name: </label> >- <input style= "text-transform:capitalize;" type="text" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> >+ <input type="text" pattern="[a-zA-Z ]+" title="Please only enter letters in the firstname field" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> > <span class="required">Required</span> > </li> > </ol> >@@ -142,7 +142,7 @@ $(document).ready(function(){ > <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"> >+ <input type="number" min="[% newcardnumber %]" pattern="[1-9]+" title="Please only enter numbers into the card number field" id="cardnumber" class="noEnterSubmit valid" name="cardnumber" maxlength="[%maxlength_cardnumber%]" minlength="[%minlength_cardnumber%]" value="[% newcardnumber %]" class="required" required="required"> > <span class="required">Required</span> > </li> > <li> >@@ -160,9 +160,9 @@ $(document).ready(function(){ > <li> > <label for="categorycode_entry" class="required"> Patron Category</label> > <select id="categorycode_entry" name="categorycode_entry" onchange="update_category_code(this);"> >- [% FOREACH category IN categories %] >- <option name="categorycode_entry" value = "[% category.categorycode %]"> [%category.description %]</option> >- [% END %] >+ [% FOREACH category IN categories %] >+ <option name="categorycode_entry" value = "[% category.categorycode %]">[%category.description %]</option> >+ [% END %] > </select> > <span class="required">Required</span> > </li> >@@ -180,17 +180,17 @@ $(document).ready(function(){ > <h3>OPAC/Staff Login</h3> > <li> > <label for="userid" class="required">Username: </label> >- <input type="text" name="userid" id ="userid" size="20" value="[% userid %]" class="required" required="required" /> >+ <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> > </li> > <li> > <label for="passwordlabel" class="required">Password: </label> >- <input type="password" name="password" id="password" size="20" value="[% member.password |html %]" class="required" required="required"> >+ <input type="password" name="password" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this password field" id="password" size="20" value="[% member.password |html %]" class="required" required="required"> > <span class="required">Required</span> > </li> > <li> > <label for="password2" class="required">Confirm password: </label> >- <input type="password" id="password2" name="password2" size="20" value="" class="required" required="required"> >+ <input type="password" id="password2" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this password field" name="password2" size="20" value="" class="required" required="required"> > <span class="required">Required</span> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt >index fe6fb59..87be779 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt >@@ -66,12 +66,12 @@ > <ol> > <li> > <label for="itemtype" class="required">Item type code: </label> >- <input type="text" style="text-transform:uppercase;" name="itemtype" id="itemtype" size="10" maxlength="10" class="required" required="required" /> >+ <input type="text" name="itemtype" pattern="^[A-Za-z]{0,10}$" title="Please enter either 2 or 3 capital letters as the item type" id="itemtype" 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" id="description" size="42" value="[% itemtype.description |html %]" class="required" required="required"> >+ <input type="text" name="description" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this item type description" id="description" size="42" value="[% itemtype.description |html %]" class="required" required="required"> > <span class="required">Required</span> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >index 6bd611a..f582bd1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >@@ -53,7 +53,7 @@ > <option value="*">All</option> > [% FOREACH category IN categories %] > <option name="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option> >- [%END%] >+ [%END%] > </select> > <span class="required">Required</span> > </li> >@@ -70,20 +70,20 @@ > </li> > <li> > <label for="maxissueqty" class="required">Current checkouts allowed: </label> >- <input type="number" min="0" name="maxissueqty" id="maxissueqty" size="10" maxlength="10" value="" class="required" required="required" /> >+ <input type="number" min="0" name="maxissueqty" pattern="[1-9]+" title="Please only enter numbers" id="maxissueqty" size="10" maxlength="10" value="" class="required" required="required" /> > <span class="required">Required</span> > </li> > > <li> > <label for="issuelength" class="required">Loan Period: </label> >- <input type="number" min="0" name="issuelength" id="issuelength" size="10" maxlength="10" value="" class="required" required="required" /> >+ <input type="number" min="0" name="issuelength" pattern="[1-9]+" title="Please only enter numbers" id="issuelength" size="10" maxlength="10" value="" class="required" required="required" /> > <span class="required">Required</span> > </li> > <li> > <label for="lengthunit">Units: </label> > <select name="lengthunit" id="lengthunit" required="required"> > [% SET units = 'days' %] >- [% IF category %] <!--Check if category is the correct value name in the context of units of days that a loan period is for in the item borrowing script--> >+ [% IF category %] > [% SET default_privacy = category.default_privacy %] > [% END %] > >@@ -94,18 +94,18 @@ > [% CASE 'hours' %] > <option value="days">Days</option> > <option value="hours" selected="selected">Hours</option> >- [% END %] >- </select> >+ [% END %] >+ </select> > </li> > <li> > <label for="renewalsallowed" class="required">Renewals Allowed: </label> >- <input type="number"min="0" name="renewalsallowed" id="renewalsallowed" size="10" maxlength="10" value="" class="required" required="required" /> >+ <input type="number"min="0" name="renewalsallowed" pattern="[1-9]+" title="Please only enter numbers" id="renewalsallowed" size="10" maxlength="10" value="" class="required" required="required" /> > <span class="required">Required</span> > </li> > > <li> > <label for="renewalperiod" class="required">Renewals Period: </label> >- <input type="number" min="0"name="renewalperiod" id="renewalperiod" size="10" maxlength="10" value="" class="required" required="required" /> >+ <input type="number" min="0"name="renewalperiod" pattern="[1-9]+" title="Please only enter numbers" id="renewalperiod" size="10" maxlength="10" value="" class="required" required="required" /> > <span class="required">Required</span> > </li> > >-- >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