From 29b79ad71c6470fbbc915c2f0f23b6b0be3d3861 Mon Sep 17 00:00:00 2001 From: Hayley Mapley Date: Tue, 9 Apr 2019 14:54:39 +1200 Subject: [PATCH] Bug 18308: Changed ordering of onboarding steps This patch cleans up the previous patches according to comment 23, fixes various typos, and changes the order of steps in the onboarding so that the setting of minPasswordLength occurs before the admin password is set. Test plan: 1) Drop and recreate your database, and restart_all 2) Go through installation and onboarding 3) Note that the order of steps is: 1 Create a library 2 Create a ptron category 3 Create Koha administrator patron 4 Create a new item type 5 Create a new circulation rule 6 Set minPasswordLength syspref/Complete 4) Repeat steps 1 & 2 5) Note that the order of steps is now: 1 Create a library 2 Create a patron category 3 Set minPasswordLength syspref 4 Create Koha administrator patron 5 Create a new item type 6 Create a new circulation rule/Complete 6) Verify that the minPasswordLength syspref is set to the value from onboarding 7) Verify that the patron, item type, and circulation rule made in the onboarding exist in the administration 8) Sign off! Sponsored-by Catalyst IT --- installer/onboarding.pl | 49 ++++--- .../prog/en/modules/onboarding/onboardingstep3.tt | 127 ++++-------------- .../prog/en/modules/onboarding/onboardingstep4.tt | 103 ++++++++++++--- .../prog/en/modules/onboarding/onboardingstep5.tt | 147 +++++---------------- .../prog/en/modules/onboarding/onboardingstep6.tt | 106 +++++++++++++-- 5 files changed, 270 insertions(+), 262 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 785b686ddd..3d2e2a4597 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -56,6 +56,7 @@ my $schema = Koha::Database->new()->schema(); my @messages; +#Create library if ( $step == 1 ) { if ( $op eq 'add_validate_library' ) { @@ -84,7 +85,10 @@ if ( $step == 1 ) { $step++ if Koha::Libraries->count; } + +#Create patron category if ( $step == 2 ) { + if ( $op eq "add_validate_category" ) { my $searchfield = $input->param('description') // q||; @@ -136,10 +140,29 @@ if ( $step == 2 ) { $step++ if Koha::Patron::Categories->count; } + +#Set minPasswordLength syspref if ( $step == 3 ) { + + if ( $op eq 'set_validate_min_password_length' ) { + my $minPasswordLength = $input->param('pref_minPasswordLength'); + warn $minPasswordLength; + C4::Context->set_preference( 'minPasswordLength', $minPasswordLength ); + unless ($@) { + push @messages, { code => 'success_on_update_minPasswordLength_syspref' }; + $step++; + } + else { + push @messages, { code => 'error_on_update_minPasswordLength_syspref' }; + } + } +} + +#Create Koha administrator +if ( $step == 4 ) { + if ( $op eq 'add_validate_patron' ) { - #Create a patron my $firstpassword = $input->param('password') || ''; my $secondpassword = $input->param('password2') || ''; my $cardnumber = $input->param('cardnumber'); @@ -202,7 +225,10 @@ if ( $step == 3 ) { $step++ if Koha::Patrons->search( { flags => 1 } )->count; } -if ( $step == 4 ) { + +#Create item type +if ( $step == 5 ) { + if ( $op eq 'add_validate_itemtype' ) { my $description = $input->param('description'); my $itemtype_code = $input->param('itemtype'); @@ -226,7 +252,9 @@ if ( $step == 4 ) { $step++ if Koha::ItemTypes->count; } -if ( $step == 5 ) { + +#Create circulation rule +if ( $step == 6 ) { if ( $op eq 'add_validate_circ_rule' ) { @@ -290,21 +318,6 @@ if ( $step == 5 ) { $step++ if Koha::IssuingRules->count; } -if ( $step == 6 ) { - if ( $op eq 'set_validate_min_password_length' ) { - my $minPasswordLength = $input->param('pref_minPasswordLength'); - warn $minPasswordLength; - C4::Context->set_preference( 'minPasswordLength', $minPasswordLength ); - unless ($@) { - push @messages, { code => 'success_on_update_minPasswordLength_syspref' }; - $step++; - } - else { - push @messages, { code => 'error_on_update_minPasswordLength_syspref' }; - } - } -} - my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); $template_params->{libraries} = $libraries; 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 eed7068f05..c792e3b576 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt @@ -1,6 +1,5 @@ -[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Web installer › Create Koha administrator patron +Koha › Web installer › Set minPasswordLength system preference [% INCLUDE 'installer-doc-head-close.inc' %] @@ -9,114 +8,38 @@

Koha

-

Web installer › Create Koha administrator patron

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

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

-
-
- - -

Administrator 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. -
- -

Administrator account permissions

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

Administrator login

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

- To create another patron, go to: - Patrons › New patron -

-

- To edit patron permissions, go to: - More › Set permissions -

-
- - -
+

Web installer › Set minPasswordLength system preference

+ + [% INCLUDE 'onboarding_messages.inc' %] + + The minPasswordLength system preference is a setting for the shortest length library staff and patrons can set their passwords to. +
+
+ + +
    +
  1. + + + Required +
  2. +
+

+ To amend the minPasswordLength system preference go to: + Administration › Global system preferences › Patrons +

+
+ +
- + [% MACRO jsinclude BLOCK %] [% INCLUDE 'validator-strings.inc' %] [% INCLUDE 'installer-strings.inc' %] - [% PROCESS 'password_check.inc' %] - [% PROCESS 'add_password_check' new_password => 'password' %] [% END %] [% INCLUDE 'installer-intranet-bottom.inc' %] - 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 ba41c63488..876a746896 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt @@ -1,5 +1,6 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Web installer › Create a new item type +Koha › Web installer › Create Koha administrator patron [% INCLUDE 'installer-doc-head-close.inc' %] @@ -8,39 +9,102 @@

Koha

-

Web installer › Create a new item type

+

Web installer › Create Koha administrator patron

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

Item types are used to group related items. Examples of item types might be books, CDs, or DVDs.

-

When adding to your institution's catalog you will create an item of a particular item type.

-

Importantl: Item types are what you apply circulation rules to. Circulation rules govern how your institution will lend its items: Checkout length, renewal policy, hold policy, etc. For example a circulation rule applied to the DVD item type may enforce a payment of $1.00 for checking out any DVD.

- -
+

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

+
- + +

Administrator 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. +
-

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

Administrator account permissions

+
    +
  1. + + + superlibrarian +
  2. +
+ +

Administrator login

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

+ To create another patron, go to: + Patrons › New patron +

+

+ To edit patron permissions, go to: + More › Set permissions

-
+ +
@@ -50,6 +114,9 @@ [% INCLUDE 'validator-strings.inc' %] [% INCLUDE 'installer-strings.inc' %] + [% PROCESS 'password_check.inc' %] + [% PROCESS 'add_password_check' new_password => 'password' %] [% END %] -[% INCLUDE 'installer-intranet-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'installer-intranet-bottom.inc' %] + 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 bdeda07463..a024db23c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -1,11 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Web installer › - [% IF all_done %] - Complete - [% ELSE %] - Create circulation rule - [% END %] - +Koha › Web installer › Create a new item type [% INCLUDE 'installer-doc-head-close.inc' %] @@ -14,111 +8,40 @@

Koha

- -

Web installer › Create a new circulation rule

- - [% INCLUDE 'onboarding_messages.inc' %] - -
-
- - -
    -
  1. - - - Required -
  2. -
  3. - - - Required -
  4. - -
  5. - - - Required -
  6. -
  7. - - - Required -
  8. - -
  9. - - - Required -
  10. -
  11. - - -
  12. -
  13. - - - Required -
  14. - -
  15. - - - Required -
  16. - -
  17. - - -
  18. -
-

- To create circulation rule, go to: - Administration › Circulation and fine rules -

- -
- +

Web installer › Create a new item type

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

Item types are used to group related items. Examples of item types might be books, CDs, or DVDs.

+

When adding to your institution's catalog you will create an item of a particular item type.

+

Importantl: Item types are what you apply circulation rules to. Circulation rules govern how your institution will lend its items: Checkout length, renewal policy, hold policy, etc. For example a circulation rule applied to the DVD item type may enforce a payment of $1.00 for checking out any DVD.

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

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

- +
+
@@ -129,4 +52,4 @@ [% END %] -[% INCLUDE 'installer-intranet-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'installer-intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt index 19f945b854..8abdf21dbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt @@ -3,7 +3,7 @@ [% IF all_done %] Complete [% ELSE %] - Set minPasswordLength system preference + Create circulation rule [% END %] [% INCLUDE 'installer-doc-head-close.inc' %] @@ -12,42 +12,124 @@
-
+

Koha

+ [% IF all_done %]

Web installer › Complete

[% INCLUDE 'onboarding_messages.inc' %] -

Congratulations you have finished and are ready to use Koha

+

Congratulations, you have finished and are ready to use Koha

Start using Koha [% ELSE %] -

Web installer › Set minPasswordLength system preference

+

Web installer › Create a new circulation rule

[% INCLUDE 'onboarding_messages.inc' %] - The minPasswordLength system preference is a setting for the shortest length library staff and patrons can set their passwords to. -
+
- +
  1. - - + + + Required +
  2. +
  3. + + Required
  4. + +
  5. + + + Required +
  6. +
  7. + + + Required +
  8. + +
  9. + + + Required +
  10. +
  11. + + +
  12. +
  13. + + + Required +
  14. + +
  15. + + + Required +
  16. + +
  17. + + +

- To amend the minPasswordLength system preference go to: - Administration › Global system preferences › Patrons + To create circulation rule, go to: + Administration › Circulation and fine rules

+
+
[% END %]
-
+
[% MACRO jsinclude BLOCK %] [% INCLUDE 'validator-strings.inc' %] -- 2.11.0