From b025159458dfe5cda04183f06f00c53f6bcac24f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 17 Apr 2017 15:42:35 -0300 Subject: [PATCH] Bug 17855: Simplify the onboarding tool This patch should not modify a lot the behaviours of the onboarding tool. Its goal is mainly to remove duplicated as well as useless (because copy/pasted from existing script files) code. It assumes that the onboarding tool will be done on an empty database and will skip steps that are not needed. For instance if a library already exists, the first step will be skipped. One of the main problem was the lack of feedback messages sent to the user when something wrong/ok happened. Explanation on main changes: 1. Use checkauth first, then get_template_and_user => As we do not know the template to use, it's better to use checkauth first to know if the user is logged in, then retrieve the template we need, depending on the success or the failure of the action 2. Create a @messages variables Pushing messages to this variable and handling the messages via an include files (onboarding_messages.inc) simplify error handling. Note that we could remove this include file if we merge all the onboardingstepX.tt files altogether 3. Simplify creation of the admnistrator user This patch removes some unecessary checks done on the user's info (passwd to short, mandatory fields Todo (minor): Add style to feedback messages --- installer/onboarding.pl | 562 +++++++-------------- .../prog/en/includes/onboarding_messages.inc | 20 + .../prog/en/modules/onboarding/onboardingstep1.tt | 109 ++-- .../prog/en/modules/onboarding/onboardingstep2.tt | 221 ++++---- .../prog/en/modules/onboarding/onboardingstep3.tt | 216 ++++---- .../prog/en/modules/onboarding/onboardingstep4.tt | 82 +-- .../prog/en/modules/onboarding/onboardingstep5.tt | 207 ++++---- 7 files changed, 525 insertions(+), 892 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc diff --git a/installer/onboarding.pl b/installer/onboarding.pl index d24f17c..02d4827 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -35,133 +35,66 @@ use Koha::IssuingRules; #Setting variables my $input = new CGI; -my $step = $input->param('step'); unless ( C4::Context->preference('Version') ) { print $input->redirect("/cgi-bin/koha/installer/install.pl"); exit; } -#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 : 1 ) . ".tt", - query => $input, - type => "intranet", - authnotrequired => 0, - debug => 1, - } - ); +my ( $user, $cookie, $sessionID, $flags ) = + C4::InstallAuth::checkauth( $input, 0, undef, 'intranet' ); +die "Not logged in" + unless $user + ; # Should not happen, we should be redirect if the user is not logged in. But do not trust authentication... -#Store the value of the template input name='op' in the variable $op so we can check if the user has pressed the button with the name="op" and value="finish" meaning the user has finished the onboarding tool. -my $op = $input->param('op') || ''; -$template->param( 'op' => $op ); +my $step = $input->param('step') || 1; +my $op = $input->param('op') || ''; + +my $template_params = {}; +$template_params->{op} = $op; my $schema = Koha::Database->new()->schema(); -if ( $op && $op eq 'finish' ) -{ #If the value of $op equals 'finish' then redirect user to /cgi-bin/koha/mainpage.pl - print $input->redirect("/cgi-bin/koha/mainpage.pl"); - exit; -} +my @messages; -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' } - ) - ], - }, - ] -); +if ( $step == 1 ) { -#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, ); + if ( $op eq 'add_validate_library' ) { -#Check if the $step variable equals 1 i.e. the user has clicked to create a library in the create library screen 1 -my $itemtypes = Koha::ItemTypes->search(); -$template->param( 'itemtypes' => $itemtypes, ); - -if ( $step && $step == 1 ) { - - #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; - - #Take the text 'branchname' and store it in the @fields array - my @fields = qw( - branchname - ); - - $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 - $library = Koha::Library->new( - { - branchcode => $branchcode, - ( map { $_ => scalar $input->param($_) || undef } @fields ) - } - ); + my $branchcode = $input->param('branchcode'); + $branchcode = uc($branchcode); - eval { $library->store; }; #Use the eval{} function to store the library object - if ($library) { - $message = 'success_on_insert'; - } - else { - $message = 'error_on_insert'; + $branchcode =~ s|\s||g + ; # Use a regular expression to check the value of the inputted branchcode + + my $library = Koha::Library->new( + { + branchcode => $branchcode, + branchname => scalar $input->param('branchname'), + } + ); + + eval { $library->store; }; + unless ($@) { + push @messages, + { type => 'message', code => 'success_on_insert_library' }; + } + else { + push @messages, + { type => 'message', code => 'error_on_insert_library' }; + } } - $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 + $step++ if Koha::Libraries->count; } -elsif ( $step && $step == 2 ) { +if ( $step == 2 ) { if ( $op eq "add_validate_category" ) { - #Initialising values - my $searchfield = $input->param('description') // q||; + 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, - } - ); + $template_params->{categorycode} = $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'); my $description = $input->param('description'); my $overduenoticerequired = $input->param('overduenoticerequired'); @@ -196,210 +129,89 @@ elsif ( $step && $step == 2 ) { eval { $category->store; }; - #Error messages - if ($category) { - $message = 'success_on_insert'; + unless ($@) { + push @messages, + { type => 'message', code => 'success_on_insert_category' }; } else { - $message = 'error_on_insert'; + push @messages, + { type => 'message', code => 'error_on_insert_category' }; } - - $template->param( 'message' => $message ); } - #Create a patron + $step++ if Koha::Patron::Categories->count; } -elsif ( $step && $step == 3 ) { - my $firstpassword = $input->param('password') || ''; - my $secondpassword = $input->param('password2') || ''; - - #Find all patron records in the database and hand them to the template - my %currentpatrons = Koha::Patrons->search(); - my $currentpatrons = values %currentpatrons; - $template->param( 'patrons' => $currentpatrons ); - -#Find all patron categories in the database and hand them to the template to display in the patron category dropdown box - my $categories = Koha::Patron::Categories->search(); - $template->param( 'categories' => $categories, ); - -#Incrementing the highest existing patron cardnumber to prevent duplicate cardnumber entry - - my $existing_cardnumber = - $schema->resultset('Borrower')->get_column('cardnumber')->max() // 0; - - my $new_cardnumber = $existing_cardnumber + 1; - $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 $cardnumber = $input->param('cardnumber'); - my $borrowernumber = $input->param('borrowernumber'); - my $userid = $input->param('userid'); - - # function to designate mandatory fields (visually with css) - my $check_BorrowerMandatoryField = - C4::Context->preference("BorrowerMandatoryField"); - my @field_check = split( /\|/, $check_BorrowerMandatoryField ); - foreach (@field_check) { - $template->param( "mandatory$_" => 1 ); - $template->param( - BorrowerMandatoryField => - C4::Context->preference("BorrowerMandatoryField") - , #field to test with javascript - ); - } - - #If the entered cardnumber causes an error hand this error to the @errors array - if ( my $error_code = checkcardnumber( $cardnumber, $borrowernumber ) ) { - push @errors, - $error_code == 1 ? 'ERROR_cardnumber_already_exists' - : $error_code == 2 ? 'ERROR_cardnumber_length' - : (); - } - - #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 ( $step == 3 ) { + if ( $op eq 'add_validate_patron' ) { + + #Create a patron + my $firstpassword = $input->param('password') || ''; + my $secondpassword = $input->param('password2') || ''; + my $cardnumber = $input->param('cardnumber'); + my $userid = $input->param('userid'); + + if ( my $error_code = checkcardnumber($cardnumber) ) { + if ( $error_code == 1 ) { + push @messages, + { + type => 'alert', + code => 'ERROR_cardnumber_already_exists' + }; } - 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 ); + elsif ( $error_code == 2 ) { + push @messages, + { type => 'alert', code => 'ERROR_cardnumber_length' }; } } - $template->param( 'nok' => 1 ); + elsif ( $firstpassword ne $secondpassword ) { + + push @messages, + { type => 'alert', code => 'ERROR_password_mismatch' }; + } + else { + + my $patron_data = { + surname => scalar $input->param('surname'), + firstname => scalar $input->param('firstname'), + cardnumber => scalar $input->param('cardnumber'), + branchcode => scalar $input->param('libraries'), + categorycode => scalar $input->param('categorycode_entry'), + userid => scalar $input->param('userid'), + password => scalar $input->param('password'), + password2 => scalar $input->param('password2'), + privacy => "default", + address => "", + city => "", + flags => 1, # Will be superlibrarian + }; -#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", - authnotrequired => 0, - flagsrequired => { borrowers => 1 }, - debug => 1, - } - ); - - if ( $op eq 'add_validate' ) { - my %newdata; - - #Store the template form values in the newdata hash - $newdata{borrowernumber} = $input->param('borrowernumber'); - $newdata{surname} = $input->param('surname'); - $newdata{firstname} = $input->param('firstname'); - $newdata{cardnumber} = $input->param('cardnumber'); - $newdata{branchcode} = $input->param('libraries'); - $newdata{categorycode} = $input->param('categorycode_entry'); - $newdata{userid} = $input->param('userid'); - $newdata{password} = $input->param('password'); - $newdata{password2} = $input->param('password2'); - $newdata{privacy} = "default"; - $newdata{address} = ""; - $newdata{city} = ""; - -#Hand tne the dateexpiry of the patron based on the patron category it is created from my $patron_category = - Koha::Patron::Categories->find( $newdata{categorycode} ); - $newdata{dateexpiry} = - $patron_category->get_expiry_date( $newdata{dateenrolled} ); - -#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 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 @perms = $input->multi_param('flag'); - my %all_module_perms = (); - my %sub_perms = (); - foreach my $perm (@perms) { - if ( $perm !~ /:/ ) { - $all_module_perms{$perm} = 1; - } - else { - my ( $module, $sub_perm ) = split /:/, $perm, 2; - push @{ $sub_perms{$module} }, $sub_perm; - } - } + Koha::Patron::Categories->find( $patron_data->{categorycode} ); + $patron_data->{dateexpiry} = + $patron_category->get_expiry_date( $patron_data->{dateenrolled} ); - # construct flags - my @userflags = $schema->resultset('Userflag')->search( - {}, - { - order_by => { -asc => 'bit' }, - } - ); - - #Setting superlibrarian permissions for new patron - my $flags = - Koha::Patrons->find($borrowernumber)->set( { flags => 1 } ) - ->store; - - #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' }; - } + my $borrowernumber = C4::Members::AddMember(%$patron_data); + + #Error handling checking if the patron was created successfully + if ($borrowernumber) { + push @messages, + { type => 'message', code => 'success_on_insert_patron' }; + } + else { + push @messages, + { type => 'error', code => 'error_on_insert_patron' }; } } } + + $step++ if Koha::Patrons->search( { flags => 1 } )->count; } -elsif ( $step && $step == 4 ) { - my ( $template, $borrowernumber, $cookie ) = - C4::InstallAuth::get_template_and_user( - { - template_name => "/onboarding/onboardingstep4.tt", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => - { parameters => 'parameters_remaining_permissions' }, - debug => 1, - } - ); - if ( $op eq "add_validate" ) { +if ( $step == 4 ) { + if ( $op eq 'add_validate_itemtype' ) { 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, @@ -407,67 +219,29 @@ elsif ( $step && $step == 4 ) { } ); 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'; + unless ($@) { + push @messages, + { type => 'message', code => 'success_on_insert_itemtype' }; } else { - $message = 'error_on_insert'; + push @messages, + { type => 'message', code => 'error_on_insert_itemtype' }; } - $template->param( 'message' => $message ); } + + $step++ if Koha::ItemTypes->count; } -elsif ( $step && $step == 5 ) { - - #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, ); - - my $input = CGI->new; - - 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, - } - ); - - #If no libraries exist then set the $branch value to * - my $branch = $input->param('branch'); - 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() || '*' ) - : '*'; - } - } - $branch = '*' if $branch eq 'NO_LIBRARY_SET'; - my $op = $input->param('op') || q{}; +if ( $step == 5 ) { + + if ( $op eq 'add_validate_circ_rule' ) { + + #If no libraries exist then set the $branch value to * + my $branch = $input->param('branch') || '*'; - if ( $op eq 'add_validate' ) { my $type = $input->param('type'); - my $br = $input->param('branch'); - my $bor = $input->param('categorycode'); + my $branchcode = $input->param('branch'); + my $categorycode = $input->param('categorycode'); my $itemtype = $input->param('itemtype'); my $maxissueqty = $input->param('maxissueqty'); my $issuelength = $input->param('issuelength'); @@ -480,8 +254,8 @@ elsif ( $step && $step == 5 ) { $issuelength = $issuelength eq q{} ? undef : $issuelength; my $params = { - branchcode => $br, - categorycode => $bor, + branchcode => $branchcode, + categorycode => $categorycode, itemtype => $itemtype, maxissueqty => $maxissueqty, renewalsallowed => $renewalsallowed, @@ -491,59 +265,65 @@ elsif ( $step && $step == 5 ) { onshelfholds => $onshelfholds, }; - my @messages; - -#Allows for the 'All' option to work when selecting all libraries for a circulation rule to apply to. - if ( $branch eq "*" ) { - my $search_default_rules = - $schema->resultset('DefaultCircRule')->count(); - my $insert_default_rules = - $schema->resultset('Issuingrule') - ->new( - { maxissueqty => $maxissueqty, onshelfholds => $onshelfholds } - ); - } - -#Allows for the 'All' option to work when selecting all patron categories for a circulation rule to apply to. - elsif ( $bor eq "*" ) { - - my $search_default_rules = - $schema->resultset('DefaultCircRule')->count(); - my $insert_default_rules = $schema->resultset('Issuingrule') - ->new( { maxissueqty => $maxissueqty } ); - } - -#Allows for the 'All' option to work when selecting all itemtypes for a circulation rule to apply to - elsif ( $itemtype eq "*" ) { - my $search_default_rules = - $schema->resultset('DefaultCircRule')->search( - {}, - { - branchcode => $branch - } - - ); + my $issuingrule = Koha::IssuingRule->new($params); + eval { $issuingrule->store; }; - my $insert_default_rules = $schema->resultset('Issuingrule') - ->new( { branchcode => $branch, onshelfholds => $onshelfholds } ); - } - - my $issuingrule = Koha::IssuingRules->find( - { categorycode => $bor, itemtype => $itemtype, branchcode => $br } - ); - if ($issuingrule) { - $issuingrule->set($params)->store(); + unless ($@) { 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. - + { type => 'message', code => 'success_on_insert_circ_rule' }; } else { - Koha::IssuingRule->new()->set($params)->store(); + push @messages, + { type => 'message', code => 'error_on_insert_circ_rule' }; } } + + $step++ if Koha::IssuingRules->count; +} + +my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); +$template_params->{libraries} = $libraries; +$template_params->{group_types} = [ + { + categorytype => 'searchdomain', + categories => [ + Koha::LibraryCategories->search( + { categorytype => 'searchdomain' } + ) + ], + }, + { + categorytype => 'properties', + categories => [ + Koha::LibraryCategories->search( { categorytype => 'properties' } ) + ], + }, +]; + +if ( $step > 5 ) { + $template_params->{all_done} = 1; # If step 5 is complete, we are done! + $step = 5; } +#Getting the appropriate template to display to the user +my ( $template, $loggedinuser ); +( $template, $loggedinuser, $cookie ) = C4::InstallAuth::get_template_and_user( + { + template_name => "onboarding/onboardingstep${step}.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + debug => 1, + } +); + +$template_params->{messages} = \@messages; +my $categories = Koha::Patron::Categories->search(); +$template_params->{categories} = $categories; + +my $itemtypes = Koha::ItemTypes->search(); +$template_params->{itemtypes} = $itemtypes; + +$template->param(%$template_params); + output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc new file mode 100644 index 0000000..67eabef --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc @@ -0,0 +1,20 @@ +[% FOR m IN messages %] +
+ [% SWITCH m.code %] + [% CASE 'success_on_insert_library' %]Library created! + [% CASE 'error_on_insert_library' %]Library already exists and cannot be modified! + [% CASE 'success_on_insert_category' %]Patron category created! + [% CASE 'error_on_insert_category' %]Patron category already exists and cannot be modified! + [% CASE 'success_on_insert_patron' %]Administrator Patron created! + [% CASE 'error_on_insert_patron' %]The patron has not been created! Cardnumber or Userid may already exist. + [% CASE 'ERROR_cardnumber_already_exists' %]Cardnumber already in use. + [% CASE 'ERROR_cardnumber_length' %]Cardnumber length is incorrect. + [% CASE 'ERROR_password_mismatch' %]Passwords do not match. + [% CASE 'success_on_insert_itemtype' %]New item type created! + [% CASE 'error_on_insert_itemtype' %]Item type already exists! + [% CASE 'success_on_insert_circ_rule' %]Circulation rule created! + [% CASE 'error_on_insert_circ_rule' %]Circulation rule not created! + [% CASE %][% message %] + [% END %] +
+[% END %] 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 b295fc9..9754f74 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt @@ -1,81 +1,38 @@ - [% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'installer-doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] -[% IF (libraries && libraries.count > 1) %] - - -[% ELSIF (op == "add_validate_library") %] - - Welcome › to › Koha - - - -
-

Koha Welcome to Koha

-
- - - [% IF message == "success_on_insert" %] -
- -

New library

-
-

Success: library created! -

-

To add another library and for more settings,
- go to:
- More -> Administration -> Libraries and groups
-

-
- Next up: - -
- - [%ELSE %] -
- -

Failed

-
-

Library was not successfully created
- Please try again or contact your system administrator.

-
- -
- [%END%] - -[% ELSE %] - - Welcome › to › Koha - - - -
-

Koha Welcome to Koha

-
- - -
-
-

Create a library

- - -
    -
  1. - - - Required -
  2. -
  3. - - - Required -
  4. -
-
- -
-
-[% END %] +Welcome › to › Koha + +
+

Koha Welcome to Koha

+
+ +[% INCLUDE 'onboarding_messages.inc' %] + +
+
+

Create a library

+ + +
    +
  1. + + + Required +
  2. +
  3. + + + Required +
  4. +
+

+ To add another library and for more settings,
+ go to:
+ More -> Administration -> Libraries and groups
+

+ +
+
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 2b82d44..0d682bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt @@ -26,139 +26,98 @@ jQuery.validator.addMethod( "enrollment_period", function(){ -[% IF (categories && categories.count > 1 ) %] +
+

Koha Welcome to Koha

+
- - -[% ELSIF (op == "add_validate_category") %] - - -
-

Koha Welcome to Koha

-
- - [% IF message != "error_on_insert" %] -
- -

New patron category

-
-

Success: patron category created!

-

To add another patron category and for more settings
- go to:
- More -> Administration -> Patron categories
-

- Next up:
- -
- [% ELSE %] -
- Message is [% message %] +[% INCLUDE 'onboarding_messages.inc' %] +

Create a new patron category

+

The patron category you create in this form is going to be the one which the new administrator patron account will have.

+ +
-

Failed

-
Patron category was not successfully created.
- Please try again or contact your system administrator.

-
- - - [% END %] - - -[% ELSE %] -
-

Koha Welcome to Koha

-
- -

Create a new patron category

-

The patron category you create in this form is going to be the one which the new administrator patron account will have.

-
-
- - -
    -
  1. - - - Required -
  2. - -
  3. - - - Required -
  4. - -
  5. - - -
  6. - -
  7. - - - Required -
  8. - -
  9. - - -

    Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob batch_anonymise.pl which should be set up by your system administrator.

    -
  10. -
- Enrolment period: -
-
- Choose one -
    -
  1. - - months -
  2. -
  3. - - -
  4. -
-
-
- -
-
-[% END %] + +
    +
  1. + + + Required +
  2. + +
  3. + + + Required +
  4. + +
  5. + + +
  6. + +
  7. + + Staff +
  8. + +
  9. + + +

    Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob batch_anonymise.pl which should be set up by your system administrator.

    +
  10. +
+ Enrolment period: +
+
+ Choose one +
    +
  1. + + months +
  2. +
  3. + + +
  4. +
+
+

Success: patron category created!

+

To add another patron category and for more settings
+ go to:
+ More -> Administration -> Patron categories
+ + +

+ [% INCLUDE 'intranet-bottom.inc' %] 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 de2e595..dc94b0f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt @@ -3,7 +3,6 @@ [% USE KohaDates %] [% USE Price %] [% INCLUDE 'doc-head-open.inc' %] -[% IF ( finish ) %][% END%] [% INCLUDE 'installer-doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] [% INCLUDE 'datatables.inc' %] @@ -59,138 +58,95 @@ $(document).ready(function(){

Koha Welcome to Koha

+[% INCLUDE 'onboarding_messages.inc' %] -[% 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 %] -
+

Create koha administrator patron

+

+Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions. +

+ +
+ + + Library management +
    +

    Patron identity

    +
  1. + + + Required +
  2. +
  3. + + + Required +
  4. +
-
- -
+
    +
  1. + + [% IF patrons && patrons > 1 %] + + [% ELSE %] + + [% END %] + Required +
  2. +
  3. + + + -

    Koha administrator patron

    -
    -

    Success: administrator patron created!

    -

    To create another patron, go to Patrons -> New Patron.
    - More -> Set Permissions in a user page to gain superlibrarian permissions. -

    - Next up: - - -[% ELSE %] - -

    Create koha administrator patron

    -

    - Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions. -

    -
    -
    - - - Library management -
      -

      Patron identity

      -
    1. - - - Required -
    2. -
    3. - - - Required -
    4. -
    - -
      -
    1. - - [% IF patrons && patrons > 1 %] - - [% ELSE %] - - [% END %] - Required -
    2. -
    3. - - - - + Required +
    4. +
    5. + + + Required

      + Note: If you installed sample patron categories please select the "Staff" option in the patron categories dropdown box. +
    6. +
    - - Required -
  4. -
  5. - - - Required

    - Note: If you installed sample patron categories please select the "Staff" option in the patron categories dropdown box. -
  6. -
- -
    -

    Koha administrator patron permissions

    - -
  1. - - -
  2. -
-
    -

    OPAC/Staff Login

    -
  1. - - - - Required -
  2. -
  3. - - - Required -
  4. -
  5. - - - Required -
  6. -
-
- - -[% END %] +
    +

    Koha administrator patron permissions

    +
  1. + +
  2. +
+
    +

    OPAC/Staff Login

    +
  1. + + + Required +
  2. +
  3. + + + Required +
  4. +
  5. + + + Required +
  6. +
+

+ To create another patron, go to Patrons -> New Patron.
+ More -> Set Permissions in a user page to gain superlibrarian permissions. +

+ +
+ + 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 6176fb4..2ca3ef4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt @@ -1,6 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -[% IF ( finish ) %][% END%] [% INCLUDE 'installer-doc-head-close.inc' %] Create item type @@ -9,59 +8,34 @@

Koha Welcome to Koha

-[% IF (itemtypes && itemtypes.count >1) %] +[% INCLUDE 'onboarding_messages.inc' %] - + +

Create a new Item type

+

Item types are used to group related items. Examples of item types are books, cds, and DVDs.

When adding to your institutions catalogue you will create an item of a particular item type.

Importantly item types are what you apply circulation rules to. Circulation rules govern how your institution will lend its items, for example a circulation rule applied to the DVD item type may enforce a payment of $1.00 for borrowing any DVD.

+
+
+ + +
    +
  1. + + + Required +
  2. -[% ELSIF op == "add_validate" %] - [% IF message != "error_on_insert" %] - - -

    New Item type

    -
    -

    Success: New item type created!

    -

    To create another item type later and for more settings
    - go to:
    - More -> Administration -> Item types
    -

    - Next up: - - - [% ELSE %] -
    - -

    Failed

    -
    -

    Item type was not successfully created.
    - Please try again or contact your system administrator. -

    -
    -
    - - [% END %] -[% ELSE %] - -

    Create a new Item type

    -

    Item types are used to group related items. Examples of item types are books, cds, and DVDs.

    When adding to your institutions catalogue you will create an item of a particular item type.

    Importantly item types are what you apply circulation rules to. Circulation rules govern how your institution will lend its items, for example a circulation rule applied to the DVD item type may enforce a payment of $1.00 for borrowing any DVD.

    -
    -
    - - -
      -
    1. - - - Required -
    2. +
    3. + + + Required +
    4. +
    +
    +

    To create another item type later and for more settings
    + go to:
    + More -> Administration -> Item types
    +

    -
  3. - - - Required -
  4. -
-
- -
- -[% END %] + + + 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 bad9a2a..9701e62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -1,127 +1,114 @@ [% INCLUDE 'doc-head-open.inc' %] Create Circulation rule -[% IF ( finish ) %][% END %] [% INCLUDE 'installer-doc-head-close.inc' %]

Koha Welcome to Koha

-[% IF (finish) %] +[% INCLUDE 'onboarding_messages.inc' %] + +[% IF all_done %]

Congratulations you have finished and ready to use Koha

Start using Koha - -[% END %] - - -[% IF op == "add_validate" %] - -
- -

New circulation rule

-
-

Success: circulation rule created!

-

To create circulation rule, go to
- More -> Administration -> Circulation and Fine Rules -

- Next up: - -
[% ELSE %] - -

Create a new circulation rule

-
-
- - -
    -
  1. - - - Required -
  2. -
  3. - - - Required -
  4. +

    Create a new circulation rule

    + +
    + + +
      +
    1. + + + Required +
    2. +
    3. + + + Required +
    4. + +
    5. + + + Required +
    6. +
    7. + + + Required +
    8. -
    9. - - - Required -
    10. -
    11. - - - Required -
    12. +
    13. + + + Required +
    14. +
    15. + + - Required -
    16. -
    17. - - +
    18. +
    19. + + + Required +
    20. - [% SWITCH units %] - [% CASE 'days' %] - - - [% CASE 'hours' %] - - - [% END %] - - -
    21. - - - Required -
    22. +
    23. + + + Required +
    24. -
    25. - - - Required -
    26. +
    27. + + +
    28. +
    +

    To create circulation rule, go to
    + More -> Administration -> Circulation and Fine Rules +

    -
  5. - - -
  6. -
-

- -
+
+ + [% END %] -- 2.9.3