From eb47932daf22bcba219cb53ddd43a2cbbcbb7aa4 Mon Sep 17 00:00:00 2001
From: Alex Buckley
Date: Wed, 21 Dec 2016 00:37:02 +0000
Subject: [PATCH] Bug 17855 - Finished updated web installer and onboarding
tool
Test plan:
1. Go through the web installer and onboarding tool as outlined in this
guide:
https://koha-community.org/manual/installation/html/
This is a combination of 6 commits.
---
installer/install.pl | 17 +
installer/onboarding.pl | 427 ++++++++++++++-------
.../prog/en/modules/admin/categories.tt | 2 +-
.../prog/en/modules/installer/step3.tt | 4 +-
.../prog/en/modules/onboarding/onboardingstep0.tt | 33 +-
.../prog/en/modules/onboarding/onboardingstep1.tt | 42 +-
.../prog/en/modules/onboarding/onboardingstep2.tt | 345 +++++++++++++----
.../prog/en/modules/onboarding/onboardingstep3.tt | 142 +++++--
.../prog/en/modules/onboarding/onboardingstep4.tt | 6 +-
.../prog/en/modules/onboarding/onboardingstep5.tt | 151 ++++----
10 files changed, 766 insertions(+), 403 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 .
+
use strict;
use warnings;
use diagnostics;
diff --git a/installer/onboarding.pl b/installer/onboarding.pl
index f660c3f..d24eb78 100755
--- a/installer/onboarding.pl
+++ b/installer/onboarding.pl
@@ -1,19 +1,33 @@
#!/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 .
+
use strict;
use warnings;
use diagnostics;
-
use Modern::Perl;
-
-#External modules
+use C4::InstallAuth;
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;
@@ -40,14 +54,16 @@ use Koha::Patron::HouseboundRoles;
use Koha::Token;
use Email::Valid;
use Module::Load;
+use Koha::IssuingRule;
+use Koha::IssuingRules;
#Setting variables
my $input = new CGI;
my $query = new CGI;
my $step = $query->param('step');
-#Getting the appropriate template to display to the user-->
-my ( $template, $loggedinuser, $cookie) = get_template_and_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",
query => $query,
@@ -85,10 +101,11 @@ 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' ){
+$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 => [
@@ -102,47 +119,36 @@ 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
+}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,
- ); #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,
);
+
#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
my $branchcode = $input->param('branchcode');
+ $branchcode = uc($branchcode);
my $categorycode = $input->param('categorycode');
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 )
@@ -150,41 +156,44 @@ 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
-
-
- #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;
-
- my ( $template, $loggedinuser, $cookie ) = 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,
- }
+ }
);
- my $categorycode = $input->param('categorycode');
+
+#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');
@@ -192,17 +201,18 @@ if ( $start && $start eq 'Start setting up my Koha' ){
my $enrolmentperiod = $input->param('enrolmentperiod');
my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef;
- #Converts the string into a date format
+#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 to the database
+
+#Adds a new patron category to the database
$category = Koha::Patron::Category->new({
categorycode=> $categorycode,
description => $description,
@@ -212,11 +222,12 @@ if ( $start && $start eq 'Start setting up my Koha' ){
enrolmentperiod => $enrolmentperiod,
enrolmentperioddate => $enrolmentperioddate,
});
+
eval {
$category->store;
};
- #Error messages
+#Error messages
if($category){
$message = 'success_on_insert';
}else{
@@ -224,11 +235,13 @@ if ( $start && $start eq 'Start setting up my Koha' ){
}
$template->param('message' => $message);
-
- }
#Create a patron
}elsif ( $step && $step == 3 ){
+ my $firstpassword = $input->param('password');
+ my $secondpassword = $input->param('password2');
+
+#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 => [
@@ -241,19 +254,73 @@ if ( $start && $start eq 'Start setting up my Koha' ){
]
);
- my $categories;
- $categories= Koha::Patron::Categories->search();
+ my $categories= Koha::Patron::Categories->search();
$template->param(
categories => $categories,
);
- my $input = new CGI;
+#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);
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'
+ :$error_code == 2
+ ? 'ERROR_cardnumber_length'
+ :()
+ }
- my ($template, $loggedinuser, $cookie)= get_template_and_user({
+#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));
+
+
+#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);
+ }
+ 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);
+
+#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,
type => "intranet",
@@ -262,9 +329,8 @@ if ( $start && $start eq 'Start setting up my Koha' ){
debug => 1,
});
-
if($op eq 'add_validate'){
- my %newdata;
+ my %newdata;
#Store the template form values in the newdata hash
$newdata{borrowernumber} = $input->param('borrowernumber');
@@ -279,25 +345,15 @@ 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();
my @perms = $input->multi_param('flag');
@@ -312,42 +368,37 @@ 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);
+#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'};
+ #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 );
-
- my $input = new CGI;
- my $itemtype_code = $input->param('itemtype');
- my $op = $input->param('op') // 'list';
- my $message;
- my( $template, $borrowernumber, $cookie) = get_template_and_user(
+
+ my( $template, $borrowernumber, $cookie) = C4::InstallAuth::get_template_and_user(
{ template_name => "/onboarding/onboardingstep4.tt",
query => $input,
type => "intranet",
@@ -356,23 +407,24 @@ if ( $start && $start eq 'Start setting up my Koha' ){
debug => 1,
}
);
-
- 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);
- my $description = $input->param('description');
- #store the input from the form - only 2 fields
- my $thisitemtype= Koha::ItemType->new(
+ if($op eq 'add_validate'){
+ my $description = $input->param('description');
+ 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{ $thisitemtype->store; };
- #Error messages
- if($thisitemtype){
+
+ eval{ $itemtype->store; };
+
+ 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{
$message = 'error_on_insert';
@@ -381,66 +433,161 @@ if ( $start && $start eq 'Start setting up my Koha' ){
$template->param('message' => $message);
}
}elsif ( $step && $step == 5){
- my $test="a";
- warn $test;
-
- #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 => [
+ { categorytype => 'searchdomain',
+ categories => [ Koha::LibraryCategories->search( { categorytype => 'searchdomain' } ) ],
+ },
+ { categorytype => 'properties',
+ categories => [ Koha::LibraryCategories->search( { categorytype => 'properties' } ) ],
+ },
+ ]
+ );
+
my $input = CGI->new;
- my($template, $loggedinuser, $cookie) =get_template_and_user({
- template_name => "/onboarding/onboardingstep5.tt",
- query => $input,
- type => "intranet",
- authnotrequired=>0,
- flagsrequired=> {parameters => 'manage_circ_rules'},
- debug =>1,
+ 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,
});
- my $type = $input->param('type');
+
+#If no libraries exist then set the $branch value to *
my $branch = $input->param('branch');
- if($op eq 'add_form'){
+ unless ( $branch ) {
+ if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) {
+ $branch = Koha::Libraries->search->count() == 1 ? undef : C4::Context::mybranch();
+ }
+ else {
+ $branch = C4::Context::only_my_library() ? ( C4::Context::mybranch() || '*' ) : '*';
+ }
}
-
- elsif($op eq 'add_validate'){
+ $branch = '*' if $branch eq 'NO_LIBRARY_SET';
+ my $op = $input->param('op') || q{};
+
+ if($op eq 'add_validate'){
+ my $type = $input->param('type');
+ my $br = $input->param('branch');
my $bor = $input->param('categorycode');
my $itemtype = $input->param('itemtype');
my $maxissueqty = $input->param('maxissueqty');
my $issuelength = $input->param('issuelength');
- #$issuelength = $issuelength eq q{} ? undef : $issuelength;
my $lengthunit = $input->param('lengthunit');
my $renewalsallowed = $input->param('renewalsallowed');
my $renewalperiod = $input->param('renewalperiod');
- my $onshelfholds = $input->param('onshelfholds');
+ my $onshelfholds = $input->param('onshelfholds') || 0;
+ $maxissueqty =~ s/\s//g;
+ $maxissueqty = undef if $maxissueqty !~ /^\d+/;
+ $issuelength = $issuelength eq q{} ? undef : $issuelength;
my $params ={
+ branchcode => $br,
categorycode => $bor,
itemtype => $itemtype,
maxissueqty => $maxissueqty,
renewalsallowed => $renewalsallowed,
renewalperiod => $renewalperiod,
+ issuelength => $issuelength,
lengthunit => $lengthunit,
onshelfholds => $onshelfholds,
};
- my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype});
- if($issuingrule){
- $issuingrule->set($params)->store();
- }else{
- Koha::IssuingRule->new()->set($params)->store();
+
+ my @messages;
+
+#New code from smart-rules.tt starts here. Needs to be added to library
+#Allows for the 'All' option to work when selecting all libraries for a circulation rule to apply to.
+ if ($branch eq "*") {
+ my $sth_search = $dbh->prepare("SELECT count(*) AS total
+ FROM default_circ_rules");
+ my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules
+ (maxissueqty, onshelfholds)
+ VALUES (?, ?)");
+ my $sth_update = $dbh->prepare("UPDATE default_circ_rules
+ SET maxissueqty = ?, onshelfholds = ?");
+
+ $sth_search->execute();
+ my $res = $sth_search->fetchrow_hashref();
+ if ($res->{total}) {
+ $sth_update->execute($maxissueqty, $onshelfholds);
+ } else {
+ $sth_insert->execute($maxissueqty, $onshelfholds);
}
}
- }
+#Allows for the 'All' option to work when selecting all patron categories for a circulation rule to apply to.
+ if ($bor eq "*") {
+ my $sth_search = $dbh->prepare("SELECT count(*) AS total
+ FROM default_circ_rules");
+ my $sth_insert = $dbh->prepare(q|
+ INSERT INTO default_circ_rules
+ (maxissueqty)
+ VALUES (?)
+ |);
+ my $sth_update = $dbh->prepare(q|
+ UPDATE default_circ_rules
+ SET maxissueqty = ?
+ |);
+
+ $sth_search->execute();
+ my $res = $sth_search->fetchrow_hashref();
+ if ($res->{total}) {
+ $sth_update->execute($maxissueqty);
+ } else {
+ $sth_insert->execute($maxissueqty);
+ }
+ }
+#Allows for the 'All' option to work when selecting all itemtypes for a circulation rule to apply to
+ if ($itemtype eq "*") {
+ my $sth_search = $dbh->prepare("SELECT count(*) AS total
+ FROM default_branch_circ_rules
+ WHERE branchcode = ?");
+ my $sth_insert = $dbh->prepare("INSERT INTO default_branch_circ_rules
+ (branchcode, onshelfholds)
+ VALUES (?, ?)");
+ my $sth_update = $dbh->prepare("UPDATE default_branch_circ_rules
+ SET onshelfholds = ?
+ WHERE branchcode = ?");
+ $sth_search->execute($branch);
+ my $res = $sth_search->fetchrow_hashref();
+ if ($res->{total}) {
+ $sth_update->execute($onshelfholds, $branch);
+ } else {
+ $sth_insert->execute($branch, $onshelfholds);
+ }
+ }
+#End new code
+
+ 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/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 @@
-
+
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 5daf7fa..058e1d6 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 %]
All done!
Installation complete.
-
Click on 'Finish' to complete and load the Koha Staff Interface.
+
Click on 'Continue to onboarding tool' to complete and load the Koha onboarding tool.
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 8eed408..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' %]
-
Welcome › to › Koha
-
-
-
-
-
+
Welcome to Koha
-
We're just going to set up a few things......
+
We're just going to set up a few more things...
- [% END %]
-
+ [% END %]
+
[% ELSE %]
Create a new Patron Category
-
+
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 83667cb..45cb584 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 %]
[% INCLUDE 'doc-head-open.inc' %]
-[% IF ( finish ) %][% END %]
-
-
+[% IF ( finish ) %][% END%]
[% INCLUDE 'installer-doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
@@ -16,35 +14,114 @@
Create Patron
-
+
+
+
Welcome to Koha
+
+
+[% IF (nok) %]
+
+
+
There was an error
+
Try again
+
+
+ [% IF errorloginexists %]
+
Username/password already exists.
+ [% END %]
+ [% IF errorcardnumberexists %]
+
Cardnumber already in use.
+ [% END %]
+ [% IF errorcardnumberlength %]
+
Cardnumber length is incorrect
+ [% END %]
+ [% IF errorshortpassword %]
+
Password length is incorrect, must be at least [% minPasswordLength %] characters long.
+ [% END %]
+ [% IF errorpasswordmismatch %]
+
Passwords do not match.
+ [% END %]
+
+
+
+
+
+
+
-[% IF op == 'add_validate' %]
-
+[% ELSIF op == 'add_validate' %]
+
New Patron
-
+
Success: New patron created!
To create another patron, go to Patrons > New Patron.
More > Set Permissions in a user page to gain superlibrarian permissions.
-
- Next up:
-
+
+ Next up:
+
-
[% ELSE %]
-
Create a new Patron
+
Create a new Patron
+
+
+ Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions.
+