@@ -, +, @@ 3 - 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. --- 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 --- a/koha-tmpl/intranet-tmpl/prog/css/installer.css +++ a/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; +} --- a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc @@ -2,92 +2,15 @@ - - - + - - - - - - - - --- a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-strings.inc @@ -0,0 +1,7 @@ + --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/auth.tt +++ a/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' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt +++ a/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.
-

+

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 %] +
-
-
-

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' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ a/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

- -
- -

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 :

+ + [% 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' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt +++ a/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

--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt +++ a/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

--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt +++ a/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' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ a/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' %] --- a/koha-tmpl/intranet-tmpl/prog/js/onboarding.js +++ a/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(); +}); --