From 26236d7ada78e38c4b5f91fb101ce67597dc8c38 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 18 Jan 2017 16:07:40 +0000 Subject: [PATCH] Bug 17942 - Update style of the web installer with Bootstrap 3 This patch makes style and markup changes to the web installer and new onboarding tool (Bug 17855). - Markup has been corrected, improved, and in many places reindented. - Some page titles have been made more specific. - Some JavaScript and CSS have been moved to separate files. In the onboarding tool I have removed form validation from the markup and JavaScript in many cases where the requirements were not matched elsewhere in Koha. For instance, we shouldn't limit item type descriptions to only letters because the database doesn't require such a limit. To test, apply the patch and run the web installer with an empty database. Confirm that the installation process completes correctly and that each page looks good and works correctly. Signed-off-by: Josef Moravec Signed-off-by: Liz Rea https://bugs.koha-community.org/show_bug.cgi?id=18462 --- koha-tmpl/intranet-tmpl/prog/css/installer.css | 229 +++++++++++++++++++++ .../prog/en/includes/installer-doc-head-close.inc | 79 +------ .../prog/en/includes/installer-strings.inc | 7 + .../prog/en/modules/installer/auth.tt | 93 +++++---- .../prog/en/modules/installer/step1.tt | 168 ++++++++------- .../prog/en/modules/installer/step2.tt | 129 ++++++------ .../prog/en/modules/installer/step3.tt | 199 ++++++++++-------- .../prog/en/modules/onboarding/onboardingstep2.tt | 33 ++- .../prog/en/modules/onboarding/onboardingstep3.tt | 56 +---- .../prog/en/modules/onboarding/onboardingstep4.tt | 8 +- .../prog/en/modules/onboarding/onboardingstep5.tt | 8 +- koha-tmpl/intranet-tmpl/prog/js/onboarding.js | 150 ++++++++++++++ 12 files changed, 731 insertions(+), 428 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/css/installer.css create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/js/onboarding.js diff --git a/koha-tmpl/intranet-tmpl/prog/css/installer.css b/koha-tmpl/intranet-tmpl/prog/css/installer.css new file mode 100644 index 0000000..374c56d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/css/installer.css @@ -0,0 +1,229 @@ +body { + background-color: #EEE; + text-align: left; + font-family: arial, verdana, helvetica, sans-serif; +} + +h1 { + font-size: 161.6%; + font-weight: bold; +} + +h2 { + background-color: #eee; + border-radius: 4px; + font-size: 146.5%; + font-weight: bold; + text-shadow: 1px 1px 0px #FFF; + padding: .5em; +} + +h3 { + color: #003366; + font-size: 131%; + font-weight: bold; +} + +hr { + margin-top: .5em; + margin-bottom: .5em; +} + +.installer-main { + background-color: #FFF; + border-radius: 5px; + margin-top: 3%; + margin-bottom: 3%; + padding: 1em; + -webkit-box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5); + -moz-box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5); + box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.5); +} + +ul, ol { padding: 5px 5px 5px 20px; } + +#logo { + background: url(../img/koha-logo.gif) no-repeat top center; + margin-top: 0; + margin-bottom: .5em; +} + +#logo a { + display: block; + text-indent: -1000px; + height: 74px; + border-bottom: none; +} + +.bg-danger { + padding: .2em .4em; +} + +.step a, .step input { font-size: 2em; } + +td input { font-size: 1.5em; } + +.step, th { text-align: right; } + +#bloc25, .bloc25 { + float:left; + border:1px solid #000000; + margin:0px; + padding:0px; + +} + +#footer { + text-align: center; + border-top: 1px solid #ccc; + padding-top: 1em; + font-style: italic; +} + +.update_error { + color: red; + font-weight: bold; +} + +.checkbox { + margin-bottom: 1em; +} + +fieldset.rows { + border-width: 0; + float: left; + font-size: 90%; + clear: left; + margin: .9em 0 0 0; + padding: 0; + width: 100%; +} + +fieldset.rows legend { + border: 0; + margin-left: 1em; + font-weight: bold; + font-size: 110%; + margin-bottom: 0; +} + +fieldset.rows label, +fieldset.rows span.label { + float: left; + font-weight: bold; + width: 9em; + margin-right: 1em; + text-align: right; +} + +fieldset.rows span.label { + display: inline; + padding: .2em .6em .3em; + font-size: inherit; + font-weight: bold; + line-height: 1; + color: inherit; + text-align: right; + white-space: normal; + vertical-align: baseline; + border-radius: 0; +} + +fieldset.rows fieldset { + background-color: transparent; + border-width: 1px; + margin: 1em; + padding: .3em; +} + +fieldset.rows ol { + padding: 1em 1em 0 1em; + list-style-type: none; +} + +fieldset.rows li { + float: left; + clear: left; + padding-bottom: 1em; + list-style-type: none; + width: 100%; +} + +fieldset.rows .hint { + margin-left: 10.5em; + margin-right: 4em; + margin-top: .5em; + font-size: 96%; + color: #666; +} + +fieldset.rows label.error { + color: #cc0000; + float: none; + margin-left: 1em; + width: auto; +} + +fieldset.rows ol { + padding: 0 1em 0 1em; +} + + +label.required, +span.required { + color : #C00; +} + +span.required { + font-style : italic; + margin-left : .5em; +} + +.breadcrumbs { + background-color: #e6f0f2; + margin: 1em 0; + padding: .4em 2em; +} + +/* Override core jQueryUI widgets */ +.ui-widget-content { border: 1px solid #B9D8D9; background: #ffffff none; color: #222222; } +.ui-widget-header { border: 1px solid #B9D8D9; background: #E6F0F2 none; color: #222222; font-weight: bold; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B9D8D9; background: #F4F8F9 none; font-weight: normal; color: #555555; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #B9D8D9; background: #E6F0F2 none; font-weight: normal; color: #212121; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff none; font-weight: normal; color: #212121; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #FED22F; background: #FFF4C6; color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec; color: #cd0a0a; } + +.ui-widget, +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family : inherit; + font-size : inherit; +} + +/* jQuery UI Datepicker */ +.ui-datepicker table { + width: 100%; + font-size: .9em; + border : 0; + border-collapse: collapse; + margin:0 0 .4em; +} + +.ui-datepicker th { + background : transparent none; + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} + +.ui-datepicker-trigger { + vertical-align: middle; + margin : 0 3px; +} +.ui-datepicker { + box-shadow: 1px 1px 3px 0 #666; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc index 60d0e66..d62bfe6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc @@ -2,92 +2,15 @@ - - - + - - - - - - - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc new file mode 100644 index 0000000..21b8245 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt index c3509cd..28d95ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt @@ -1,52 +1,63 @@ [% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -Koha › +<title>Koha › [% IF ( nopermission ) %]Access denied[% END %] [% IF ( timed_out ) %]Session timed out[% END %] [% IF ( different_ip ) %]IP address change[% END %] [% IF ( invalid_username_or_password ) %]Invalid username or password[% END %] - [% IF ( loginprompt ) %]Log in to Koha[% END %] + [% IF ( loginprompt ) %]Log in to the Koha web installer[% END %] [% INCLUDE 'installer-doc-head-close.inc' %] -
-

Koha [%- Koha.Version.release -%] installer

-[% IF ( nopermission ) %] -
Error: Unauthorized user click to log out
-[% END %] - -[% IF ( timed_out ) %] -
Error: Session timed out, please log in again
-[% END %] - -[% IF ( different_ip ) %] -
Error: IP address has changed, please log in again
-[% END %] - -[% IF ( invalid_username_or_password ) %] -
Error: Invalid username or password
-[% END %] - -[% IF ( loginprompt ) %] - -
-[% FOREACH INPUT IN INPUTS %] - -[% END %] -

Welcome to the Koha web installer

-

Before we begin, please verify you have the correct credentials to continue. Please log in -with the username and password given to you by your systems administrator and located in your -koha-conf.xml configuration file.

-

Please enter your username and password:

-

-

-

-

-

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

Koha

+ + [% IF ( nopermission ) %] +
Error: Unauthorized user click to log out
+ [% END %] + + [% IF ( timed_out ) %] +
Error: Session timed out, please log in again
+ [% END %] + + [% IF ( different_ip ) %] +
Error: IP address has changed, please log in again
+ [% END %] + + [% IF ( invalid_username_or_password ) %] +
Error: Invalid username or password
+ [% END %] + + [% IF ( loginprompt ) %] +

Welcome to the Koha [%- Koha.Version.release -%] web installer

+ +

Before we begin, please verify you have the correct credentials to continue. Please log in with the username and password given to you by your systems administrator and located in your koha-conf.xml configuration file.

+ +
+ [% FOREACH INPUT IN INPUTS %] + + [% END %] + +
+ Please enter your username and password + +
+ + +
+
+ + +
+

+
+
+ [% END %] +
+
+
[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt index 89da761..9647ae9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt @@ -1,82 +1,98 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Web installer › Step 1 -[% INCLUDE 'installer-doc-head-close.inc' %] -
-

Koha Web installer › Step 1

-[% UNLESS ( language ) %] -

You are about to install Koha.

- -

Please pick your language from the following list. If your language is not -listed, please inform your systems administrator.

-
- -

- -

Click 'Next' to continue

-
-[% END %] -[% IF ( language ) %] - [% IF ( checkmodule ) %] -

All required Perl modules appear to be installed.
- [% ELSE %] - [% IF ( missing_modules ) %] -

Warning: Some Perl modules are missing.
Modules in red must be installed before you may continue.
-

    - [% FOREACH missing_module IN missing_modules %] - [% IF ( missing_module.require ) %] -
  • [% missing_module.name %] - [% ELSE %] -
  • [% missing_module.name %] + Check Perl dependencies [% END %] -
    Version: [% missing_module.version %] -
    Usage: [% missing_module.usage %] -
  • - [% END %] - [% END %] - [% IF ( problems ) %] -

    I encountered some problems.

    -
      - [% IF ( perlversion ) %] -
    • Your Perl version seems to be obsolete. - Please upgrade to a newer version of Perl (at least Version 5.10).
    • - [% END %] -
    - [% END %] - [% END %] -
    -[% IF ( checkmodule ) %] -[% IF (op == 'noop') %] - -[% ELSE %] - - - -[% END %] -

    All dependencies installed.

    -

    Please click 'Next' to continue

    -[% ELSE %] -[% IF (op == 'noop') %] - -[% ELSE %] - - -[% END %] -

    Click to recheck dependencies

    -[% END %] -
    -[% END %] + +[% INCLUDE 'installer-doc-head-close.inc' %] + +
    +
    +
    + +

    Koha

    + + [% UNLESS ( language ) %] +

    Web installer › Choose your language

    +

    You are about to install Koha.

    + +

    Please pick your language from the following list. If your language is not listed, please inform your system administrator.

    + +
    +
    + + +
    + +

    +
    + [% END %] + + [% IF ( language ) %] + [% UNLESS ( checkmodule ) %] + [% IF ( missing_modules ) %] +

    Web installer › Perl modules missing

    +

    Some Perl modules are missing. Required modules must be installed before you may continue.
    +

      + [% FOREACH missing_module IN missing_modules %] +
    • [% missing_module.name %] [% IF ( missing_module.require ) %]Required[% END %] +
      Version: [% missing_module.version %] +
      Usage: [% missing_module.usage %] +
    • + [% END %] +
    + [% END %] + + [% IF ( problems ) %] +

    Web installer › Perl version too old

    +

    I encountered some problems.

    +
      + [% IF ( perlversion ) %] +
    • Your Perl version is out of date. Please upgrade to a newer version of Perl (at least version 5.10).
    • + [% END %] +
    + [% END %] + +
    + +

    +
    + + [% ELSE # IF checkmodule %] +

    Web installer › Check Perl dependencies

    +

    All required Perl modules appear to be installed.

    +

    All dependencies installed.

    + +
    + +

    +
    + [% END # IF checkmodule%] + [% END # IF language %] +
    +
    + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt index d7194b9..aaea508 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt @@ -1,63 +1,70 @@ -[% INCLUDE 'doc-head-open.inc' %]Koha › Web installer › Step 2 +[% INCLUDE 'doc-head-open.inc' %]Koha › Web installer › Database settings [% INCLUDE 'installer-doc-head-close.inc' %] -
    -

    Koha Web installer › Step 2

    -

    Database settings:

    -
      -
    • database type : [% dbms %]
    • -
    • database name : [% dbname %]
    • -
    • database host : [% hostname %]
    • -
    • database port : [% port %] (probably OK if blank)
    • -
    • database user : [% user %]
    • -
    -
    -[% IF ( dbconnection ) %] -
    - [% IF ( checkdatabaseaccess ) %] -

    Connection established.

    - [% IF ( checkdatabasecreated ) %] -

    Database [% dbname %] exists.

    - [% IF ( checkgrantaccess ) %] -

    User [% user %] has all required privileges on database [% dbname %].

    - [% ELSE %] -

    user [% user %] doesn't have enough privilege on database [% dbname %]

    -

    Ask for or make a change in the user's privileges. Need help? See - [% IF dbms == 'mysql' %] - [% ELSE %] - [% END %]this page. -

    -

    - User [% user %] must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on [% dbname %] -

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

    No database named [% dbname %] detected.

    -

    Please create the database before continuing.

    - [% END %] - [% ELSE %] -
    [% error %] : [% message %] + +
    +
    +
    + +

    Koha

    +

    Web installer › Database settings

    +

    Database settings:

    +
      +
    • Database type : [% dbms %]
    • +
    • Database name : [% dbname %]
    • +
    • Database host : [% hostname %]
    • +
    • Database port : [% port %] (probably okay if blank)
    • +
    • Database user : [% user %]
    • +
    + + [% IF ( dbconnection ) %] + + [% IF ( checkdatabaseaccess ) %] + + [% IF ( checkdatabasecreated ) %] +
      +
    • Database [% dbname %] exists.
    • + [% IF ( checkgrantaccess ) %] +
    • User [% user %] has all required privileges on database [% dbname %].
    • +
    + [% ELSE %] +
+

user [% user %] doesn't have enough privilege on database [% dbname %]

+

Ask for or make a change in the user's privileges. Need help? See [% IF ( mysql ) %] + + [% ELSE %] + + [% END %] + this page. User [% user %] must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on [% dbname %] +

+ [% END %] + [% ELSE %] + +

Please create the database before continuing.

+ [% END %] + [% ELSE %] + +
+
    +
  • Check that your database is running.
  • +
  • Check your database settings in koha-conf.xml.
  • +
  • Check the hostname setting in koha-conf.xml. + Some database servers require 127.0.0.1 rather than localhost.
  • +
+
+

Please correct these errors and start the installer again. + [% END %] + [% UNLESS ( error ) %] + +

+ [% END %] + + [% ELSE %] +
+ + +

+
+ [% END %] +
-
-
    -
  • Check that your database is running.
  • -
  • Check your database settings in koha-conf.xml.
  • -
  • Check the hostname setting in koha-conf.xml. - Some database servers require 127.0.0.1 rather than localhost.
  • -
-

Please correct these errors and start the installer again. - [% END %] - [% IF ( error ) %][% ELSE %] - -

Click 'Next' to continue

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

Please click 'Next' to continue if this information is correct

-
-[% END %] - - - +[% INCLUDE 'intranet-bottom.inc' %] 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 2f8f46a..84f40e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -1,74 +1,85 @@ -[% INCLUDE 'doc-head-open.inc' %]Koha › Web installer › Step 3 -[% IF ( finish ) %][% END %] +[% INCLUDE 'doc-head-open.inc' %] +Koha › Web installer › + [% IF ( proposeimport ) %] + Set up database + [% END %] + [% IF ( importdatastructure ) %] + [% IF ( error ) %] + Error creating database tables + [% ELSE %] + Database tables created + [% END %] + [% END %] + [% IF ( default ) %] + [% IF ( upgrading ) %] + Update database + [% ELSE %] + Install basic configuration settings + [% END %] + [% END %] + [% IF ( choosemarc ) %] + Select your MARC flavor + [% END %] + [% IF ( selectframeworks ) %] + Selecting default settings + [% END %] + +[% IF ( finish ) %][% END %] [% INCLUDE 'installer-doc-head-close.inc' %] -
-

Koha Koha web installer › Step 3

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

Select your MARC flavor

+

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

+ [% FOREACH flavourloo IN flavourloop %] + [% IF ( flavourloo.label == "Unimarc") %] +

+ +

+ [% ELSE %] +

+ +

+ [% END %] + [% END %] +

+ + [% END # / IF choosemarc %] -[% IF ( finish ) %] -

Congratulations, installation complete

-

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

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

Web installer › [% setup %] setup › Selecting default settings

+ [% IF setup == "Advanced" %] +

Select all sample data

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

Select your MARC flavor

@@ -191,33 +202,38 @@ function Hide(link)

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

Web installer › Set up database

+

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

+
+ + +

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

The following error occurred while importing the database structure:

-

[% error %]

-

Please contact your system administrator

- [% ELSE %] -

Success

-
    -
  • Database tables created
  • -
-
- -

Click 'Next' to continue

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

Web installer › Update database

+

We are upgrading from Koha [% dbversion %] to [% kohaversion %]

+

Update your database

+ [% ELSE %] +

Web installer › Install basic configuration settings

+

We are ready to do some basic configuration.

+

Continue to the next step

+ [% 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 ( updatestructure ) %] +

Updating database structure

+ [% IF ( has_update_succeeds ) %] +

Update report :

+
    + [% FOREACH update_repor IN update_report %] +
  • [% update_repor.line |html %]
  • + [% END %] +
+ [% END %] [% IF ( default ) %] [% IF ( upgrading ) %] @@ -232,8 +248,13 @@ function Hide(link)
Install basic configuration settings - [% END %] -[% END %] + [% UNLESS ( has_update_errors ) %] +

Everything went okay. Update done.

+ [% END %] +

Continue to log in to Koha

+ [% END # / IF updatestructure %] +
+ [% IF ( updatestructure ) %]

Updating database structure

@@ -260,6 +281,4 @@ function Hide(link)
[% END %] - - - +[% INCLUDE 'intranet-bottom.inc' %] 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 0d682bc..673cbb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt @@ -2,31 +2,22 @@ [% USE KohaDates %] [% USE Price %] [% INCLUDE 'doc-head-open.inc' %] - Add a patron category +Koha › Web installer › Add a patron category +[% IF (categories && categories.count > 1 ) + # This if statement checks if the categories variable handed to this template + # by onboarding.pl has data in it. If the categories variable does have data + # in it this means that the user has previously imported sample patron category + # data and so we do not need to show them the create patron category screen 1, + #instead we can display a screen with ubtton redirecting the user to step 3 %] + +[% END %] [% INCLUDE 'installer-doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] [% INCLUDE 'js_includes.inc' %] -[% INCLUDE 'datatables.inc' %] - - +[% INCLUDE 'validator-strings.inc' %] +[% INCLUDE 'installer-strings.inc' %] + -

Koha Welcome to Koha

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 dc94b0f..1f04a98 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt @@ -1,63 +1,13 @@ -[% USE Koha %] -[% USE KohaDates %] -[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'installer-doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] -[% INCLUDE 'datatables.inc' %] [% INCLUDE 'js_includes.inc' %] +[% INCLUDE 'validator-strings.inc' %] +[% INCLUDE 'installer-strings.inc' %] - -Create Koha administrator patron - - - -
-

Koha Welcome to Koha

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

Create koha administrator patron

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 2ca3ef4..4a32f9d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt @@ -1,12 +1,10 @@ [% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'installer-doc-head-close.inc' %] - - Create item type +[% INCLUDE 'validator-strings.inc' %] +[% INCLUDE 'installer-strings.inc' %] + -
-

Koha Welcome to Koha

-
[% INCLUDE 'onboarding_messages.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 9701e62..8e3519b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -1,10 +1,12 @@ [% INCLUDE 'doc-head-open.inc' %] Create Circulation rule [% INCLUDE 'installer-doc-head-close.inc' %] +[% INCLUDE 'validator-strings.inc' %] +[% INCLUDE 'installer-strings.inc' %] + + -
-

Koha Welcome to Koha

-
+ [% INCLUDE 'onboarding_messages.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/onboarding.js b/koha-tmpl/intranet-tmpl/prog/js/onboarding.js new file mode 100644 index 0000000..9b1d13d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/onboarding.js @@ -0,0 +1,150 @@ +function _(s) { return s; } // dummy function for gettext + +jQuery.validator.addMethod( "category_code_check", function(value,element){ + var patt = /^[A-Za-z]{0,10}$/g; + if (patt.test(element.value)) { + return true; + } else { + return false; + } + }, MSG_LETTERS_ONLY +); + +jQuery.validator.addMethod( "letters_only", function(value,element){ + var patt =/^[A-Za-z ]{0,30}$/g; + if (patt.test(element.value)){ + return true; + } else { + return false; + } + }, MSG_LETTERS_ONLY +); + +jQuery.validator.addMethod( "enrollment_period", function(){ + enrolmentperiod = $("#enrolmentperiod").val(); + enrolmentperioddate = $("#enrolmentperioddate").val(); + if (( $("#enrolmentperiod").val() === "" && $("#enrolmentperioddate").val() === "") || ($("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "")) { + return false; + } else { + return true; + } + }, MSG_ONLY_ONE_ENROLLMENTPERIOD +); + +jQuery.validator.addMethod( "password_match", function(value,element){ + var MSG_PASSWORD_MISMATCH = ( MSG_PASSWORD_MISMATCH ); + var password = document.getElementById('password').value; + var confirmpassword = document.getElementById('password2').value; + + if ( password != confirmpassword ){ + return false; + } + else{ + return true; + } + }, MSG_PASSWORD_MISMATCH +); + +jQuery.validator.addMethod( "cardnumber_check", function(value,element){ + var patt =/[A-Za-z1-9 ]+$/g; + if (patt.test(element.value)){ + return true; + } else { + return false; + } + }, MSG_LETTERS_NUMBERS_ONLY +); + +function toUC(f) { + var x=f.value.toUpperCase(); + f.value=x; + return true; +} + +$(document).ready(function() { + if ($("#branches option:selected").length < 1) { + $("#branches option:first").attr("selected", "selected"); + } + $("#categorycode").on("blur",function(){ + toUC(this); + }); + + $("#enrolmentperioddate").datepicker({ + minDate: 1 + }); // Require that "until date" be in the future + + $("#category_form").validate({ + rules: { + categorycode: { + required: true, + category_code_check: true + }, + description: { + required:true + }, + enrolmentperiod: { + required: function(element){ + return $("#enrolmentperioddate").val() === ""; + }, + digits: true, + enrollment_period: true, + }, + enrolmentperioddate: { + required: function(element){ + return $("#enrolmentperiod").val() === ""; + }, + enrollment_period: true, + // is_valid_date ($(#"enrolementperioddate").val()); + }, + dateofbirthrequired: { + digits: true + }, + upperagelimit: { + digits: true + }, + enrolmentfee: { + number: true + }, + reservefee: { + number: true + }, + category_type: { + required: true + } + }, + messages: { + enrolmentperiod: { + required: MSG_ONE_ENROLLMENTPERIOD + }, + enrolmentperioddate: { + required: MSG_ONE_ENROLLMENTPERIOD + } + } + }); + + $("#createpatron").validate({ + rules: { + surname: { + required: true + }, + firstname: { + required: true + }, + cardnumber: { + required: true + }, + password: { + password_match: true + } + }, + messages: { + password: { + required: MSG_PASSWORD_MISMATCH + }, + } + + }); + + $("#createitemform").validate(); + $("#createcirculationrule").validate(); +}); -- 2.1.4