Bugzilla – Attachment 58667 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 - Tidied up the blank spaces and unnecessary comments in the onboarding.pl script
Bug-17855---Tidied-up-the-blank-spaces-and-unneces.patch (text/plain), 11.38 KB, created by
Alex Buckley
on 2017-01-08 23:36:59 UTC
(
hide
)
Description:
Bug 17855 - Tidied up the blank spaces and unnecessary comments in the onboarding.pl script
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-01-08 23:36:59 UTC
Size:
11.38 KB
patch
obsolete
>From 2880589eeb768e328454affbd0c28e86c96873f1 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 23 Dec 2016 01:11:12 +0000 >Subject: [PATCH] Bug 17855 - Tidied up the blank spaces and unnecessary > comments in the onboarding.pl script > >Test plan: >1. Go through the web installer and onboarding tool >as outlined here: >https://koha-community.org/manual/installation/html/ > >2. After finishing the onboarding tool login >using the patron credentials of the patron you just created >using the onboarding tool > >3. Check you can create a library, patron category, item >type, patron category, and circulation rule using the >patron account you are currently logged in with > >Bug 17855 - Same as the previous patch > >Test plan: >1. Go through the web installer and onboarding tool >as outlined here: >https://koha-community.org/manual/installation/html/ > >2. Test the password and card number check and error display >in the create patron screen of the onboarding tool by entering >in different passwords in the two password fields and/or entering an existing >password (which will only work if you installed sample patrons in the >web installer). When you do this and submit the form errors should >appear and you should be able to select the 'try again' button to get >back to the first create patron screen. > >3. After finishing the onboarding tool >check the following tables of the database, they should all have >records in them: >branches, categories, borrowers, itemtypes and issuingrules > >Bug 17855 - Similar to previous patch > >All fields of the onboarding tool have been >tested and they are all inserting correctly into >the database > >Test plan: >1. Go through the web installer and onboarding tool >as outlined here: >https://koha-community.org/manual/installation/html/ > >2. After finishing the onboarding tool write in the username >and password of the patron you created using the onboarding tool, into >the login page > >3. Check your user has superlibrarian privilages by going to: 'Patron'-> >click on the first letter of your logged in patron surname->'More'->'Set Permissions' >You should see the patron has >superlibrarian privilages. > >4. Search in the database to make sure: >*The library you created is in the borrowers table. >*The patron category is in the categories table >*The item type is in the itemtypes table >*The circulation rule is in the issuingrules table > >Error messages working correctly and all >objects being inserted correctly > >Start of onboarding.pl code tidied up >--- > installer/onboarding.pl | 77 ++++++++-------------- > .../prog/en/modules/onboarding/onboardingstep1.tt | 2 +- > .../prog/en/modules/onboarding/onboardingstep2.tt | 4 +- > 3 files changed, 30 insertions(+), 53 deletions(-) > >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index eab874b..ca085c0 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -10,8 +10,6 @@ use CGI qw ( -utf8 ); > use List::MoreUtils qw/uniq/; > use Digest::MD5 qw(md5_base64); > use Encode qw( encode ); >- >-#Internal modules > use C4::Koha; > use C4::Auth; > use C4::Context; >@@ -46,7 +44,7 @@ my $input = new CGI; > my $query = new CGI; > my $step = $query->param('step'); > >-#Getting the appropriate template to display to the user--> >+#Getting the appropriate template to display to the user > my ( $template, $loggedinuser, $cookie) = C4::InstallAuth::get_template_and_user( > { > template_name => "/onboarding/onboardingstep" . ( $step ? $step : 0 ) . ".tt", >@@ -87,8 +85,9 @@ 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 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' ){ >+$template->param('start'=>$start); >+ >+if ( $start && $start eq 'Start setting up my Koha' ){ > my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); > $template->param(libraries => $libraries, > group_types => [ >@@ -101,20 +100,6 @@ 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 store them in the newly declared variable $categories >- my $categories = Koha::Patron::Categories->search(); >- $template->param( >- categories => $categories, >- ); #Hand the variable categories back to the template >- >-}elsif ( $start && $start eq 'Add an item type' ){ >- 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 variable >@@ -157,6 +142,12 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > 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'); >@@ -195,7 +186,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > dateonly => 1, > } > ); >- } >+ } > > #Adds a new patron category to the database > $category = Koha::Patron::Category->new({ >@@ -275,20 +266,18 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > :() > } > >-# 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); >+ $nok = $nok || scalar(@errors); > >- if($nok){ >+ if($nok){ > >- foreach my $error (@errors){ >- if ($error eq 'ERROR_password_mismatch'){ >- $template->param(errorpasswordmismatch => 1); >+ foreach my $error (@errors){ >+ if ($error eq 'ERROR_password_mismatch'){ >+ $template->param(errorpasswordmismatch => 1); > } > if ($error eq 'ERROR_login_exist'){ > $template->param(errorloginexists =>1); >@@ -368,16 +357,16 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > $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'}; >- } >- } >+ #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){ >+ }elsif ( $step && $step == 4){ > my $createitemtype = $input->param('createitemtype'); > $template->param('createitemtype'=> $createitemtype ); > >@@ -554,8 +543,7 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > } else { > $sth_insert->execute($branch, $onshelfholds); > } >- } >-#End new code >+ } > > my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br }); > if($issuingrule){ >@@ -566,17 +554,6 @@ if ( $start && $start eq 'Start setting up my Koha' ){ > Koha::IssuingRule->new()->set($params)->store(); > } > } >- >- my @messages; >- >- my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br }); >- if($issuingrule){ >- $issuingrule->set($params)->store(); >- push @messages, {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. >- }else{ >- Koha::IssuingRule->new()->set($params)->store(); >- } >- } > } > > output_html_with_http_headers $input, $cookie, $template->output; >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 e9616e3..3e51368 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >@@ -36,7 +36,7 @@ > > <!--Header for the koha onboarding tool--> > <div> >- <h1 align="center"> Welcome to Koha</h1> >+ <h1 align="center"> Welcome to Koha test if in correct repo</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 %] >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 7221a97..7dc5d93 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >@@ -284,7 +284,7 @@ $(document).ready(function(){ > > > [% 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</h1> >+ <h1 align="left"> Create a new Patron Category testing rwq</h1> > <form id="category_form" method="post" action="onboarding.pl"> > <fieldset class="rows"> > <input type="hidden" name="step" value="2"/> >@@ -292,7 +292,7 @@ $(document).ready(function(){ > <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" 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" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" 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