@@ -, +, @@ --- installer/onboarding.pl | 208 ++++++++--------- .../prog/en/modules/installer/Backupstep3.tt | 257 --------------------- .../prog/en/modules/installer/step3.tt | 189 +++++++-------- .../prog/en/modules/onboarding/onboardingstep0.tt | 18 -- .../prog/en/modules/onboarding/onboardingstep1.tt | 57 ++--- .../prog/en/modules/onboarding/onboardingstep2.tt | 42 ++-- .../prog/en/modules/onboarding/onboardingstep3.tt | 87 +++++-- .../prog/en/modules/onboarding/onboardingstep4.tt | 100 ++++---- .../prog/en/modules/onboarding/onboardingstep5.tt | 52 +++-- 9 files changed, 383 insertions(+), 627 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/installer/Backupstep3.tt delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt --- a/installer/onboarding.pl +++ a/installer/onboarding.pl @@ -63,7 +63,7 @@ my ( $template, $loggedinuser, $cookie ) = C4::InstallAuth::get_template_and_user( { template_name => "/onboarding/onboardingstep" - . ( $step ? $step : 0 ) . ".tt", + . ( $step ? $step : 1 ) . ".tt", query => $input, type => "intranet", authnotrequired => 0, @@ -93,60 +93,46 @@ my $dbh = DBI->connect( #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 ); + 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; } -#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 = $input->param('start'); -$template->param( 'start' => $start ); +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 ( $start && $start eq 'Start setting up my Koha' ) { - 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' } - ) - ], - }, - ] - ); -} -elsif ( $start && $start eq 'Minimal patron category setup' ) { #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, ); + $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 ( $start && $start eq 'Minimal item type setup' ) { - my $itemtypes = Koha::ItemTypes->search(); - $template->param( itemtypes => $itemtypes, ); -} -elsif ( $step && $step == 1 ) { - my $createlibrary = $input->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 + $template->param( 'itemtypes' => $itemtypes, ); +if ( $step && $step == 1 ) { #store inputted parameters in variables my $branchcode = $input->param('branchcode'); $branchcode = uc($branchcode); @@ -179,88 +165,94 @@ elsif ( $step && $step == 1 ) { else { $message = 'error_on_insert'; } + warn $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 = $input->param('createcat') - ; #Store the inputted category code and name in $createcat - $template->param( 'createcat' => $createcat ); + if ($op eq "add_validate_category"){ + #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 ); - #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 ( $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( + { + dt => dt_from_string($enrolmentperioddate), + dateformat => 'iso', + dateonly => 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( + #Adds a new patron category to the database + $category = Koha::Patron::Category->new( { - dt => dt_from_string($enrolmentperioddate), - dateformat => 'iso', - dateonly => 1, + categorycode => $categorycode, + description => $description, + overduenoticerequired => $overduenoticerequired, + category_type => $category_type, + default_privacy => $default_privacy, + enrolmentperiod => $enrolmentperiod, + enrolmentperioddate => $enrolmentperioddate, } ); - } - #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; }; - 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'); + + #Find all patron records in the database and hand them to the template + my %currentpatrons = Koha::Patrons->search(); + my $currentpatrons = values %currentpatrons; + warn $currentpatrons; + $template->param( 'patrons' =>$currentpatrons); + + #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'] }, ); @@ -288,11 +280,12 @@ elsif ( $step && $step == 3 ) { #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, ); + $template->param( '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"); + warn $exisiting_cardnumber; my $new_cardnumber = $exisiting_cardnumber + 1; warn $new_cardnumber; $template->param( "newcardnumber" => $new_cardnumber ); @@ -446,9 +439,6 @@ elsif ( $step && $step == 3 ) { } } elsif ( $step && $step == 4 ) { - my $createitemtype = $input->param('createitemtype'); - $template->param( 'createitemtype' => $createitemtype ); - my ( $template, $borrowernumber, $cookie ) = C4::InstallAuth::get_template_and_user( { @@ -460,11 +450,11 @@ elsif ( $step && $step == 4 ) { { parameters => 'parameters_remaining_permissions' }, debug => 1, } - ); - - if ( $op eq 'add_validate' ) { + ); + if ($op eq "add_validate"){ my $description = $input->param('description'); my $itemtype_code = $input->param('itemtype'); + warn $description; $itemtype_code = uc($itemtype_code); #Create a new itemtype object using the user inputted itemtype and description @@ -672,8 +662,6 @@ elsif ( $step && $step == 5 ) { } } - #End new code - my $issuingrule = Koha::IssuingRules->find( { categorycode => $bor, itemtype => $itemtype, branchcode => $br } ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/Backupstep3.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/Backupstep3.tt @@ -1,257 +0,0 @@ -[% INCLUDE 'doc-head-open.inc' %]Koha › Web installer › Step 3 -[% IF ( finish ) %][% END %] -[% INCLUDE 'installer-doc-head-close.inc' %] -
-

Koha Koha web installer › Step 3

- -[% IF ( selectframeworks ) %] - -[% END %] -[% IF ( finish ) %] -

Congratulations, installation complete

-

If this page does not redirect in 5 seconds, click here.

-[% END %] -[% IF ( choosemarc ) %] -

Select your MARC flavor

-
- - -

- [% FOREACH flavourloo IN flavourloop %] -

- [% IF ( flavourloo.checked ) %] - [% flavourloo.label %]
- [% ELSE %] - [% flavourloo.label %]
- [% END %] -
- [% END %] -

-

Click 'Next' to continue

-
-[% END %] - -[% IF ( selectframeworks ) %] -

Selecting Default Settings

- -
- - - - [% IF ( frameworksloop ) %] -

MARC frameworks: [% marcflavour %]

- [% IF ( en_marc_frameworks ) %] -

No MARC frameworks are available for your language. - Defaulting to the frameworks supplied for English (en)

- [% END %] - [% FOREACH frameworksloo IN frameworksloop %] -
-

[% frameworksloo.label %]

- [% FOREACH framework IN frameworksloo.frameworks %] - - - - -
- [% IF ( framework.checked ) %] - - [% ELSE %] - - [% END %] - - -
- [% END %] -
- [% END %] -

Other data

- [% END %] - [% IF ( en_sample_data ) %] -

No sample data and settings are available for your language. - Defaulting to the samples supplied for English (en)

- [% END %] - [% FOREACH levelloo IN levelloop %] -
-

[% levelloo.label %]

- [% FOREACH framework IN levelloo.frameworks %] - - - - -
- [% IF ( framework.checked ) %] - - [% ELSE %] - - [% END %] - - -
- [% END %] -
- [% END %] -

When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete, - please be patient.

-

-

-
-[% END %] - - -[% IF ( addframeworks ) %] - [% FOREACH lis IN list %] -

[% lis.level %] data added

- - [% END %] -

All done!

-

Installation complete.
-

Click on 'Finish' to complete and load the Koha Staff Interface. -

- - -
-

-

-[% END %] - - -[% IF ( importdatastructure ) %] - [% IF ( error ) %] -

The following error occurred while importing the database structure:

-

[% error %]

-

Please contact your system administrator

- [% ELSE %] -

Success

- -
- -

Click 'Next' to continue

-
- [% END %] -[% END %] - - -[% IF ( proposeimport ) %] -

Now we're ready to create the database tables and fill them with some default data.

-
- - -

Click 'Next' to continue

-
-[% END %] - - -[% IF ( default ) %] - [% IF ( upgrading ) %] -

- We are upgrading from Koha [% dbversion %] to [% kohaversion %], you must update your database -

- [% ELSE %] -

We are ready to do some basic configuration. Please install some basic configuration settings to continue the installation: -
-
- -

- [% END %] -[% END %] - - - -[% IF ( updatestructure ) %] -

Updating database structure

- [% IF ( has_update_succeeds ) %] -

Update report :

- - [% END %] - [% IF ( has_update_errors ) %] -

Update errors :

- - [% END %] - [% UNLESS ( has_update_errors ) %] -

Everything went OK, update done.

- [% END %] -Continue to log in to Koha -
-[% END %] - -
- - --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -66,7 +66,7 @@ function Hide(link) [% IF ( finish ) %]

Congratulations, installation complete

-

If this page does not redirect in 5 seconds, click Start onboarding process.

+

If this page does not redirect in 10 seconds, click Start onboarding process.

[% END %] @@ -85,78 +85,78 @@ function Hide(link)

Select your MARC flavor

MARC stands for Machine Readable Cataloging, containing information about a bibliographic record. MARC21 is more commonly used globally, whereas UNIMARC tends to be used in Europe.

-

[% FOREACH flavourloo IN flavourloop %]

[% IF ( flavourloo.label == "Unimarc") %] - [% flavourloo.label %]
+ [% flavourloo.label %]
[% ELSE %] [% flavourloo.label %]
[% END %]
[% END %] -

Click 'Next' to continue

[% END %] - [% IF ( selectframeworks ) %] -

[% setup %] setup

-

Selecting Default Settings

- - -
- - - +

[% setup %] setup

+

Selecting Default Settings

+ + [% IF setup == "Advanced" %] + + [% END %] + + + [% IF ( frameworksloop ) %] -

MARC frameworks: [% marcflavour %]

- [% IF ( en_marc_frameworks ) %] -

No MARC frameworks are available for your language. - Defaulting to the frameworks supplied for English (en)

- [% END %] - [% FOREACH frameworksloo IN frameworksloop %] -
-

[% frameworksloo.label %]

- [% FOREACH framework IN frameworksloo.frameworks %] - - - - - [% ELSE %] - +

MARC frameworks: [% marcflavour %]

+ [% IF ( en_marc_frameworks ) %] +

No MARC frameworks are available for your language. + Defaulting to the frameworks supplied for English (en)

+ [% END %] + [% FOREACH frameworksloo IN frameworksloop %] +
+

[% frameworksloo.label %]

+ [% FOREACH framework IN frameworksloo.frameworks %] +
- [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] - - [% ELSE %] - - [% END %] - - [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] -
    - -
-
- -
+ + + + [% ELSE %] + + [% END %] + +
+ [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] + + [% ELSE %] + + [% END %] + + [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] +
    +
  • + +
  • +
+
+ +
+ [% END %] +
[% END %] - - - [% END %] - - [% END %]

Other data

[% END %] [% IF ( en_sample_data ) %] @@ -164,39 +164,49 @@ function Hide(link) Defaulting to the samples supplied for English (en) [% END %] [% FOREACH levelloo IN levelloop %] -
-

[% levelloo.label %]

- [% FOREACH framework IN levelloo.frameworks %] - - - - - [% ELSE %] - + + [% FOREACH framework IN levelloo.frameworks %] +
- [% IF (levelloo.label == "Default" ) && (setup=="Basic")%] - - [% ELSE %] - +
+

[% levelloo.label %]

+ + [% IF (setup == "Basic" && levelloo.label == "Optional") %] + [% END %] -
- [% IF (levelloo.label == "Default") && (setup=="Basic")%] -
    - -
-
- -
+ + + + [% ELSE %] + + [% END %] + +
+ [% IF (levelloo.label == "Default" ) && (setup=="Basic")%] + + [% ELSE %] + + [% END %] + + [% IF (levelloo.label == "Default") && (setup=="Basic")%] +
    +
  • + +
  • +
+
+ +
[% END %] - - - [% END %] -
+ [% END %]

When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete, please be patient.

@@ -217,11 +227,11 @@ function Hide(link) [% END %]

All done!

Installation complete.
-

Click on 'Set Koha version system preference' to complete and load the Koha onboarding tool. +

Click on 'Set up Koha with the onboarding tool' to complete and load the Koha onboarding tool. - +

@@ -255,7 +265,6 @@ function Hide(link) [% END %] - [% IF ( default ) %] [% IF ( upgrading ) %]

@@ -272,8 +281,6 @@ function Hide(link) [% END %] [% END %] - - [% IF ( updatestructure ) %]

Updating database structure

[% IF ( has_update_succeeds ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt @@ -1,18 +0,0 @@ - -[% INCLUDE 'doc-head-open.inc' %] -[% INCLUDE 'installer-doc-head-close.inc' %] - - -Welcome › to › Koha - - - -
-

Welcome to Koha

-

Koha

-

We're just going to set up a few more things...

-
- - -
-
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt @@ -1,35 +1,29 @@ [% INCLUDE 'doc-head-open.inc' %] + [% INCLUDE 'installer-doc-head-close.inc' %] +[% INCLUDE 'datatables.inc' %] - -Welcome › to › Koha - +[% IF (libraries && libraries.count > 1) %] + - -
-

Welcome to Koha

-

Koha

-
- [% IF (libraries && libraries.count > 0) %] -
-

You do not need to create a library as you have already installed the sample library data previously

-
- -
- -
-
+[% ELSIF (op == "add_validate_library") %] + + Welcome › to › Koha + - -[% ELSIF (createlibrary) %] - + +
+

Koha Welcome to Koha

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

New Library

+

New library

-

Success: Library created! +

Success: library created!

To add another library and for more settings,
go to:
@@ -53,12 +47,21 @@ [%END%] [% ELSE %] + + Welcome › to › Koha + + + +

+

Koha Welcome to Koha

+
+ -

Create a Library

-
+
+

Create a library

- +
  1. @@ -71,8 +74,8 @@ Required
-

+
[% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt @@ -267,30 +267,24 @@ $(document).ready(function() { -
-

Welcome to Koha

-

Koha

-
+[% IF (categories && categories.count > 1 ) %] -[% IF (categories && categories.count > 0) %] -
-

You do not need to create a patron category as you have already installed the sample patron categories data previously

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

Koha Welcome to Koha

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

New patron category

-

Success: Patron category created!

+

Success: patron category created!

To add another patron category and for more settings
go to:
More -> Administration -> Patron categories
@@ -303,7 +297,7 @@ $(document).ready(function() { Message is [% message %]

Failed

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

@@ -312,11 +306,16 @@ $(document).ready(function() { [% ELSE %] -

Create a new Patron Category

+
+

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. @@ -361,7 +360,7 @@ $(document).ready(function() { [% SET default_privacy = 'default' %] [% IF category %] - [% SET default_privacy = category.default_privacy %] + [% SET default_privacy = category.default_privacy %] [% END %] [% SWITCH default_privacy %] @@ -381,7 +380,7 @@ $(document).ready(function() {

    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.

  2. - +
Enrolment period:
@@ -389,7 +388,7 @@ $(document).ready(function() {
  1. - months + months
  2. @@ -399,6 +398,7 @@ $(document).ready(function() {

+
[% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt @@ -9,10 +9,10 @@ [% INCLUDE 'datatables.inc' %] -Create Patron +Create Koha administrator patron - +