Bugzilla – Attachment 59279 Details for
Bug 17855
New onboarding tool feature to guide users through setting up Koha, and minor web installer UI improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] bug 17855 - Updated web installer finished
SIGNED-OFF-bug-17855---Updated-web-installer-finis.patch (text/plain), 156.14 KB, created by
Mark Tompsett
on 2017-01-19 20:18:05 UTC
(
hide
)
Description:
[SIGNED-OFF] bug 17855 - Updated web installer finished
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-01-19 20:18:05 UTC
Size:
156.14 KB
patch
obsolete
>From 7be2dc4686aa398b866b7cdd6b14cc314b4b694e Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Wed, 7 Dec 2016 23:20:59 +0000 >Subject: [PATCH] [SIGNED-OFF] bug 17855 - Updated web installer finished > >The onboarding tool has been implemented and integrated with the updated >web installer. The onboarding tool has the following functionality: >* After the user has finished the web installer they are automatically >redirected to the onboarding tool with no authentication in between >required >* Ability to create library, patron category, patron (set with >superlibrarian priviliages), item type and circulation rule. >* If the uaser installed sample libraries, patron categories and/or item >types then the step to create one in the onboarding tool will be skipped >and a skipping message will be displayed. >*HTML regxes on all text input fields in all forms in the onboarding >tool this prevents the user from writing in special characters >*Working date picker on the patron category form > >Have moved all data values from mandatory to default. >Now all default data values are displayed with a bulletpoint rather than >a selectable checkbox stopping users from unticking neccisary data >values > >Test plan: >1. Go through the web installer and onboarding tool with the same steps >as outlined in this below guide and check that the functionality >outlined in the guide exists in the patch: >https://koha-community.org/manual/installation/html/ > > This is a combination of 67 commits. >Initial 3 HTML screens of the onboarding tool and >the perl onboarding.pl script > >Note: The advanced setup option has not yet been >implemented, so what you will see is just the basic setup. > >Altered web installer > >Moved files from optional to mandatory. Edited >MARC screen so that MARC21 is selected by default. > >Changed mandatory to default for MARC values > >Changed a few file name descriptions to reduce >spacing in installer step 3 screen. > >Changed the radiobuttons to bulletpoints for default settings > >removed = sign > >Fixed bug in installer where a loop was created if >you're database structure needed to be updated. >Redirected this to the marcflavour screen instead >of logging straight into Koha and skipping over >the basic configuration steps. > >Changed the bulletpoints to disabled checkboxes >which are checked by default > >Backup of step3.tt > >Successfully working insertion of the default >options which are shown as bulletpoints > >Removed test text > >Working insertion of default and optional options > >Correctly selected default marc flavour of marc21 > >NOTE: Mark Tompsett merged several commits > >- Removed html regex on patron password fields. Ran perltidy to >indent and space code appropriately. Ran git bz configuration >commands to remove whitespace. Removed unnecissary uses in >the summary.pl script > >- Made arrows in onboarding tool pages > -> for consistency. Additionally removed the 'OR' > >- Added the use CGI qw ( -utf8 ); > >- Removed the second path to creating a library, patron >category, patron, item type, and circulation rule. In onboarding >.tt files and summary.tt > >- Fixed typo in summary.tt > >- Made consistent single space before and after -> in all >onboarding .tt and summary.tt files. > >- Made single <br> tag before path to create library, patron >category, item type, and circulation rule in the onboarding >.tt files (patron does not need this as its layout is slightly >different) > >- Changed button and link names in web installer and onboarding >tool > >- Implemented Javascript password check to determine if the values >in the 'password' and 'confirm password' fields are consistent. > >If passwords are not consistent a message informing the user >is displayed and they only have to change the password values >rather than re-fill out the whole form. > >- Fixed the errors from the koha qa test > >- Removed use:C4/Auth from the onboarding.pl > >- Moved the "select all options" button down to just above >the selectable options in the basic setup, and positioned at >the top of the page for the advanced setup. > >- Removed the "there is nothing to do because the sample data >is already installed" page so if the user has install sample >data in the web installer then the step to create that object >in the onboarding tool is skipped altogether. > >- Removed the "We're just going to setup a few more things" >page > >- Changed the title of the 'Create patron page' > >- Added clarifying information to the "Add a patron category" >page > >- Added clarifying information to the "Create item type" page > >- Fixed the capitalization in the onboarding tool > >- Removed the BackupStep3.tt file which was un-used > >- Changed the redirect time displayed to user in step3.tt to 10 > >- Changed the cardnumber on the create patron administrator >page so that it is only populated when the user installed >sample patrons. Also changed the regex so that it allows >letters and number. > >- Used the HTMl validator to identify errors in the template >and have corrected all possible in the onboarding templates. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > .../mysql/en/{optional => default}/auth_val.sql | 0 > .../mysql/en/{optional => default}/auth_val.txt | 0 > .../en/{mandatory => default}/auth_values.sql | 0 > .../en/{mandatory => default}/auth_values.txt | 0 > .../en/{mandatory => default}/class_sources.sql | 6 +- > .../en/{mandatory => default}/class_sources.txt | 0 > .../en/{optional => default}/csv_profiles.sql | 2 +- > .../en/{optional => default}/csv_profiles.txt | 2 - > .../message_transport_types.sql | 0 > .../message_transport_types.txt | 1 - > .../mysql/en/{optional => default}/parameters.sql | 0 > .../mysql/en/{optional => default}/parameters.txt | 0 > .../{mandatory => default}/patron_attributes.sql | 0 > .../data/mysql/en/default/patron_attributes.txt | 1 + > .../{mandatory => default}/sample_frequencies.sql | 0 > .../{mandatory => default}/sample_frequencies.txt | 0 > .../en/{mandatory => default}/sample_notices.sql | 0 > .../en/{mandatory => default}/sample_notices.txt | 0 > .../sample_notices_message_attributes.sql | 1 - > .../sample_notices_message_attributes.txt | 0 > .../sample_notices_message_transports.sql | 0 > .../sample_notices_message_transports.txt | 0 > .../sample_numberpatterns.sql | 0 > .../sample_numberpatterns.txt | 0 > .../data/mysql/en/mandatory/patron_attributes.txt | 0 > .../authorities_normal_marc21.sql | 0 > .../marc21/default/authorities_normal_marc21.txt | 9 + > .../marc21_default_matching_rules.sql | 18 +- > .../marc21_default_matching_rules.txt | 5 +- > .../marc21_framework_DEFAULT.sql | 0 > .../marc21_framework_DEFAULT.txt | 0 > .../marc21_sample_fastadd_framework.sql | 0 > .../marc21_sample_fastadd_framework.txt | 0 > .../marc21_simple_bib_frameworks.sql | 0 > .../marc21_simple_bib_frameworks.txt | 1 - > .../marc21/mandatory/authorities_normal_marc21.txt | 11 - > .../authorities_normal_unimarc.sql | 2 - > .../unimarc/default/authorities_normal_unimarc.txt | 1 + > .../unimarc_framework_DEFAULT.sql | 10 +- > .../unimarc_framework_DEFAULT.txt | 0 > .../mandatory/authorities_normal_unimarc.txt | 1 - > .../data/mysql/en/optional/patron_categories.sql | 2 +- > .../data/mysql/en/optional/patron_categories.txt | 6 +- > .../data/mysql/en/optional/sample_holidays.txt | 5 +- > .../data/mysql/en/optional/sample_libraries.txt | 2 +- > .../mysql/en/optional/sample_z3950_servers.txt | 1 + > installer/install.pl | 363 ++++++----- > installer/onboarding.pl | 683 +++++++++++++++++++++ > .../intranet-tmpl/prog/en/includes/calendar.inc | 2 +- > .../intranet-tmpl/prog/en/includes/header.inc | 2 + > .../prog/en/includes/installer-doc-head-close.inc | 15 + > .../prog/en/modules/admin/categories.tt | 2 +- > .../prog/en/modules/installer/step3.tt | 303 +++++---- > .../intranet-tmpl/prog/en/modules/intranet-main.tt | 2 - > .../prog/en/modules/onboarding/onboardingstep1.tt | 81 +++ > .../prog/en/modules/onboarding/onboardingstep2.tt | 405 ++++++++++++ > .../prog/en/modules/onboarding/onboardingstep3.tt | 241 ++++++++ > .../prog/en/modules/onboarding/onboardingstep4.tt | 67 ++ > .../prog/en/modules/onboarding/onboardingstep5.tt | 127 ++++ > koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt | 41 ++ > summary.pl | 43 ++ > 61 files changed, 2137 insertions(+), 327 deletions(-) > rename installer/data/mysql/en/{optional => default}/auth_val.sql (100%) > rename installer/data/mysql/en/{optional => default}/auth_val.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/auth_values.sql (100%) > rename installer/data/mysql/en/{mandatory => default}/auth_values.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/class_sources.sql (99%) > rename installer/data/mysql/en/{mandatory => default}/class_sources.txt (100%) > rename installer/data/mysql/en/{optional => default}/csv_profiles.sql (91%) > rename installer/data/mysql/en/{optional => default}/csv_profiles.txt (83%) > rename installer/data/mysql/en/{mandatory => default}/message_transport_types.sql (100%) > rename installer/data/mysql/en/{mandatory => default}/message_transport_types.txt (98%) > rename installer/data/mysql/en/{optional => default}/parameters.sql (100%) > rename installer/data/mysql/en/{optional => default}/parameters.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/patron_attributes.sql (100%) > create mode 100644 installer/data/mysql/en/default/patron_attributes.txt > rename installer/data/mysql/en/{mandatory => default}/sample_frequencies.sql (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_frequencies.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_notices.sql (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_notices.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_notices_message_attributes.sql (99%) > rename installer/data/mysql/en/{mandatory => default}/sample_notices_message_attributes.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_notices_message_transports.sql (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_notices_message_transports.txt (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_numberpatterns.sql (100%) > rename installer/data/mysql/en/{mandatory => default}/sample_numberpatterns.txt (100%) > delete mode 100644 installer/data/mysql/en/mandatory/patron_attributes.txt > rename installer/data/mysql/en/marcflavour/marc21/{mandatory => default}/authorities_normal_marc21.sql (100%) > create mode 100644 installer/data/mysql/en/marcflavour/marc21/default/authorities_normal_marc21.txt > rename installer/data/mysql/en/marcflavour/marc21/{optional => default}/marc21_default_matching_rules.sql (96%) > rename installer/data/mysql/en/marcflavour/marc21/{optional => default}/marc21_default_matching_rules.txt (61%) > rename installer/data/mysql/en/marcflavour/marc21/{mandatory => default}/marc21_framework_DEFAULT.sql (100%) > rename installer/data/mysql/en/marcflavour/marc21/{mandatory => default}/marc21_framework_DEFAULT.txt (100%) > rename installer/data/mysql/en/marcflavour/marc21/{optional => default}/marc21_sample_fastadd_framework.sql (100%) > rename installer/data/mysql/en/marcflavour/marc21/{optional => default}/marc21_sample_fastadd_framework.txt (100%) > rename installer/data/mysql/en/marcflavour/marc21/{optional => default}/marc21_simple_bib_frameworks.sql (100%) > rename installer/data/mysql/en/marcflavour/marc21/{optional => default}/marc21_simple_bib_frameworks.txt (99%) > delete mode 100644 installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.txt > rename installer/data/mysql/en/marcflavour/unimarc/{mandatory => default}/authorities_normal_unimarc.sql (99%) > create mode 100644 installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.txt > rename installer/data/mysql/en/marcflavour/unimarc/{mandatory => default}/unimarc_framework_DEFAULT.sql (99%) > rename installer/data/mysql/en/marcflavour/unimarc/{mandatory => default}/unimarc_framework_DEFAULT.txt (100%) > delete mode 100644 installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.txt > create mode 100755 installer/onboarding.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt > create mode 100755 summary.pl > >diff --git a/installer/data/mysql/en/optional/auth_val.sql b/installer/data/mysql/en/default/auth_val.sql >similarity index 100% >rename from installer/data/mysql/en/optional/auth_val.sql >rename to installer/data/mysql/en/default/auth_val.sql >diff --git a/installer/data/mysql/en/optional/auth_val.txt b/installer/data/mysql/en/default/auth_val.txt >similarity index 100% >rename from installer/data/mysql/en/optional/auth_val.txt >rename to installer/data/mysql/en/default/auth_val.txt >diff --git a/installer/data/mysql/en/mandatory/auth_values.sql b/installer/data/mysql/en/default/auth_values.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/auth_values.sql >rename to installer/data/mysql/en/default/auth_values.sql >diff --git a/installer/data/mysql/en/mandatory/auth_values.txt b/installer/data/mysql/en/default/auth_values.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/auth_values.txt >rename to installer/data/mysql/en/default/auth_values.txt >diff --git a/installer/data/mysql/en/mandatory/class_sources.sql b/installer/data/mysql/en/default/class_sources.sql >similarity index 99% >rename from installer/data/mysql/en/mandatory/class_sources.sql >rename to installer/data/mysql/en/default/class_sources.sql >index 589ea7a..bad1ad4 100644 >--- a/installer/data/mysql/en/mandatory/class_sources.sql >+++ b/installer/data/mysql/en/default/class_sources.sql >@@ -1,4 +1,4 @@ >--- >+-- > -- Default classification sources and filing rules > -- for Koha. > -- >@@ -10,11 +10,11 @@ > -- terms of the GNU General Public License as published by the Free Software > -- Foundation; either version 2 of the License, or (at your option) any later > -- version. >--- >+-- > -- Koha is distributed in the hope that it will be useful, but WITHOUT ANY > -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR > -- A PARTICULAR PURPOSE. See the GNU General Public License for more details. >--- >+-- > -- You should have received a copy of the GNU General Public License along > -- with Koha; if not, write to the Free Software Foundation, Inc., > -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >diff --git a/installer/data/mysql/en/mandatory/class_sources.txt b/installer/data/mysql/en/default/class_sources.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/class_sources.txt >rename to installer/data/mysql/en/default/class_sources.txt >diff --git a/installer/data/mysql/en/optional/csv_profiles.sql b/installer/data/mysql/en/default/csv_profiles.sql >similarity index 91% >rename from installer/data/mysql/en/optional/csv_profiles.sql >rename to installer/data/mysql/en/default/csv_profiles.sql >index ebf599c..f7c5e22 100644 >--- a/installer/data/mysql/en/optional/csv_profiles.sql >+++ b/installer/data/mysql/en/default/csv_profiles.sql >@@ -1,2 +1,2 @@ >-INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type ) >+INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type ) > VALUES ( "issues to claim", "default CSV export for serial issue claims", "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate", ",", "sql" ); >diff --git a/installer/data/mysql/en/optional/csv_profiles.txt b/installer/data/mysql/en/default/csv_profiles.txt >similarity index 83% >rename from installer/data/mysql/en/optional/csv_profiles.txt >rename to installer/data/mysql/en/default/csv_profiles.txt >index 9dcff5d..2bca64f 100644 >--- a/installer/data/mysql/en/optional/csv_profiles.txt >+++ b/installer/data/mysql/en/default/csv_profiles.txt >@@ -1,3 +1 @@ >-CSV profiles >- > Default CSV export profiles; including one for exporting serial claims. >diff --git a/installer/data/mysql/en/mandatory/message_transport_types.sql b/installer/data/mysql/en/default/message_transport_types.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/message_transport_types.sql >rename to installer/data/mysql/en/default/message_transport_types.sql >diff --git a/installer/data/mysql/en/mandatory/message_transport_types.txt b/installer/data/mysql/en/default/message_transport_types.txt >similarity index 98% >rename from installer/data/mysql/en/mandatory/message_transport_types.txt >rename to installer/data/mysql/en/default/message_transport_types.txt >index 054d914..9665f67 100644 >--- a/installer/data/mysql/en/mandatory/message_transport_types.txt >+++ b/installer/data/mysql/en/default/message_transport_types.txt >@@ -1,2 +1 @@ > Defines default message transports for email and sms. >- >diff --git a/installer/data/mysql/en/optional/parameters.sql b/installer/data/mysql/en/default/parameters.sql >similarity index 100% >rename from installer/data/mysql/en/optional/parameters.sql >rename to installer/data/mysql/en/default/parameters.sql >diff --git a/installer/data/mysql/en/optional/parameters.txt b/installer/data/mysql/en/default/parameters.txt >similarity index 100% >rename from installer/data/mysql/en/optional/parameters.txt >rename to installer/data/mysql/en/default/parameters.txt >diff --git a/installer/data/mysql/en/mandatory/patron_attributes.sql b/installer/data/mysql/en/default/patron_attributes.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/patron_attributes.sql >rename to installer/data/mysql/en/default/patron_attributes.sql >diff --git a/installer/data/mysql/en/default/patron_attributes.txt b/installer/data/mysql/en/default/patron_attributes.txt >new file mode 100644 >index 0000000..fa912e3 >--- /dev/null >+++ b/installer/data/mysql/en/default/patron_attributes.txt >@@ -0,0 +1 @@ >+Patron attributes >diff --git a/installer/data/mysql/en/mandatory/sample_frequencies.sql b/installer/data/mysql/en/default/sample_frequencies.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_frequencies.sql >rename to installer/data/mysql/en/default/sample_frequencies.sql >diff --git a/installer/data/mysql/en/mandatory/sample_frequencies.txt b/installer/data/mysql/en/default/sample_frequencies.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_frequencies.txt >rename to installer/data/mysql/en/default/sample_frequencies.txt >diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/default/sample_notices.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_notices.sql >rename to installer/data/mysql/en/default/sample_notices.sql >diff --git a/installer/data/mysql/en/mandatory/sample_notices.txt b/installer/data/mysql/en/default/sample_notices.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_notices.txt >rename to installer/data/mysql/en/default/sample_notices.txt >diff --git a/installer/data/mysql/en/mandatory/sample_notices_message_attributes.sql b/installer/data/mysql/en/default/sample_notices_message_attributes.sql >similarity index 99% >rename from installer/data/mysql/en/mandatory/sample_notices_message_attributes.sql >rename to installer/data/mysql/en/default/sample_notices_message_attributes.sql >index a7a6032..8499d3d 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices_message_attributes.sql >+++ b/installer/data/mysql/en/default/sample_notices_message_attributes.sql >@@ -6,4 +6,3 @@ values > (4, 'Hold_Filled', 0), > (5, 'Item_Check_in', 0), > (6, 'Item_Checkout', 0); >- >diff --git a/installer/data/mysql/en/mandatory/sample_notices_message_attributes.txt b/installer/data/mysql/en/default/sample_notices_message_attributes.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_notices_message_attributes.txt >rename to installer/data/mysql/en/default/sample_notices_message_attributes.txt >diff --git a/installer/data/mysql/en/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/en/default/sample_notices_message_transports.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_notices_message_transports.sql >rename to installer/data/mysql/en/default/sample_notices_message_transports.sql >diff --git a/installer/data/mysql/en/mandatory/sample_notices_message_transports.txt b/installer/data/mysql/en/default/sample_notices_message_transports.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_notices_message_transports.txt >rename to installer/data/mysql/en/default/sample_notices_message_transports.txt >diff --git a/installer/data/mysql/en/mandatory/sample_numberpatterns.sql b/installer/data/mysql/en/default/sample_numberpatterns.sql >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_numberpatterns.sql >rename to installer/data/mysql/en/default/sample_numberpatterns.sql >diff --git a/installer/data/mysql/en/mandatory/sample_numberpatterns.txt b/installer/data/mysql/en/default/sample_numberpatterns.txt >similarity index 100% >rename from installer/data/mysql/en/mandatory/sample_numberpatterns.txt >rename to installer/data/mysql/en/default/sample_numberpatterns.txt >diff --git a/installer/data/mysql/en/mandatory/patron_attributes.txt b/installer/data/mysql/en/mandatory/patron_attributes.txt >deleted file mode 100644 >index e69de29..0000000 >diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql b/installer/data/mysql/en/marcflavour/marc21/default/authorities_normal_marc21.sql >similarity index 100% >rename from installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql >rename to installer/data/mysql/en/marcflavour/marc21/default/authorities_normal_marc21.sql >diff --git a/installer/data/mysql/en/marcflavour/marc21/default/authorities_normal_marc21.txt b/installer/data/mysql/en/marcflavour/marc21/default/authorities_normal_marc21.txt >new file mode 100644 >index 0000000..076918f >--- /dev/null >+++ b/installer/data/mysql/en/marcflavour/marc21/default/authorities_normal_marc21.txt >@@ -0,0 +1,9 @@ >+Default MARC21 Standard Authority types: >+ Personal Name >+ Corporate Name >+ Meeting Name >+ Uniform Title >+ Chronological Term >+ Topical Term >+ Geographic Name >+ Genre/Form Term >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql b/installer/data/mysql/en/marcflavour/marc21/default/marc21_default_matching_rules.sql >similarity index 96% >rename from installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_default_matching_rules.sql >index 2e538a4..5192044 100644 >--- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql >+++ b/installer/data/mysql/en/marcflavour/marc21/default/marc21_default_matching_rules.sql >@@ -1,4 +1,4 @@ >--- >+-- > -- Default MARC matching rules for Koha > -- > -- Copyright (C) 2007 LiblimeA >@@ -9,31 +9,31 @@ > -- terms of the GNU General Public License as published by the Free Software > -- Foundation; either version 2 of the License, or (at your option) any later > -- version. >--- >+-- > -- Koha is distributed in the hope that it will be useful, but WITHOUT ANY > -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR > -- A PARTICULAR PURPOSE. See the GNU General Public License for more details. >--- >+-- > -- You should have received a copy of the GNU General Public License along > -- with Koha; if not, write to the Free Software Foundation, Inc., > -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-INSERT INTO marc_matchers (code, description, record_type, threshold) >+INSERT INTO marc_matchers (code, description, record_type, threshold) > VALUES ('ISBN', '020$a', 'biblio', 1000); > INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers; > INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints; >-INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >+INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) > SELECT MAX(matchpoint_id), 1, '020', 'a' FROM matchpoints; >-INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >+INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) > SELECT MAX(matchpoint_component_id), 1, 'ISBN' FROM matchpoint_components; > >-INSERT INTO marc_matchers (code, description, record_type, threshold) >+INSERT INTO marc_matchers (code, description, record_type, threshold) > VALUES ('ISSN', '022$a', 'biblio', 1000); > INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers; > INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints; >-INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >+INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) > SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints; >-INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >+INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) > SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components; > > INSERT INTO marc_matchers (code, description, record_type, threshold) >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt b/installer/data/mysql/en/marcflavour/marc21/default/marc21_default_matching_rules.txt >similarity index 61% >rename from installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_default_matching_rules.txt >index 471db24..7cbd6f4 100644 >--- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt >+++ b/installer/data/mysql/en/marcflavour/marc21/default/marc21_default_matching_rules.txt >@@ -1,5 +1,2 @@ > Selected matching rules for MARC 21 bibliographic >-records, including: >- >-ISBN >-ISSN >+records, including: ISBN, ISSN >diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/marc21/default/marc21_framework_DEFAULT.sql >similarity index 100% >rename from installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_framework_DEFAULT.sql >diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.txt b/installer/data/mysql/en/marcflavour/marc21/default/marc21_framework_DEFAULT.txt >similarity index 100% >rename from installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.txt >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_framework_DEFAULT.txt >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/en/marcflavour/marc21/default/marc21_sample_fastadd_framework.sql >similarity index 100% >rename from installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_sample_fastadd_framework.sql >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.txt b/installer/data/mysql/en/marcflavour/marc21/default/marc21_sample_fastadd_framework.txt >similarity index 100% >rename from installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.txt >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_sample_fastadd_framework.txt >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/en/marcflavour/marc21/default/marc21_simple_bib_frameworks.sql >similarity index 100% >rename from installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_simple_bib_frameworks.sql >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt b/installer/data/mysql/en/marcflavour/marc21/default/marc21_simple_bib_frameworks.txt >similarity index 99% >rename from installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt >rename to installer/data/mysql/en/marcflavour/marc21/default/marc21_simple_bib_frameworks.txt >index cf49dc3..7bfd5d6 100644 >--- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt >+++ b/installer/data/mysql/en/marcflavour/marc21/default/marc21_simple_bib_frameworks.txt >@@ -1,5 +1,4 @@ > Simple MARC 21 bibliographic frameworks for some common types of bibliographic material. Frameworks are used to define the structure of your MARC records and the behavior of the integrated MARC editor. You can change these at any time after installation. The frameworks in this optional default setting include: >- > BKS Books, Booklets, Workbooks > CF CD-ROMs, DVD-ROMs, General Online Resources > SR Audio Cassettes, CDs >diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.txt b/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.txt >deleted file mode 100644 >index b14f98b..0000000 >--- a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.txt >+++ /dev/null >@@ -1,11 +0,0 @@ >-Default MARC21 Standard Authority types: >- >- Personal Name >- Corporate Name >- Meeting Name >- Uniform Title >- Chronological Term >- Topical Term >- Geographic Name >- Genre/Form Term >- >diff --git a/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql b/installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.sql >similarity index 99% >rename from installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql >rename to installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.sql >index 52267c7..c9f5456 100644 >--- a/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql >+++ b/installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.sql >@@ -819,5 +819,3 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` > ('', '886', '2', 'System Code', 'System Code', 0, 0, 8, '', '', '', 0, -5, 0, '', ''), > ('', '886', 'a', 'Tag of the Source Format Field', 'Tag of the Source Format Field', 1, 0, 8, '', '', '', 0, -5, 0, '', ''), > ('', '886', 'b', 'Indicators and Subfields of the Source Format Field', 'Indicators and Subfields of the Source Format Field', 1, 0, 8, '', '', '', 0, -5, 0, '', ''); >- >- >diff --git a/installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.txt b/installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.txt >new file mode 100644 >index 0000000..202a9cc >--- /dev/null >+++ b/installer/data/mysql/en/marcflavour/unimarc/default/authorities_normal_unimarc.txt >@@ -0,0 +1 @@ >+ Authority structure for UNIMARC in English. >diff --git a/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/unimarc/default/unimarc_framework_DEFAULT.sql >similarity index 99% >rename from installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql >rename to installer/data/mysql/en/marcflavour/unimarc/default/unimarc_framework_DEFAULT.sql >index 94ccaa9..0d65c11 100644 >--- a/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql >+++ b/installer/data/mysql/en/marcflavour/unimarc/default/unimarc_framework_DEFAULT.sql >@@ -23,7 +23,7 @@ > > -- From Zeno Tajoli (2010-08-12): > -- >--- Improved default id Koha field (090) and koha date field (099). >+-- Improved default id Koha field (090) and koha date field (099). > -- Insert link to sql coloum biblio.biblionumber in tag 001 > -- Insert the use of 942, local data > -- Insert a standard minimun on 995 (holding field) >@@ -72,7 +72,7 @@ > insert into `marc_tag_structure`(`tagfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`authorised_value`,`frameworkcode`) values > ('090','System Control Numbers (Koha)','System Control Numbers (Koha)',0,0,'',''); > >-insert into `marc_subfield_structure`(`tagfield`,`tagsubfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`kohafield`,`tab`,`authorised_value`,`authtypecode`,`value_builder`,`isurl`,`hidden`,`frameworkcode`,`seealso`,`link`,`defaultvalue`) values >+insert into `marc_subfield_structure`(`tagfield`,`tagsubfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`kohafield`,`tab`,`authorised_value`,`authtypecode`,`value_builder`,`isurl`,`hidden`,`frameworkcode`,`seealso`,`link`,`defaultvalue`) values > ('090','a','Koha biblioitem number (autogenerated)','Koha biblioitem number (autogenerated)',0,0,'biblioitems.biblioitemnumber',9,'','','',0,-5,'',NULL,'',''); > > -- Local date field/Subfields (099) >@@ -80,9 +80,9 @@ insert into `marc_subfield_structure`(`tagfield`,`tagsubfield`,`liblibrarian`,` > insert into `marc_tag_structure`(`tagfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`authorised_value`,`frameworkcode`) values > ('099','local dates','',0,0,'',''); > >-insert into `marc_subfield_structure`(`tagfield`,`tagsubfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`kohafield`,`tab`,`authorised_value`,`authtypecode`,`value_builder`,`isurl`,`hidden`,`frameworkcode`,`seealso`,`link`,`defaultvalue`) values >+insert into `marc_subfield_structure`(`tagfield`,`tagsubfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`kohafield`,`tab`,`authorised_value`,`authtypecode`,`value_builder`,`isurl`,`hidden`,`frameworkcode`,`seealso`,`link`,`defaultvalue`) values > ('099','c','Date of creation (bib. record)','Date of creation (bib. record)',0,0,'biblio.datecreated',0,'','','',0,-5,'',NULL,'',''); >- >+ > insert into `marc_subfield_structure`(`tagfield`,`tagsubfield`,`liblibrarian`,`libopac`,`repeatable`,`mandatory`,`kohafield`,`tab`,`authorised_value`,`authtypecode`,`value_builder`,`isurl`,`hidden`,`frameworkcode`,`seealso`,`link`,`defaultvalue`) values > ('099','d','Last modified date (bib. record)','Last modified data (bib. record)',0,0,'biblio.timestamp',0,'','','',0,-5,'',NULL,'',''); > >@@ -151,7 +151,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` > ('995', 'r', 'Type of item and material', 'Type of item and material', 0, 1, 'items.itype', 10, 'itemtypes', '', '', 0, 0, '', '', '', NULL), > ('995', 'u', 'Copy note', 'Copy note', 0, 0, 'items.itemnotes', 10, '', '', '', 0, 0, '', '', '', NULL), > ('995', 'v', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, -1, '', '', '', NULL); >- >+ > > > -- ******************************************************* >diff --git a/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.txt b/installer/data/mysql/en/marcflavour/unimarc/default/unimarc_framework_DEFAULT.txt >similarity index 100% >rename from installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.txt >rename to installer/data/mysql/en/marcflavour/unimarc/default/unimarc_framework_DEFAULT.txt >diff --git a/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.txt b/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.txt >deleted file mode 100644 >index 6fba0ac..0000000 >--- a/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.txt >+++ /dev/null >@@ -1 +0,0 @@ >-Authority structure for UNIMARC in English. >diff --git a/installer/data/mysql/en/optional/patron_categories.sql b/installer/data/mysql/en/optional/patron_categories.sql >index 56439b4..57a00da 100644 >--- a/installer/data/mysql/en/optional/patron_categories.sql >+++ b/installer/data/mysql/en/optional/patron_categories.sql >@@ -1,4 +1,4 @@ >-INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`) VALUES >+INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`) VALUES > > -- Adult Patrons > ('PT','Patron',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A'), >diff --git a/installer/data/mysql/en/optional/patron_categories.txt b/installer/data/mysql/en/optional/patron_categories.txt >index b94941a..45102b3 100644 >--- a/installer/data/mysql/en/optional/patron_categories.txt >+++ b/installer/data/mysql/en/optional/patron_categories.txt >@@ -1,6 +1,4 @@ >-Sample patron types and categories: >- >-Type: Categories: >+Sample patron types and categories. Types are currently hardcoded but you can manage categories after installation from the administration module. > > Adult patron - default patron type > PT - Patron >@@ -21,5 +19,3 @@ Professional - a member of an organization (organization is guarantor) > T - Teacher > S - Staff > B - Board >- >-Types are currently hardcoded, but you can add/edit/delete categories after installation from the administration module. >diff --git a/installer/data/mysql/en/optional/sample_holidays.txt b/installer/data/mysql/en/optional/sample_holidays.txt >index a2d2de9..2f478e1 100644 >--- a/installer/data/mysql/en/optional/sample_holidays.txt >+++ b/installer/data/mysql/en/optional/sample_holidays.txt >@@ -1,4 +1 @@ >-Sample holidays: >- Sundays >- Christmas >- New Year's >+Sample holidays: Sunday, Christmas, New Year's >diff --git a/installer/data/mysql/en/optional/sample_libraries.txt b/installer/data/mysql/en/optional/sample_libraries.txt >index cbaf05c..2a1bd9a 100644 >--- a/installer/data/mysql/en/optional/sample_libraries.txt >+++ b/installer/data/mysql/en/optional/sample_libraries.txt >@@ -1 +1 @@ >-A few sample libraries. >+Sample libraries. >diff --git a/installer/data/mysql/en/optional/sample_z3950_servers.txt b/installer/data/mysql/en/optional/sample_z3950_servers.txt >index a0bab98..b7a48c0 100644 >--- a/installer/data/mysql/en/optional/sample_z3950_servers.txt >+++ b/installer/data/mysql/en/optional/sample_z3950_servers.txt >@@ -1,3 +1,4 @@ >+Allow access to the following servers to search and download record information: > LIBRARY OF CONGRESS > LIBRARY OF CONGRESS NAMES (authority records) > LIBRARY OF CONGRESS SUBJECTS (authority records) >diff --git a/installer/install.pl b/installer/install.pl >index 512ca3c..248bf04 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -1,5 +1,22 @@ > #!/usr/bin/perl > >+# This file is part of Koha. >+# >+# Copyright (C) YEAR YOURNAME-OR-YOUREMPLOYER >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use strict; > use warnings; > use diagnostics; >@@ -40,10 +57,11 @@ if ( defined($language) ) { > my $installer = C4::Installer->new(); > my %info; > $info{'dbname'} = C4::Context->config("database"); >-$info{'dbms'} = >- ( C4::Context->config("db_scheme") >+$info{'dbms'} = ( >+ C4::Context->config("db_scheme") > ? C4::Context->config("db_scheme") >- : "mysql" ); >+ : "mysql" >+); > $info{'hostname'} = C4::Context->config("hostname"); > $info{'port'} = C4::Context->config("port"); > $info{'user'} = C4::Context->config("user"); >@@ -55,12 +73,14 @@ my $dbh = DBI->connect( > ); > > if ( $step && $step == 1 ) { >+ > #First Step (for both fresh installations and upgrades) > #Checking ALL perl Modules and services needed are installed. > #Whenever there is an error, adding a report to the page > my $op = $query->param('op') || 'noop'; >- $template->param( language => 1 ); >- $template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are >+ $template->param( language => 1 ); >+ $template->param( 'checkmodule' => 1 ) >+ ; # we start with the assumption that there are no problems and set this to 0 if there are > > unless ( $] >= 5.010000 ) { # Bug 7375 > $template->param( problems => 1, perlversion => 1, checkmodule => 0 ); >@@ -70,11 +90,11 @@ if ( $step && $step == 1 ) { > $perl_modules->version_info; > > my $modules = $perl_modules->get_attr('missing_pm'); >- if (scalar(@$modules)) { >- my @components = (); >+ if ( scalar(@$modules) ) { >+ my @components = (); > my $checkmodule = 1; > foreach (@$modules) { >- my ($module, $stats) = each %$_; >+ my ( $module, $stats ) = each %$_; > $checkmodule = 0 if $stats->{'required'}; > push( > @components, >@@ -86,14 +106,18 @@ if ( $step && $step == 1 ) { > } > ); > } >- @components = sort {$a->{'name'} cmp $b->{'name'}} @components; >- $template->param( missing_modules => \@components, checkmodule => $checkmodule, op => $op ); >+ @components = sort { $a->{'name'} cmp $b->{'name'} } @components; >+ $template->param( >+ missing_modules => \@components, >+ checkmodule => $checkmodule, >+ op => $op >+ ); > } > } > elsif ( $step && $step == 2 ) { >-# >-#STEP 2 Check Database connection and access >-# >+ >+ #STEP 2 Check Database connection and access >+ > $template->param(%info); > my $checkdb = $query->param("checkdb"); > $template->param( 'dbconnection' => $checkdb ); >@@ -118,7 +142,9 @@ elsif ( $step && $step == 2 ) { > my $grantaccess; > while ( my ($line) = $rq->fetchrow ) { > my $dbname = $info{dbname}; >- if ( $line =~ m/^GRANT (.*?) ON `$dbname`\.\*/ || index( $line, '*.*' ) > 0 ) { >+ if ( $line =~ m/^GRANT (.*?) ON `$dbname`\.\*/ >+ || index( $line, '*.*' ) > 0 ) >+ { > $grantaccess = 1 > if ( > index( $line, 'ALL PRIVILEGES' ) > 0 >@@ -153,23 +179,28 @@ elsif ( $step && $step == 2 ) { > } > } > $template->param( "checkgrantaccess" => $grantaccess ); >- } # End mysql connect check... >- >- elsif ( $info{dbms} eq "Pg" ) { >- # Check if database has been created... >- my $rv = $dbh->do( "SELECT * FROM pg_catalog.pg_database WHERE datname = \'$info{dbname}\';" ); >- if ( $rv == 1 ) { >- $template->param( 'checkdatabasecreated' => 1 ); >- } >- >- # Check if user has all necessary grants on this database... >- my $rq = $dbh->do( "SELECT u.usesuper >- FROM pg_catalog.pg_user as u >- WHERE u.usename = \'$info{user}\';" ); >- if ( $rq == 1 ) { >- $template->param( "checkgrantaccess" => 1 ); >- } >- } # End Pg connect check... >+ } # End mysql connect check... >+ >+ elsif ( $info{dbms} eq "Pg" ) { >+ >+ # Check if database has been created... >+ my $rv = $dbh->do( >+"SELECT * FROM pg_catalog.pg_database WHERE datname = \'$info{dbname}\';" >+ ); >+ if ( $rv == 1 ) { >+ $template->param( 'checkdatabasecreated' => 1 ); >+ } >+ >+ # Check if user has all necessary grants on this database... >+ my $rq = $dbh->do( >+ "SELECT u.usesuper >+ FROM pg_catalog.pg_user as u >+ WHERE u.usename = \'$info{user}\';" >+ ); >+ if ( $rq == 1 ) { >+ $template->param( "checkgrantaccess" => 1 ); >+ } >+ } # End Pg connect check... > } > else { > $template->param( "error" => DBI::err, "message" => DBI::errstr ); >@@ -177,11 +208,9 @@ elsif ( $step && $step == 2 ) { > } > } > elsif ( $step && $step == 3 ) { >-# >-# >-# STEP 3 : database setup >-# >-# >+ >+ # STEP 3 : database setup >+ > my $op = $query->param('op'); > if ( $op && $op eq 'finished' ) { > # >@@ -193,18 +222,20 @@ elsif ( $step && $step == 3 ) { > elsif ( $op && $op eq 'finish' ) { > $installer->set_version_syspref(); > >- # Installation is finished. >- # We just deny anybody access to install >- # And we redirect people to mainpage. >- # The installer will have to relogin since we do not pass cookie to redirection. >+# Installation is finished. >+# We just deny anybody access to install >+# And we redirect people to mainpage. >+# The installer will have to relogin since we do not pass cookie to redirection. > $template->param( "$op" => 1 ); > } >+ > elsif ( $op && $op eq 'addframeworks' ) { >- # >- # 1ST install, 3rd sub-step : insert the SQL files the user has selected >- # > >- my ($fwk_language, $list) = $installer->load_sql_in_order($all_languages, $query->param('framework')); >+ # 1ST install, 3rd sub-step : insert the SQL files the user has selected >+ >+ my ( $fwk_language, $list ) = >+ $installer->load_sql_in_order( $all_languages, >+ $query->param('framework') ); > $template->param( > "fwklanguage" => $fwk_language, > "list" => $list >@@ -214,42 +245,50 @@ elsif ( $step && $step == 3 ) { > $template->param( "$op" => 1 ); > } > elsif ( $op && $op eq 'selectframeworks' ) { >- # >- # >- # 1ST install, 2nd sub-step : show the user the sql datas he can insert in the database. >- # >- # >- # (note that the term "selectframeworks is not correct. The user can select various files, not only frameworks) >- >- #Framework Selection >- #sql data for import are supposed to be located in installer/data/<language>/<level> >- # Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.) >- # Where <level> is a category of requirement : required, recommended optional >- # level should contain : >- # SQL File for import With a readable name. >- # txt File that explains what this SQL File is meant for. >- # Could be VERY useful to have A Big file for a kind of library. >- # But could also be useful to have some Authorised values data set prepared here. >- # Framework Selection is achieved through checking boxes. >+# >+# >+# 1ST install, 2nd sub-step : show the user the sql datas he can insert in the database. >+# >+# >+# (note that the term "selectframeworks is not correct. The user can select various files, not only frameworks) >+ >+#Framework Selection >+#sql data for import are supposed to be located in installer/data/<language>/<level> >+# Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.) >+# Where <level> is a category of requirement : required, recommended optional >+# level should contain : >+# SQL File for import With a readable name. >+# txt File that explains what this SQL File is meant for. >+# Could be VERY useful to have A Big file for a kind of library. >+# But could also be useful to have some Authorised values data set prepared here. >+# Framework Selection is achieved through checking boxes. > my $langchoice = $query->param('fwklanguage'); > $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); >- $langchoice =~ s/[^a-zA-Z_-]*//g; >+ $langchoice =~ s/[^a-zA-Z_-]*//g; > my $marcflavour = $query->param('marcflavour'); >- if ($marcflavour){ >+ if ($marcflavour) { > $installer->set_marcflavour_syspref($marcflavour); >- }; >- $marcflavour = C4::Context->preference('marcflavour') unless ($marcflavour); >+ } >+ $marcflavour = C4::Context->preference('marcflavour') >+ unless ($marcflavour); >+ > #Insert into database the selected marcflavour > undef $/; >- my ($marc_defaulted_to_en, $fwklist) = $installer->marc_framework_sql_list($langchoice, $marcflavour); >- $template->param('en_marc_frameworks' => $marc_defaulted_to_en); >- $template->param( "frameworksloop" => $fwklist ); >- $template->param( "marcflavour" => ucfirst($marcflavour)); >- >- my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice); >- $template->param( "en_sample_data" => $sample_defaulted_to_en); >- $template->param( "levelloop" => $levellist ); >- $template->param( "$op" => 1 ); >+ my ( $marc_defaulted_to_en, $fwklist ) = >+ $installer->marc_framework_sql_list( $langchoice, $marcflavour ); >+ $template->param( 'en_marc_frameworks' => $marc_defaulted_to_en ); >+ $template->param( "frameworksloop" => $fwklist ); >+ $template->param( "marcflavour" => ucfirst($marcflavour) ); >+ >+ my ( $sample_defaulted_to_en, $levellist ) = >+ $installer->sample_data_sql_list($langchoice); >+ $template->param( "en_sample_data" => $sample_defaulted_to_en ); >+ $template->param( "levelloop" => $levellist ); >+ $template->param( "$op" => 1 ); >+ >+ my $setup = $query->param('setup'); >+ $template->param( "setup" => $setup ); >+ > } > elsif ( $op && $op eq 'choosemarc' ) { > # >@@ -258,46 +297,55 @@ elsif ( $step && $step == 3 ) { > # > # > >- #Choose Marc Flavour >- #sql data are supposed to be located in installer/data/<dbms>/<language>/marcflavour/marcflavourname >- # Where <dbms> is database type according to DBD syntax >- # Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.) >- # Where <level> is a category of requirement : required, recommended optional >- # level should contain : >- # SQL File for import With a readable name. >- # txt File taht explains what this SQL File is meant for. >- # Could be VERY useful to have A Big file for a kind of library. >- # But could also be useful to have some Authorised values data set prepared here. >- # Marcflavour Selection is achieved through radiobuttons. >+#Choose Marc Flavour >+#sql data are supposed to be located in installer/data/<dbms>/<language>/marcflavour/marcflavourname >+# Where <dbms> is database type according to DBD syntax >+# Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.) >+# Where <level> is a category of requirement : required, recommended optional >+# level should contain : >+# SQL File for import With a readable name. >+# txt File taht explains what this SQL File is meant for. >+# Could be VERY useful to have A Big file for a kind of library. >+# But could also be useful to have some Authorised values data set prepared here. >+# Marcflavour Selection is achieved through radiobuttons. > my $langchoice = $query->param('fwklanguage'); >+ > $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); >- $langchoice =~ s/[^a-zA-Z_-]*//g; >+ $langchoice =~ s/[^a-zA-Z_-]*//g; > my $dir = >- C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/$langchoice/marcflavour"; >- unless (opendir( MYDIR, $dir )) { >- if ($langchoice eq 'en') { >+ C4::Context->config('intranetdir') >+ . "/installer/data/$info{dbms}/$langchoice/marcflavour"; >+ unless ( opendir( MYDIR, $dir ) ) { >+ if ( $langchoice eq 'en' ) { > warn "cannot open MARC frameworks directory $dir"; >- } else { >+ } >+ else { > # if no translated MARC framework is available, > # default to English >- $dir = C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/en/marcflavour"; >- opendir(MYDIR, $dir) or warn "cannot open English MARC frameworks directory $dir"; >+ $dir = C4::Context->config('intranetdir') >+ . "/installer/data/$info{dbms}/en/marcflavour"; >+ opendir( MYDIR, $dir ) >+ or warn "cannot open English MARC frameworks directory $dir"; > } > } > my @listdir = grep { !/^\./ && -d "$dir/$_" } readdir(MYDIR); > closedir MYDIR; >- my $marcflavour=C4::Context->preference("marcflavour"); >+ my $marcflavour = C4::Context->preference("marcflavour"); > my @flavourlist; > foreach my $marc (@listdir) { >- my %cell=( >- "label"=> ucfirst($marc), >- "code"=>uc($marc), >- "checked"=> defined($marcflavour) ? uc($marc) eq $marcflavour : 0); >+ my %cell = ( >+ "label" => ucfirst($marc), >+ "code" => uc($marc), >+ "checked" => defined($marcflavour) >+ ? uc($marc) eq $marcflavour >+ : 0 >+ ); >+ > # $cell{"description"}= do { local $/ = undef; open INPUT "<$dir/$marc.txt"||"";<INPUT> }; > push @flavourlist, \%cell; > } > $template->param( "flavourloop" => \@flavourlist ); >- $template->param( "$op" => 1 ); >+ $template->param( "$op" => 1 ); > } > elsif ( $op && $op eq 'importdatastructure' ) { > # >@@ -317,7 +365,7 @@ elsif ( $step && $step == 3 ) { > # > #Do updatedatabase And report > >- if ( ! defined $ENV{PERL5LIB} ) { >+ if ( !defined $ENV{PERL5LIB} ) { > my $find = "C4/Context.pm"; > my $path = $INC{$find}; > $path =~ s/\Q$find\E//; >@@ -325,59 +373,76 @@ elsif ( $step && $step == 3 ) { > warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n"; > } > >- my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() ); >- my $logdir = C4::Context->config('logdir'); >- my $dbversion = C4::Context->preference('Version'); >+ my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() ); >+ my $logdir = C4::Context->config('logdir'); >+ my $dbversion = C4::Context->preference('Version'); > my $kohaversion = Koha::version; > $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; > > my $filename_suffix = join '_', $now, $dbversion, $kohaversion; >- my ( $logfilepath, $logfilepath_errors ) = ( chk_log($logdir, "updatedatabase_$filename_suffix"), chk_log($logdir, "updatedatabase-error_$filename_suffix") ); >+ my ( $logfilepath, $logfilepath_errors ) = ( >+ chk_log( $logdir, "updatedatabase_$filename_suffix" ), >+ chk_log( $logdir, "updatedatabase-error_$filename_suffix" ) >+ ); > >- my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl >> $logfilepath 2>> $logfilepath_errors"; >+ my $cmd = C4::Context->config("intranetdir") >+ . "/installer/data/$info{dbms}/updatedatabase.pl >> $logfilepath 2>> $logfilepath_errors"; > > system($cmd ); > > my $fh; >- open( $fh, "<", $logfilepath ) or die "Cannot open log file $logfilepath: $!"; >+ open( $fh, "<", $logfilepath ) >+ or die "Cannot open log file $logfilepath: $!"; > my @report = <$fh>; > close $fh; > if (@report) { >- $template->param( update_report => [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] ); >+ $template->param( update_report => >+ [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] >+ ); > $template->param( has_update_succeeds => 1 ); >- } else { >- eval{ `rm $logfilepath` }; > } >- open( $fh, "<", $logfilepath_errors ) or die "Cannot open log file $logfilepath_errors: $!"; >+ else { >+ eval { `rm $logfilepath` }; >+ } >+ open( $fh, "<", $logfilepath_errors ) >+ or die "Cannot open log file $logfilepath_errors: $!"; > @report = <$fh>; > close $fh; > if (@report) { >- $template->param( update_errors => [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] ); >+ $template->param( update_errors => >+ [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] >+ ); > $template->param( has_update_errors => 1 ); >- warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; >+ warn >+"The following errors were returned while attempting to run the updatedatabase.pl script:\n"; > foreach my $line (@report) { warn "$line\n"; } >- } else { >- eval{ `rm $logfilepath_errors` }; >+ } >+ else { >+ eval { `rm $logfilepath_errors` }; > } > $template->param( $op => 1 ); > } > else { >- # >- # check whether it's a 1st install or an update >- # >- #Check if there are enough tables. >- # Paul has cleaned up tables so reduced the count >- #I put it there because it implied a data import if condition was not satisfied. >+# >+# check whether it's a 1st install or an update >+# >+#Check if there are enough tables. >+# Paul has cleaned up tables so reduced the count >+#I put it there because it implied a data import if condition was not satisfied. > my $dbh = DBI->connect( >- "DBI:$info{dbms}:dbname=$info{dbname};host=$info{hostname}" >- . ( $info{port} ? ";port=$info{port}" : "" ), >- $info{'user'}, $info{'password'} >+ "DBI:$info{dbms}:dbname=$info{dbname};host=$info{hostname}" >+ . ( $info{port} ? ";port=$info{port}" : "" ), >+ $info{'user'}, $info{'password'} > ); >- my $rq; >- if ( $info{dbms} eq 'mysql' ) { $rq = $dbh->prepare( "SHOW TABLES" ); } >- elsif ( $info{dbms} eq 'Pg' ) { $rq = $dbh->prepare( "SELECT * >- FROM information_schema.tables >- WHERE table_schema='public' and table_type='BASE TABLE';" ); } >+ my $rq; >+ if ( $info{dbms} eq 'mysql' ) { $rq = $dbh->prepare("SHOW TABLES"); } >+ elsif ( $info{dbms} eq 'Pg' ) { >+ $rq = $dbh->prepare( >+ "SELECT * >+ FROM information_schema.tables >+ WHERE table_schema='public' and table_type='BASE TABLE';" >+ ); >+ } > $rq->execute; > my $data = $rq->fetchall_arrayref( {} ); > my $count = scalar(@$data); >@@ -388,23 +453,24 @@ elsif ( $step && $step == 3 ) { > $template->param( "count" => $count, "proposeimport" => 1 ); > } > else { >- # >- # we have tables, propose to select files to upload or updatedatabase >- # >+ # >+ # we have tables, propose to select files to upload or updatedatabase >+ # > $template->param( "count" => $count, "default" => 1 ); >- # >- # 1st part of step 3 : check if there is a databaseversion systempreference >- # if there is, then we just need to upgrade >- # if there is none, then we need to install the database >- # >- if (C4::Context->preference('Version')) { >+ # >+ # 1st part of step 3 : check if there is a databaseversion systempreference >+ # if there is, then we just need to upgrade >+ # if there is none, then we need to install the database >+ # >+ if ( C4::Context->preference('Version') ) { > my $dbversion = C4::Context->preference('Version'); > $dbversion =~ /(.*)\.(..)(..)(...)/; > $dbversion = "$1.$2.$3.$4"; >- $template->param("upgrading" => 1, >- "dbversion" => $dbversion, >- "kohaversion" => Koha::version(), >- ); >+ $template->param( >+ "upgrading" => 1, >+ "dbversion" => $dbversion, >+ "kohaversion" => Koha::version(), >+ ); > } > } > } >@@ -422,7 +488,8 @@ else { > if ( $rq->execute ) { > my ($version) = $rq->fetchrow; > if ($version) { >- print $query->redirect("/cgi-bin/koha/installer/install.pl?step=3"); >+ print $query->redirect( >+ "/cgi-bin/koha/installer/install.pl?step=3"); > exit; > } > } >@@ -430,13 +497,15 @@ else { > } > output_html_with_http_headers $query, $cookie, $template->output; > >-sub chk_log { #returns a logfile in $dir or - if that failed - in temp dir >- my ($dir, $name) = @_; >- my $fn=$dir.'/'.$name.'.log'; >- if( ! open my $fh, '>', $fn ) { >- $name.= '_XXXX'; >+sub chk_log { #returns a logfile in $dir or - if that failed - in temp dir >+ my ( $dir, $name ) = @_; >+ my $fn = $dir . '/' . $name . '.log'; >+ if ( !open my $fh, '>', $fn ) { >+ $name .= '_XXXX'; > require File::Temp; >- ($fh, $fn)= File::Temp::tempfile( $name, TMPDIR => 1, SUFFIX => '.log'); >+ ( $fh, $fn ) = >+ File::Temp::tempfile( $name, TMPDIR => 1, SUFFIX => '.log' ); >+ > #if this should not work, let croak take over > } > return $fn; >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >new file mode 100755 >index 0000000..437657d >--- /dev/null >+++ b/installer/onboarding.pl >@@ -0,0 +1,683 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright (C) YEAR YOURNAME-OR-YOUREMPLOYER >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+#Recommended pragmas >+use Modern::Perl; >+use diagnostics; >+use C4::InstallAuth; >+use CGI qw ( -utf8 ); >+use List::MoreUtils qw/uniq/; >+use Digest::MD5 qw(md5_base64); >+use Encode qw( encode ); >+use C4::Koha; >+use C4::Context; >+use C4::Output; >+use C4::Form::MessagingPreferences; >+use C4::Members; >+use C4::Members::Attributes; >+use C4::Members::AttributeTypes; >+use C4::Log; >+use C4::Letters; >+use C4::Form::MessagingPreferences; >+use Koha::AuthorisedValues; >+use Koha::Patron::Debarments; >+use Koha::Cities; >+use Koha::Patrons; >+use Koha::Items; >+use Koha::Libraries; >+use Koha::LibraryCategories; >+use Koha::Database; >+use Koha::DateUtils; >+use Koha::Patron::Categories; >+use Koha::Patron::HouseboundRole; >+use Koha::Patron::HouseboundRoles; >+use Koha::Token; >+use Email::Valid; >+use Module::Load; >+use Koha::ItemTypes; >+use Koha::IssuingRule; >+use Koha::IssuingRules; >+ >+#Setting variables >+my $input = new CGI; >+my $step = $input->param('step'); >+ >+#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, >+ } >+ ); >+ >+#Check database connection >+my %info; >+$info{'dbname'} = C4::Context->config("database"); >+$info{'dbms'} = ( >+ C4::Context->config("db_scheme") >+ ? C4::Context->config("db_scheme") >+ : "mysql" >+); >+ >+$info{'hostname'} = C4::Context->config("hostname"); >+$info{'port'} = C4::Context->config("port"); >+$info{'user'} = C4::Context->config("user"); >+$info{'password'} = C4::Context->config("pass"); >+my $dbh = DBI->connect( >+ "DBI:$info{dbms}:dbname=$info{dbname};host=$info{hostname}" >+ . ( $info{port} ? ";port=$info{port}" : "" ), >+ $info{'user'}, $info{'password'} >+); >+ >+#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; >+} >+ >+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' } >+ ) >+ ], >+ }, >+ ] >+); >+ >+ >+#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, ); >+ >+#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 ) >+ } >+ ); >+ >+ eval { $library->store; }; #Use the eval{} function to store the library object >+ if ($library) { >+ $message = 'success_on_insert'; >+ } >+ 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 ) { >+ 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 ); >+ >+ 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, >+ } >+ ); >+ } >+ >+ #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; }; >+ >+ #Error messages >+ if ($category) { >+ $message = 'success_on_insert'; >+ } >+ else { >+ $message = 'error_on_insert'; >+ } >+ >+ $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'] }, ); >+ $template->param( >+ libraries => $libraries, >+ group_types => [ >+ { >+ categorytype => 'searchdomain', >+ categories => [ >+ Koha::LibraryCategories->search( >+ { categorytype => 'searchdomain' } >+ ) >+ ], >+ }, >+ { >+ categorytype => 'properties', >+ categories => [ >+ Koha::LibraryCategories->search( >+ { categorytype => 'properties' } >+ ) >+ ], >+ }, >+ ] >+ ); >+ >+#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 $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 ); >+ >+ 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 ( $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 ); >+ } >+ } >+ $template->param( 'nok' => 1 ); >+ >+#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{dateexpiry} = '12/10/2016'; >+ $newdata{privacy} = "default"; >+ >+#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 $dbh = C4::Context->dbh(); >+ 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; >+ } >+ } >+ >+ # construct flags >+ my $module_flags = 0; >+ my $sth = >+ $dbh->prepare("SELECT bit,flag FROM userflags ORDER BY bit"); >+ $sth->execute(); >+ while ( my ( $bit, $flag ) = $sth->fetchrow_array ) { >+ if ( exists $all_module_perms{$flag} ) { >+ $module_flags += 2**$bit; >+ } >+ } >+ >+#Set the superlibrarian permission of the newly created patron to superlibrarian >+ $sth = $dbh->prepare( >+ "UPDATE borrowers SET flags=? WHERE borrowernumber=?"); >+ $sth->execute( $module_flags, $borrowernumber ); >+ >+ #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' }; >+ } >+ } >+ } >+ } >+} >+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"){ >+ 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 >+ my $itemtype = Koha::ItemType->new( >+ { >+ itemtype => $itemtype_code, >+ description => $description, >+ } >+ ); >+ 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'; >+ } >+ else { >+ $message = 'error_on_insert'; >+ } >+ $template->param( 'message' => $message ); >+ } >+} >+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, ); >+ >+ #Find all the exisiting libraries to display in a dropdown box in the template >+ 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' } >+ ) >+ ], >+ }, >+ ] >+ ); >+ >+ my $input = CGI->new; >+ my $dbh = C4::Context->dbh; >+ >+ 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 ( $op eq 'add_validate' ) { >+ my $type = $input->param('type'); >+ my $br = $input->param('branch'); >+ my $bor = $input->param('categorycode'); >+ my $itemtype = $input->param('itemtype'); >+ my $maxissueqty = $input->param('maxissueqty'); >+ my $issuelength = $input->param('issuelength'); >+ my $lengthunit = $input->param('lengthunit'); >+ my $renewalsallowed = $input->param('renewalsallowed'); >+ my $renewalperiod = $input->param('renewalperiod'); >+ my $onshelfholds = $input->param('onshelfholds') || 0; >+ $maxissueqty =~ s/\s//g; >+ $maxissueqty = undef if $maxissueqty !~ /^\d+/; >+ $issuelength = $issuelength eq q{} ? undef : $issuelength; >+ >+ my $params = { >+ branchcode => $br, >+ categorycode => $bor, >+ itemtype => $itemtype, >+ maxissueqty => $maxissueqty, >+ renewalsallowed => $renewalsallowed, >+ renewalperiod => $renewalperiod, >+ issuelength => $issuelength, >+ lengthunit => $lengthunit, >+ onshelfholds => $onshelfholds, >+ }; >+ >+ my @messages; >+ >+#New code from smart-rules.tt starts here. Needs to be added to library >+#Allows for the 'All' option to work when selecting all libraries for a circulation rule to apply to. >+ if ( $branch eq "*" ) { >+ my $sth_search = $dbh->prepare( >+ "SELECT count(*) AS total >+ FROM default_circ_rules" >+ ); >+ my $sth_insert = $dbh->prepare( >+ "INSERT INTO default_circ_rules >+ (maxissueqty, onshelfholds) >+ VALUES (?, ?)" >+ ); >+ my $sth_update = $dbh->prepare( >+ "UPDATE default_circ_rules >+ SET maxissueqty = ?, onshelfholds = ?" >+ ); >+ >+ $sth_search->execute(); >+ my $res = $sth_search->fetchrow_hashref(); >+ if ( $res->{total} ) { >+ $sth_update->execute( $maxissueqty, $onshelfholds ); >+ } >+ else { >+ $sth_insert->execute( $maxissueqty, $onshelfholds ); >+ } >+ } >+ >+#Allows for the 'All' option to work when selecting all patron categories for a circulation rule to apply to. >+ if ( $bor eq "*" ) { >+ my $sth_search = $dbh->prepare( >+ "SELECT count(*) AS total >+ FROM default_circ_rules" >+ ); >+ my $sth_insert = $dbh->prepare( >+ q| >+ INSERT INTO default_circ_rules >+ (maxissueqty) >+ VALUES (?) >+ | >+ ); >+ my $sth_update = $dbh->prepare( >+ q| >+ UPDATE default_circ_rules >+ SET maxissueqty = ? >+ | >+ ); >+ >+ $sth_search->execute(); >+ my $res = $sth_search->fetchrow_hashref(); >+ if ( $res->{total} ) { >+ $sth_update->execute($maxissueqty); >+ } >+ else { >+ $sth_insert->execute($maxissueqty); >+ } >+ } >+ >+#Allows for the 'All' option to work when selecting all itemtypes for a circulation rule to apply to >+ if ( $itemtype eq "*" ) { >+ my $sth_search = $dbh->prepare( >+ "SELECT count(*) AS total >+ FROM default_branch_circ_rules >+ WHERE branchcode = ?" >+ ); >+ my $sth_insert = $dbh->prepare( >+ "INSERT INTO default_branch_circ_rules >+ (branchcode, onshelfholds) >+ VALUES (?, ?)" >+ ); >+ my $sth_update = $dbh->prepare( >+ "UPDATE default_branch_circ_rules >+ SET onshelfholds = ? >+ WHERE branchcode = ?" >+ ); >+ $sth_search->execute($branch); >+ my $res = $sth_search->fetchrow_hashref(); >+ >+ if ( $res->{total} ) { >+ $sth_update->execute( $onshelfholds, $branch ); >+ } >+ else { >+ $sth_insert->execute( $branch, $onshelfholds ); >+ } >+ } >+ >+ my $issuingrule = Koha::IssuingRules->find( >+ { categorycode => $bor, itemtype => $itemtype, branchcode => $br } >+ ); >+ if ($issuingrule) { >+ $issuingrule->set($params)->store(); >+ 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. >+ >+ } >+ else { >+ Koha::IssuingRule->new()->set($params)->store(); >+ } >+ } >+} >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index f6d9e9b..a4bbe62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -6,7 +6,7 @@ var debug = "[% debug %]"; > var dformat = "[% dateformat %]"; > var sentmsg = 0; > if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} >-var MSG_PLEASE_ENTER_A_VALID_DATE = _("Please enter a valid date (should match %s)."); >+var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s).")); > > function is_valid_date(date) { > // An empty string is considered as a valid date for convenient reasons. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 2c88c6c..7c5c2c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -42,6 +42,8 @@ > <li><a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a></li> > [% END %] > <li><a href="/cgi-bin/koha/about.pl">About Koha</a></li> >+ <li><a href="/cgi-bin/koha/summary.pl">Summary</a></li> >+ > </ul> > </li> > </ul> >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 a4b435c..60d0e66 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 >@@ -1,5 +1,9 @@ > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" /> >+<link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" /> > <style type="text/css" media="screen"> > > [% IF ( login ) %] >@@ -69,6 +73,17 @@ td input { font-size: 1.5em; } > > </style> > >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script> >+<!-- koha core js --> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script> >+ > <script type="text/javascript"> > //<![CDATA[ > function _(s) { return s } // dummy function for gettext >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index b28b634..1ec3920 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -93,7 +93,7 @@ > </li> > <li> > <label for="enrolmentperioddate" style="width:6em;">Until date: </label> >- <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> >+ <input type="text" class="enrollmentperiod datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> > </li> > </ol> > </fieldset> >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 3ae276f..4ea9580 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >@@ -1,130 +1,162 @@ > [% INCLUDE 'doc-head-open.inc' %]<title>Koha › Web installer › Step 3</title> >-[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/installer/onboarding.pl">[% END %] > [% INCLUDE 'installer-doc-head-close.inc' %] > <div> >-<h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif" /> Web installer › Step 3</h1> >+<h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif" /> Koha web installer › Step 3</h1> > > [% IF ( selectframeworks ) %] > <script type="text/javascript"> >- //<![CDATA[ >+//<![CDATA[ > >- var surl = unescape(window.location.pathname); >+var surl = unescape(window.location.pathname); > >- function doLoad() >- { >- // the timeout value should be the same as in the "refresh" meta-tag >- setTimeout( "refresh()", 2*1000 ); >- } >+function doLoad() >+{ >+ // the timeout value should be the same as in the "refresh" meta-tag >+ setTimeout( "refresh()", 2*1000 ); >+} > >- function refresh(value) >- { >- // The argument to the location.reload function determines >- // if the browser should retrieve the document from the >- // web-server. In our example all we need to do is cause >- // the JavaScript block in the document body to be >- // re-evaluated. If we needed to pull the document from >- // the web-server again (such as where the document contents >- // change dynamically) we would pass the argument as 'true'. >- // >- surl=surl+'?step=3&op=selectframeworks&fwklanguage='+value; >- >- window.location.replace( surl ); >- } >+function refresh(value) >+{ >+ // The argument to the location.reload function determines >+ // if the browser should retrieve the document from the >+ // web-server. In our example all we need to do is cause >+ // the JavaScript block in the document body to be >+ // re-evaluated. If we needed to pull the document from >+ // the web-server again (such as where the document contents >+ // change dynamically) we would pass the argument as 'true'. >+ // >+ surl=surl+'?step=3&op=selectframeworks&fwklanguage='+value; >+ >+ window.location.replace( surl ); >+} > >- function selectAllFrameworks() >+function selectAllFrameworks() >+{ >+ // A handy short link that selects all available checkboxes >+ // on the page. >+ // >+ var checkboxes = document.getElementsByTagName("input"); >+ for (var i = 0; i < checkboxes.length; i++) > { >- // A handy short link that selects all available checkboxes >- // on the page. >- // >- var checkboxes = document.getElementsByTagName("input"); >- for (var i = 0; i < checkboxes.length; i++) >+ if (checkboxes[i].type == 'checkbox') > { >- if (checkboxes[i].type == 'checkbox') >- { >- checkboxes[i].checked = true; >- } >+ checkboxes[i].checked = true; > } >- >- // Prevent event propergation. >- return false; > } > >- function Hide(link) >- { >- // Toggle the display of a given element on the page. >- // >- subfield = document.getElementById('bloc'+link); >- var initstyle = subfield.style.display; >- if (initstyle == 'block') subfield.style.display = 'none' ; >- if (initstyle == 'none') subfield.style.display = 'block' ; >- } >+ // Prevent event propergation. >+ return false; >+} >+ >+function Hide(link) >+{ >+ // Toggle the display of a given element on the page. >+ // >+ subfield = document.getElementById('bloc'+link); >+ var initstyle = subfield.style.display; >+ if (initstyle == 'block') subfield.style.display = 'none' ; >+ if (initstyle == 'none') subfield.style.display = 'block' ; >+} > >- //]]> >- </script> >+//]]> >+</script> > [% END %] >+ >+ > [% IF ( finish ) %] > <h1>Congratulations, installation complete</h1> >- <p>If this page does not redirect in 5 seconds, click <a href="/">here</a>.</p> >+ <p>If this page does not redirect in 10 seconds, click <a href="/cgi-bin/koha/installer/onboarding.pl">Start onboarding process</a>.</p> > [% END %] >+ >+ > [% IF ( choosemarc ) %] >- <h2 align="center">Select your MARC flavor</h2> >+ <h2 align="center">Choose your setup</h2> >+ <p>Basic setup selects recommended settings by default.</p> > <form name="frameworkselection" method="post" action="install.pl"> > <input type="hidden" name="step" value="3" /> >- <input type="hidden" name="op" value="selectframeworks" /> >- <p> >+ <input type="hidden" name="op" value="selectframeworks"/> >+ >+ <div> >+ <input type="radio" name="setup" value="Basic" checked="checked">Basic<br/> >+ <input type="radio" name="setup" value="Advanced"/>Advanced<br/> >+ </div> >+ >+ <h2 align="center">Select your MARC flavor</h2> >+ <p>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. </p> >+ > [% FOREACH flavourloo IN flavourloop %] > <div> >- [% IF ( flavourloo.checked ) %] >- <input type="radio" name="marcflavour" value="[% flavourloo.code %]" checked /> [% flavourloo.label %] <br/> >+ [% IF ( flavourloo.label == "Unimarc") %] >+ <input type="radio" name="marcflavour" value="[% flavourloo.code %]" /> [% flavourloo.label %]<br/> > [% ELSE %] >- <input type="radio" name="marcflavour" value="[% flavourloo.code %]" /> [% flavourloo.label %] <br/> >+ <input type="radio" name="marcflavour" value="[% flavourloo.code %]" checked="checked" /> [% flavourloo.label %] <br/> > [% END %] > </div> > [% END %] >- </p> >- <p> Click 'Next' to continue <input value="Next >>" type="submit" /></p> >+ >+ <p>Click 'Next' to continue <input value="Next >>" type="submit" /></p> >+ > </form> >+ > [% END %] > > [% IF ( selectframeworks ) %] >- <h2 align="center">Selecting Default Settings</h2> >- <script type="text/javascript"> >- var linklabel = _("Select all sample data"); >- document.write('<p><a href="#" onclick="return selectAllFrameworks();">'+linklabel+'</a></p>'); >- </script> >- <form name="frameworkselection" method="post" action="install.pl"> >- <input type="hidden" name="step" value="3" /> >- <input type="hidden" name="op" value="addframeworks" /> >+ <h2 align= "center"> [% setup %] setup</h2> >+ <h2 align="center">Selecting Default Settings</h2> > >+ [% IF setup == "Advanced" %] >+ <script type="text/javascript"> >+ var linklabel = _("Select all options"); >+ document.write('<p><a href="#" onclick="return selectAllFrameworks();"><button>'+linklabel+'</button></a></p>'); >+ </script> >+ [% END %] >+ <form name="frameworkselection" method="post" action="install.pl"> >+ <input type="hidden" name="step" value="3" /> >+ <input type="hidden" name="op" value="addframeworks" /> > [% IF ( frameworksloop ) %] >- <h2>MARC frameworks: [% marcflavour %]</h2> >- [% IF ( en_marc_frameworks ) %] >- <h4><span class="error">No MARC frameworks are available for your language. >- Defaulting to the frameworks supplied for English (en)<span></h4> >- [% END %] >- [% FOREACH frameworksloo IN frameworksloop %] >- <div> >- <h3>[% frameworksloo.label %]</h3> >- [% FOREACH framework IN frameworksloo.frameworks %] >- <table style="border:1px;vertical-align:top;"> >- <tr> >- <td style="vertical-align:top;"> >- [% IF ( framework.checked ) %] >- <input type="checkbox" name="framework" value="[% framework.fwkfile %]" checked="checked" id="[% framework.fwkname %]" /> >- [% ELSE %] >- <input type="checkbox" name="framework" value="[% framework.fwkfile %]" id="[% framework.fwkname %]" /> >- [% END %] >- </td> >- <td> >- <label for="[% framework.fwkname %]"> >- [% framework.fwkdescription %] >- <em>([% framework.fwkname %])</em> >- </label> >- </td> >- </table> >- [% END %] >- </div> >- [% END %] >+ <h2>MARC frameworks: [% marcflavour %]</h2> >+ [% IF ( en_marc_frameworks ) %] >+ <h4><span class="error">No MARC frameworks are available for your language. >+ Defaulting to the frameworks supplied for English (en)<span></h4> >+ [% END %] >+ [% FOREACH frameworksloo IN frameworksloop %] >+ <div> >+ <h3>[% frameworksloo.label %]</h3> >+ [% FOREACH framework IN frameworksloo.frameworks %] >+ <table style="border:1px;vertical-align:top;"> >+ <tr> >+ <td style = "border:1px; vertical-align:top;"> >+ [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] >+ <input type="hidden" name="framework" value="[% framework.fwkfile %]" id ="[%framework.fwkname%]" /> >+ [% ELSE %] >+ <input type="checkbox" name="framework" value="[% framework.fwkfile %]" id ="[%framework.fwkname%]" /> >+ [% END %] >+ </td> >+ <td> >+ [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] >+ <ul> >+ <li> >+ <label for="[% framework.fwkname %]"> >+ [% framework.fwkdescription %] >+ <em>([% framework.fwkname %])</em> >+ </label> >+ </li> >+ </ul> >+ </td> >+ [% ELSE %] >+ <td> >+ <label for= "[% framework.fwkname %]"> >+ [% framework.fwkdescription %] >+ <em>([% framework.fwkname %])</em> >+ </label> >+ </td> >+ [% END %] >+ </tr> >+ </table> >+ [% END %] >+ </div> >+ [% END %] > <h2>Other data</h2> > [% END %] > [% IF ( en_sample_data ) %] >@@ -132,27 +164,49 @@ > Defaulting to the samples supplied for English (en)<span></h4> > [% END %] > [% FOREACH levelloo IN levelloop %] >- <div> >- <h3>[% levelloo.label %]</h3> >- [% FOREACH framework IN levelloo.frameworks %] >- <table style="border:1px;vertical-align:top;"> >- <tr> >- <td style="vertical-align:top;"> >- [% IF ( framework.checked ) %] >- <input type="checkbox" name="framework" value="[% framework.fwkfile %]" checked="checked" id="[% framework.fwkname %]" /> >- [% ELSE %] >- <input type="checkbox" name="framework" value="[% framework.fwkfile %]" id="[% framework.fwkname %]" /> >- [% END %] >- </td> >- <td> >- <label for="[% framework.fwkname %]"> >- [% framework.fwkdescription %] >- <em>([% framework.fwkname %])</em> >- </label> >- </td> >- </table> >- [% END %] >- </div> >+ <div> >+ <h3>[% levelloo.label %]</h3> >+ >+ [% IF (setup == "Basic" && levelloo.label == "Optional") %] >+ <script type="text/javascript"> >+ var linklabel = _("Select all options"); >+ document.write('<p><a href="#" onclick="return selectAllFrameworks();"><button>'+linklabel+'</button></a></p>'); >+ </script> >+ [% END %] >+ >+ [% FOREACH framework IN levelloo.frameworks %] >+ <table style="border:1px;vertical-align:top;"> >+ <tr> >+ <td style="vertical-align:top;"> >+ [% IF (levelloo.label == "Default" ) && (setup=="Basic")%] >+ <input type="hidden" name="framework" value="[% framework.fwkfile %]" id="[%framework.fwkname %]" /> >+ [% ELSE %] >+ <input type="checkbox" name="framework" value="[%framework.fwkfile %]" id="[%framework.fwkname%]"/> >+ [% END %] >+ </td> >+ <td> >+ [% IF (levelloo.label == "Default") && (setup=="Basic")%] >+ <ul> >+ <li> >+ <label for="[% framework.fwkname %]"> >+ [% framework.fwkdescription %] >+ <em>([% framework.fwkname %])</em> >+ </label> >+ </li> >+ </ul> >+ </td> >+ [% ELSE %] >+ <td> >+ <label for= "[% framework.fwkname %]"> >+ [% framework.fwkdescription %] >+ <em>([% framework.fwkname %])</em> >+ </label> >+ </td> >+ [% END %] >+ </tr> >+ </table> >+ [% END %] >+ </div> > [% END %] > <p>When you've made your selections, please click 'Import' below to begin the process. It may take a while to complete, > please be patient.</p> >@@ -173,11 +227,12 @@ > [% END %] > <h3>All done!</h3> > <p>Installation complete.<br /> >- <p>Click on 'Finish' to complete and load the Koha Staff Interface. >+ <p>Click on 'Set up Koha with the onboarding tool' to complete and load the Koha onboarding tool. > <form name="finish"> > <input type="hidden" name="step" value="3" /> > <input type="hidden" name="op" value="finish" /> >- <input type="submit" value="Finish" /></form> >+ <input type="submit" value="Set up Koha with the onboarding tool"/> >+ </form> > </p> > </p> > [% END %] >@@ -210,22 +265,22 @@ > </form> > [% END %] > >- > [% IF ( default ) %] > [% IF ( upgrading ) %] > <p> >- We are upgrading from Koha [% dbversion %] to [% kohaversion %], you must <a href="install.pl?step=3&op=updatestructure" class="button">update your database</a> >+ We are upgrading from Koha [% dbversion %] to [% kohaversion %], you must update your database. >+ <br> >+ <a href="install.pl?step=3&op=updatestructure" class="button"><button>Update Database</button></a> > </p> > [% ELSE %] >- <p>We are ready to do some basic configuration. Please >- <a href="install.pl?step=3&op=choosemarc" class="button">install basic configuration settings</a> >- to continue the installation. >- </p> >+ <p>We are ready to do some basic configuration. Please install some basic configuration settings to continue the installation: >+ <br> >+ <br> >+ <a href="install.pl?step=3&op=choosemarc" class="button"><button>Install Basic Configuration Settings</button></a> >+ > [% END %] > [% END %] > >- >- > [% IF ( updatestructure ) %] > <div><h2 align="center">Updating database structure</h2> > [% IF ( has_update_succeeds ) %] >@@ -247,7 +302,7 @@ > [% UNLESS ( has_update_errors ) %] > <p>Everything went OK, update done.</p> > [% END %] >-<a href="install.pl?step=3&op=finished" class="button">Continue to log in to Koha</a> >+<a href="install.pl?step=3&op=choosemarc" class="button"><button>Back to Installation</button></a> > </div> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index c34c9ce..f295ab2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -1,5 +1,3 @@ >-[% USE Koha %] >-[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha staff client</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/mainpage.css" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >new file mode 100644 >index 0000000..18cff8c >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt >@@ -0,0 +1,81 @@ >+<!--Includes for creating library--> >+[% INCLUDE 'doc-head-open.inc' %] >+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'datatables.inc' %] >+ >+[% IF (libraries && libraries.count > 1) %] >+ <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=2"> >+ >+[% ELSIF (op == "add_validate_library") %] >+ <head> >+ <title>Welcome › to › Koha</title> >+ </head> >+ >+ <!--Header for the koha onboarding tool--> >+ <div> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+ </div> >+ >+<!--New Library created--> >+ [% IF message == "success_on_insert" %] >+ <form name="createlibrary" method="post" action="onboarding.pl" > >+ <input type="hidden" name="step" value="2"/> >+ <h1 align="left"> New library</h1> >+ <div> >+ <p> Success: library created! >+ </p> >+ <p> To add another library and for more settings, <br> >+ go to:<br> >+ More -> Administration -> Libraries and groups<br> >+ </p> >+ </div> >+ Next up: >+ <input type="submit" name="start" value="Minimal patron category setup"/> >+ </form> >+ >+ [%ELSE %] >+ <form name="retrylibrary" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="1"/> >+ <h1 align="left">Failed </h1> >+ <div> >+ <p> Library was not successfully created</br> >+ Please try again or contact your system administrator. </p> >+ </div> >+ <input type="submit" value="Try again"/> >+ </form> >+ [%END%] >+ >+[% ELSE %] >+ <head> >+ <title>Welcome › to › Koha</title> >+ </head> >+ >+ <!--Header for the koha onboarding tool--> >+ <div> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+ </div> >+ >+<!--Create a library screen 1--> >+ <form name="LibraryCreation" method="post" action="onboarding.pl"> >+ <fieldset class="rows" > >+ <h2>Create a library</h2> >+ <input type="hidden" name="step" value="1"/> >+ <input type="hidden" name="op" value="add_validate_library"/> >+ <ol> >+ <li> >+ <label for="branchcode" class="required">Library code: </label> >+ <input type="text" pattern="^[A-Za-z]{0,10}$" title="Please enter 3 capital letters" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="branchname" class="required">Name: </label> >+ <input type="text" pattern="[a-zA-Z ]+" title="Please enter a sentence of letters only" name="branchname" id="branchname" size="42" value="[% library.branchname |html %]" class=" required" required="required" style="width:200px;"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ <br> >+ <input type="submit" class="action" value="Submit"/> >+ </fieldset> >+ </form> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >new file mode 100644 >index 0000000..453d96a >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >@@ -0,0 +1,405 @@ >+<!--Pragmas for using and including packages for create patron category--> >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Price %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title> Add a patron category</title> >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'calendar.inc' %] >+ >+<script type="text/javascript"> >+//<![CDATA[ >+ >+var debug = ""; >+var dformat = "us"; >+var sentmsg = 0; >+if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} >+var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s).")); >+ >+function is_valid_date(date) { >+ // An empty string is considered as a valid date for convenient reasons. >+ if ( date === '' ) return 1; >+ var dateformat = dateformat_str = 'us'; >+ if ( dateformat == 'us' ) { >+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; >+ dateformat = 'mm/dd/yy'; >+ } else if ( dateformat == 'metric' ) { >+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; >+ dateformat = 'dd/mm/yy'; >+ } else if (dateformat == 'iso' ) { >+ if ( date.search(/^\d{4}-\d{2}-\d{2}($|\s)/) == -1 ) return 0; >+ dateformat = 'yy-mm-dd'; >+ } else if ( dateformat == 'dmydot' ) { >+ if ( date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1 ) return 0; >+ dateformat = 'dd.mm.yy'; >+ } >+ try { >+ $.datepicker.parseDate(dateformat, date); >+ } catch (e) { >+ return 0; >+ }; >+ return 1; >+}function get_dateformat_str(dateformat) { >+ var dateformat_str; >+ if ( dateformat == 'us' ) { >+ dateformat_str = 'mm/dd/yyyy'; >+ } else if ( dateformat == 'metric' ) { >+ dateformat_str = 'dd/mm/yyyy'; >+ } else if (dateformat == 'iso' ) { >+ dateformat_str = 'yyyy-mm-dd'; >+ } else if ( dateformat == 'dmydot' ) { >+ dateformat_str = 'dd.mm.yyyy'; >+ } >+ return dateformat_str; >+} >+ >+function validate_date (dateText, inst) { >+ if ( !is_valid_date(dateText) ) { >+ var dateformat_str = get_dateformat_str( 'us' ); >+ alert(MSG_PLEASE_ENTER_A_VALID_DATE.format(dateformat_str)); >+ $('#'+inst.id).val(''); >+ } >+} >+function Date_from_syspref(dstring) { >+ var dateX = dstring.split(/[-/.]/); >+ if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >+ if (dformat === "iso") { >+ return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >+ } else if (dformat === "us") { >+ return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >+ } else if (dformat === "metric") { >+ return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >+ } else if (dformat === "dmydot") { >+ return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD.MM.YYYY to (YYYY,m(0-11),d) >+ } else { >+ if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >+ return 0; >+ } >+} >+ >+function DateTime_from_syspref(date_time) { >+ var parts = date_time.split(" "); >+ var date = parts[0]; >+ var time = parts[1]; >+ parts = time.split(":"); >+ var hour = parts[0]; >+ var minute = parts[1]; >+ if ( hour < 0 || hour > 23 ) { >+ return 0; >+ } >+ if ( minute < 0 || minute > 59 ) { >+ return 0; >+ } >+ var datetime = Date_from_syspref( date ); >+ if ( isNaN( datetime.getTime() ) ) { >+ return 0; >+ } >+ datetime.setHours( hour ); >+ datetime.setMinutes( minute ); >+ return datetime; >+} >+ >+/* Instead of including multiple localization files as you would normally see with >+ jQueryUI we expose the localization strings in the default configuration */ >+jQuery(function($){ >+ $.datepicker.regional[''] = { >+ closeText: _("Done"), >+ prevText: _("Prev"), >+ nextText: _("Next"), >+ currentText: _("Today"), >+ monthNames: [_("January"),_("February"),_("March"),_("April"),_("May"),_("June"), >+ _("July"),_("August"),_("September"),_("October"),_("November"),_("December")], >+ monthNamesShort: [_("Jan"), _("Feb"), _("Mar"), _("Apr"), _("May"), _("Jun"), >+ _("Jul"), _("Aug"), _("Sep"), _("Oct"), _("Nov"), _("Dec")], >+ dayNames: [_("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday")], >+ dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], >+ dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], >+ weekHeader: _("Wk"), >+ dateFormat: "mm/dd/yy", >+ firstDay: 0, >+ isRTL: false, >+ showMonthAfterYear: false, >+ yearSuffix: ''}; >+ $.datepicker.setDefaults($.datepicker.regional['']); >+ }); >+ >+$(document).ready(function(){ >+ $.datepicker.setDefaults({ >+ showOn: "both", >+ changeMonth: true, >+ changeYear: true, >+ buttonImage: '/[% interface %]/prog/img/famfamfam/silk/calendar.png', >+ buttonImageOnly: true, >+ showButtonPanel: true, >+ showOtherMonths: true, >+ selectOtherMonths: true >+ }); >+ $( ".datepicker" ).datepicker({ >+ onClose: function(dateText, inst) { >+ validate_date(dateText, inst); >+ }, >+ }).on("change", function(e, value) { >+ if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >+ }); >+ // http://jqueryui.com/demos/datepicker/#date-range >+ var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({ >+ changeMonth: true, >+ numberOfMonths: 1, >+ onSelect: function( selectedDate ) { >+ var option = this.id == "from" ? "minDate" : "maxDate", >+ instance = $( this ).data( "datepicker" ); >+ date = $.datepicker.parseDate( >+ instance.settings.dateFormat || >+ $.datepicker._defaults.dateFormat, >+ selectedDate, instance.settings ); >+ dates.not( this ).datepicker( "option", option, date ); >+ }, >+ onClose: function(dateText, inst) { >+ validate_date(dateText, inst); >+ }, >+ }).on("change", function(e, value) { >+ if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} >+ }); >+}); >+//]]> >+</script> >+ >+ >+<script type="text/javascript"> >+var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); >+var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date.")); >+var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period.")); >+var MSG_DESCRIPTION_LETTERS_ONLY=(_("Please only enter letters.")); >+</script> >+ >+<script type="text/javascript"> >+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_CATEGORYCODE_CHARS >+); >+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_DESCRIPTION_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 >+); >+ >+$(document).ready(function() { >+ $("#enrolmentperioddate").datepicker({ >+ minDate: 1 >+ }); // Require that "until date" be in the future >+ if ($("#branches option:selected").length < 1) { >+ $("#branches option:first").attr("selected", "selected"); >+ } >+ $("#categorycode").on("blur",function(){ >+ toUC(this); >+ }); >+ $("#category_form").validate({ >+ rules: { >+ categorycode: { >+ required: true, >+ category_code_check: true >+ }, >+ description: { >+ required:true, >+ letters_only: 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 >+ } >+ } >+ }); >+}); >+ >+</script> >+</head> >+ >+[% 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--> >+ >+ >+ <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=3"> >+ >+[% ELSIF (op == "add_validate_category") %] >+<!--else if the user has not previously imported sample patron categories check if the user has pressed the button name="add_validate" in the create patron category screen 1, and if they have pressed that button then display the below screen with a button to redirect the user to step 3--> >+ >+ <div> <!-- Header that appears at the top of every screen in the koha onboarding tool--> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+ </div> >+ >+ [% IF message != "error_on_insert" %] >+ <form name="createcat" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="3"/> >+ <h1 align="left"> New patron category</h1> >+ <div> >+ <p> Success: patron category created! </p> >+ <p> To add another patron category and for more settings<br> >+ go to:<br> >+ More -> Administration -> Patron categories<br> >+ </div> >+ Next up:<br> >+ <input type="submit" name="start" value="Add a patron"><!-- When the user clicks on this button then redirect them to step 3 of the onboarding tool--> >+ </form> >+ [% ELSE %] >+ <form name="retrypatcat" method="post" action="onboarding.pl"> >+ Message is [% message %] >+ <input type="hidden" name="step" value="2"/> >+ <h1 align="left">Failed</h1> >+ <div>Patron category was not successfully created.</br> >+ Please try again or contact your system administrator.</p> >+ </div> >+ <input type="submit" value="Try again"/> >+ </form> >+ [% END %] >+ >+ >+[% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category--> >+ <div> <!-- Header that appears at the top of every screen in the koha onboarding tool--> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+ </div> >+ >+ <h1 align="left"> Create a new patron category</h1> >+ <p> The patron category you create in this form is going to be the one which the new administrator patron account will have.</p> >+ <form id="category_form" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="2"/> >+ <input type="hidden" name="op" value="add_validate_category" /> >+ <ol> >+ <li> >+ <label for="categorycode" class="required">Category code: </label> >+ <input type="text" pattern="^[A-Za-z]{0,10}$" title="Please enter 1 or 2 capital letters" id="categorycode" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="description" class="required">Description: </label> >+ <input type="text" pattern="[a-zA-Z ]+" title="Please enter a description sentence of letters only" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="overduenoticerequired">Overdue notice required: </label> >+ <select name="overduenoticerequired" value="overduenoticerequired"> >+ [% IF category.overduenoticerequired %] >+ <option value="0">No</option> >+ <option value="1" selected="selected">Yes</option> >+ [% ELSE %] >+ <option value="0" selected="selected">No</option> >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ </li> >+ >+ <li> >+ <label for="category_type" class="required">Category type: </label> >+ <select name="category_type" value="category_type" class='required' required='required'> >+ [% IF category and category.category_type == 'S' %] >+ <option value="S" selected="selected">Staff</option> >+ [% ELSE %] >+ <option value="S">Staff</option> >+ [% END %] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="default_privacy">Default privacy: </label> >+ <select value="default_privacy" name="default_privacy" required="required"> >+ [% SET default_privacy = 'default' %] >+ >+ [% IF category %] >+ [% SET default_privacy = category.default_privacy %] >+ [% END %] >+ >+ [% SWITCH default_privacy %] >+ [% CASE 'forever' %] >+ <option value="default">Default</option> >+ <option value="never">Never</option> >+ <option value="forever" selected="selected">Forever</option> >+ [% CASE 'never' %] >+ <option value="default">Default</option> >+ <option value="never" selected="selected">Never</option> >+ <option value="forever">Forever</option> >+ [% CASE %] >+ <option value="default" selected="selected">Default</option> >+ <option value="never">Never</option> >+ <option value="forever">Forever</option> >+ [% END %] >+ </select> >+ <p>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 <i>batch_anonymise.pl</i> which should be set up by your system administrator.</p> >+ </li> >+ </ol> >+ <span class="label">Enrolment period: </span> >+ </br> >+ <fieldset> >+ <legend>Choose one</legend> >+ <ol> >+ <li> >+ <label for="enrolmentperiod" style="width:6em;">In months: </label> >+ <input type="number" class="enrolmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months >+ </li> >+ <li> >+ <label for="enrolmentperioddate" style="width:6em;">Until date: </label> >+ <input type="text" class="enrolmentperioddate datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> >+ </li> >+ </ol> >+ </fieldset> >+ <br> >+ <input type="submit" class="action" value="Submit" /> >+ </fieldset> >+ </form> >+[% END %] >+ >+[% 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 >new file mode 100644 >index 0000000..e9e56bb >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >@@ -0,0 +1,241 @@ >+<!--Includes for creating patron--> >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Price %] >+[% INCLUDE 'doc-head-open.inc' %] >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END%] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'calendar.inc' %] >+[% INCLUDE 'datatables.inc' %] >+ >+<head> >+<title>Create Koha administrator patron</title> >+ >+<!--jQuery scripts for creating patron--> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> >+ >+<script type="text/javascript"> >+ var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); >+ var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them")); >+ </script> >+ >+<script type="text/javascript"> >+jQuery.validator.addMethod( "password_match", function(value,element){ >+ var MSG_PASSWORD_MISMATCH = (_("The passwords entered do not match")); >+ 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( "letters_only", function(value,element){ >+ var patt =/^[a-zA-Z ]+$/g; >+ if (patt.test(element.value)){ >+ return true; >+ } else { >+ return false; >+ } >+ }, MSG_DESCRIPTION_LETTERS_ONLY >+); >+ >+ >+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_CARDNUMBER_LETTERS_NUMBERS_ONLY >+); >+ >+ >+ >+ >+$(document).ready(function(){ >+ >+ $("#Submit").click(function(){ >+ $("#createpatron").validate({ >+ rules: { >+ surname: { >+ required: true, >+ letters_only: true >+ }, >+ firstname: { >+ required: true, >+ letters_only: true >+ }, >+ cardnumber: { >+ required: true, >+ cardnumber_check: true >+ }, >+ password: { >+ password_match:true >+ } >+ }, >+ messages: { >+ surname: { >+ required: MSG_DESCRIPTION_LETTERS_ONLY >+ }, >+ firstname: { >+ required: MSG_DESCRIPTION_LETTERS_ONLY >+ }, >+ cardnumber: { >+ required: MSG_CARDNUMBER_LETTERS_NUMBERS_ONLY >+ }, >+ password: { >+ required: MSG_PASSWORD_MISMATCH >+ }, >+ } >+ >+ }); >+}); >+}); >+</script> >+</head> >+ >+<div> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+</div> >+ >+ >+[% IF (nok) %] >+ <form name="errors" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="3"/> >+ <h1 align="left">There was an error</h1> >+ <p>Try again </p> >+ <div> >+ <ul> >+ [% IF errorloginexists %] >+ <li id="ERROR_login_exist">Username/password already exists.</li> >+ [% END %] >+ [% IF errorcardnumberexists %] >+ <li id="ERROR_cardnumber">Cardnumber already in use.</li> >+ [% END %] >+ [% IF errorcardnumberlength %] >+ <li id="ERROR_cardnumber">Cardnumber length is incorrect</li> >+ [% END %] >+ [% IF errorshortpassword %] >+ <li id="ERROR_short_password">Password length is incorrect, must be at least [% minPasswordLength %] characters long.</li> >+ [% END %] >+ [% IF errorpasswordmismatch %] >+ <li id="ERROR_password_mismatch">Passwords do not match.</li> >+ [% END %] >+ </ul> >+ >+ </div> >+ <input type="submit" name="step" value="Try again"/> >+ </form> >+ >+ >+<!--Create a patron screen 2--> >+[% ELSIF op == 'add_validate' %] >+ <!--New patron created--> >+ <form name="patrondone" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="4"/> >+ <h1 align="left"> Koha administrator patron </h1> >+ <div> >+ <p> Success: administrator patron created!</p> >+ <p> To create another patron, go to Patrons -> New Patron. <br> >+ More -> Set Permissions in a user page to gain superlibrarian permissions. >+ </div> >+ Next up: >+ <input type="submit" name="start" value="Minimal item type setup"/> >+ </form> >+[% ELSE %] >+<!--Create a patron screen 1--> >+ <h1 align="left"> Create koha administrator patron</h1> >+ <p> >+ Now we will create a patron with superlibrarian permissions. Login with this to access Koha as a staff member will all permissions. >+ </p> >+ <form name="createpatron" id="createpatron" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="3"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <legend id="library_management_lgd">Library management</legend> >+ <ol> >+ <h3>Patron identity</h3> >+ <li> >+ <label for="surname" class="required">Surname: </label> >+ <input type="text" pattern="[a-zA-Z- ]+" title="Please only enter letters in the surname field" id="surname" name="surname" value="[% surname %]" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="firstname" class="required">First name: </label> >+ <input type="text" pattern="[a-zA-Z ]+" title="Please only enter letters in the firstname field" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ >+ <ol> >+ <li> >+ <label for="cardnumber" class="required">Card number: </label> >+ [% IF patrons && patrons > 1 %] >+ <input type="text" pattern="[A-Za-z1-9 ]+" title="Please only enter letters and numbers into the card number field" id="cardnumber" class="noEnterSubmit valid" name="cardnumber" value="[% newcardnumber %]" class="required" required="required"> >+ [% ELSE %] >+ <input type="text" pattern="[A-Za-z1-9 ]+" title="Please only enter letters and numbers into the card number field"id="cardnumber" name="cardnumber" value="[% cardnumber %]" class="required" required="required"> >+ [% END %] >+ <span class="required">Required</span> >+ </li> >+ <li> >+ >+ <!--require a foreach loop to get all the values for the library that the user has either imported (in web installer) or created in the first step of this onboarding tool--> >+ <label for="libraries" class="required"> Library: </label> >+ <select name="libraries" size="1" id="libraries"> >+ >+ [% FOREACH library IN libraries %] >+ <option name="libraries" value="[% library.branchcode %]"> [% library.branchname %] >+ [% END %] >+ >+ </select> >+ <span class="required"> Required</span> >+ </li> >+ <li> >+ <label for="categorycode_entry" class="required"> Patron category</label> >+ <select id="categorycode_entry" name="categorycode_entry" onchange="update_category_code(this);"> >+ [% FOREACH category IN categories %] >+ <option name="categorycode_entry" value = "[% category.categorycode %]">[%category.description %]</option> >+ [% END %] >+ </select> >+ <span class="required">Required</span><br><br> >+ <b>Note:</b> If you installed sample patron categories please select the "Staff" option in the patron categories dropdown box. >+ </li> >+ </ol> >+ >+ <ol> >+ <h3> Koha administrator patron permissions</h3> >+ <input type="hidden" name="newflags" value="1"/> >+ <li> >+ <input type="hidden" class="flag parent" id="flag-0" name="flag" value="superlibrarian"/> >+ <label name="permissioncode" for="flag-0"> superlibrarian</label> >+ </li> >+ </ol> >+ <ol> >+ <h3>OPAC/Staff Login</h3> >+ <li> >+ <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] /> >+ <label for="userid" class="required">Username: </label> >+ <input type="text" name="userid" id ="userid" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this username field" size="20" value="[% userid %]" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="passwordlabel" class="required">Password: </label> >+ <input type="password" name="password" id="password" size="20" value="[% member.password |html %]" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="password2" class="required">Confirm password: </label> >+ <input type="password" id="password2" name="password2" size="20" value="" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset><br> >+ <input type="submit" id="Submit" class="action" value="Submit"/> >+ </form> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt >new file mode 100644 >index 0000000..ce5a48f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt >@@ -0,0 +1,67 @@ >+<!-- includes for creating item type--> >+[% INCLUDE 'doc-head-open.inc' %] >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END%] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+<head> >+ <title>Create item type</title> >+</head> >+<div> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+</div> >+ >+[% IF (itemtypes && itemtypes.count >1) %] >+ >+ <meta http-equiv="refresh" content="0; url=/cgi-bin/koha/installer/onboarding.pl?step=5"> >+ >+[% ELSIF op == "add_validate" %] >+ [% IF message != "error_on_insert" %] >+ <form name="createitemtype" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="5"/> >+ <h1 align="left"> New Item type </h1> >+ <div> >+ <p> Success: New item type created!</p> >+ <p> To create another item type later and for more settings <br> >+ go to: <br> >+ More -> Administration -> Item types <br> >+ </div> >+ Next up: >+ <input type="submit" value="Add a circulation rule"/> >+ </form> >+ [% ELSE %] >+ <form name="retryitem" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="4"/> >+ <h1 align="left">Failed </h1> >+ <div> >+ <p>Item type was not successfully created. </br> >+ Please try again or contact your system administrator. >+ </p> >+ </div> >+ </form> >+ <!--Implement a if statement to check if the item type was successfully created or not --> >+ [% END %] >+[% ELSE %] >+ <!--Create a item type screen 1--> >+ <h1 align="center"> Create a new Item type </h1> >+ <p> Item types are used to group related items. Examples of item types are books, cds, and DVDs. <br><br> When adding to your institutions catalogue you will create an item of a particular item type. <br><br> 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.</p> >+ <form name="createitemform" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="4"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <ol> >+ <li> >+ <label for="itemtype" class="required">Item type code: </label> >+ <input type="text" name="itemtype" pattern="^[A-Za-z]{0,10}$" title="Please enter either 2 or 3 capital letters as the item type" id="itemtype" size="10" maxlength="10" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="description" class="required">Description: </label> >+ <input type="text" name="description" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this item type description" id="description" size="42" value="[% itemtype.description |html %]" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ <br> >+ <input type="submit" class="action" value="Submit"/> >+ </fieldset> >+ </form> >+[% 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 >new file mode 100644 >index 0000000..1142124 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >@@ -0,0 +1,127 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Create Circulation rule</title> >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+ >+<div> >+ <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/> Welcome to Koha</h1> >+</div> >+ >+[% IF (finish) %] >+<h1>Congratulations you have finished and ready to use Koha</h1> >+<a href="/cgi-bin/koha/mainpage.pl">Start using Koha</a> >+ >+[% END %] >+ >+<!--Create a circulation rule screen 2--> >+[% IF op == "add_validate" %] >+ <!--New circulation rule created--> >+ <form name="finish" method="post" action="onboarding.pl"> >+ <input type="hidden" name="op" value="finish" /> >+ <h1 align="left"> New circulation rule </h1> >+ <div> >+ <p> Success: circulation rule created!</p> >+ <p> To create circulation rule, go to <br> >+ More -> Administration -> Circulation and Fine Rules >+ </div> >+ Next up: >+ <input type="submit" name="op" value="Finish"/> >+ </form> >+[% ELSE %] >+<!--Create a circulation rule screen 1--> >+ <h1 align="left"> Create a new circulation rule </h1> >+ <form name="createcirculationrule" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="5"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <ol> >+ <li> >+ <label for="branch" class="required"> Library branch</label> >+ <select name="branch" id="branchname" required="required"> >+ <option value""> Choose</option> >+ <option value="*" selected="selected">All</option> >+ [% FOREACH library IN libraries %] >+ <option id="branch" value="[% library.branchcode %]"> [% library.branchname %]</option> >+ [% END %] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="categorycode" class="required">Patron category: </label> >+ <select name="categorycode" id="categorycodeselection" required="required" onchange = "update_categorycode(this);"> >+ <option value=""> Choose</option> >+ <option value="*" selected="selected">All</option> >+ [% FOREACH category IN categories %] >+ <option id="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option> >+ [%END%] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="itemtype"> Item type: </label> >+ <select id="itemtype" name="itemtype" required="required"> >+ <option value""> Choose </option> >+ <option value="*" selected="selected">All</option> >+ [% FOREACH item IN itemtypes %] >+ <option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %] >+ [%END%] >+ </select> >+ <span class="required"> Required</span> >+ </li> >+ <li> >+ <label for="maxissueqty" class="required">Current checkouts allowed: </label> >+ <input type="number" min="0" name="maxissueqty" title="Please only enter numbers" id="maxissueqty" size="10" max="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="issuelength" class="required">Loan period: </label> >+ <input type="number" min="0" name="issuelength" title="Please only enter numbers" id="issuelength" size="10" max="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="lengthunit">Units: </label> >+ <select name="lengthunit" id="lengthunit" required="required"> >+ <option value=""> Choose </option> >+ [% SET units = 'days' %] >+ [% IF category %] >+ [% SET default_privacy = category.default_privacy %] >+ [% END %] >+ >+ [% SWITCH units %] >+ [% CASE 'days' %] >+ <option value="days" selected="selected">Days</option> >+ <option value="hours">Hours</option> >+ [% CASE 'hours' %] >+ <option value="days">Days</option> >+ <option value="hours" selected="selected">Hours</option> >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="renewalsallowed" class="required">Renewals allowed: </label> >+ <input type="number" min="0" name="renewalsallowed" title="Please only enter numbers" id="renewalsallowed" size="10" max="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="renewalperiod" class="required">Renewals period: </label> >+ <input type="number" min="0" name="renewalperiod" title="Please only enter numbers" id="renewalperiod" size="10" max="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="onshelfholds">On shelf holds allowed: </label> >+ <select name="onshelfholds" id="onshelfholds" required="required"> >+ <option value="">Choose</option> >+ <option value="yes" selected="selected">Yes</option> >+ <option value="anyunavailable">If any unavailable</option> >+ <option value="allunavailable">If all unavailable</option> >+ </select> >+ </li> >+ </ol> >+ </fieldset><br> >+ <input type="submit" class="action" value="Submit"/> >+ </form> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt >new file mode 100644 >index 0000000..f7fe9a4 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt >@@ -0,0 +1,41 @@ >+[% USE Koha %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha Tutorial Summary</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+<body id="admin_admin-home" class="admin"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'cat-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Summary</div> >+ >+<div id="doc" class="yui-t7"> >+ <div id="bd"> >+ <div id="yui-main" class="sysprefs"> >+ <div class="yui-g"><h1>Tutorial Summary Page</h1></div> >+ <fieldset style="font-size:120%"> >+ <h2>Library</h2> >+ <p> To add another library and for more settings, go to </br> >+ More -> Administration -> Libraries and groups </p> OR<br> >+ >+ <h2>Patron Category</h2> >+ <p>To add another patron category and for more settings, go to</br> >+ More -> Administration -> Patron Categories</p> OR <br> >+ >+ <h2>Patron</h2> >+ <p>To create another patron, go to Patrons -> New Patron. To set the </br> >+ permissions of the patron, go to the patron's page and More -> Set Permissions</p> >+ >+ <h2>Item Type</h2> >+ <p>To create another item type and for more settings, go to</br> >+ More -> Administration -> Item types </p> OR <br> >+ >+ <h2>Circulation Rule</h2> >+ <p>To create another circulation rule, go to </br> >+ More -> Administration -> Circulation and Fine Rules</p> >+ </fieldset> >+ >+ </div> >+ </div> >+</div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/summary.pl b/summary.pl >new file mode 100755 >index 0000000..f1d41b4 >--- /dev/null >+++ b/summary.pl >@@ -0,0 +1,43 @@ >+#!/usr/bin/perl >+ >+# Copyright Pat Eyler 2003 >+# Copyright Biblibre 2006 >+# Parts Copyright Liblime 2008 >+# Parts Copyright Chris Nighswonger 2010 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use CGI qw ( -utf8 ); >+use C4::Auth; >+use C4::Output; >+use C4::Context; >+use C4::Koha; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "summary.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { catalogue => 1 }, >+ debug => 1, >+ } >+); >+ >+ >+output_html_with_http_headers $query, $cookie, $template->output; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17855
:
58657
|
58658
|
58659
|
58660
|
58661
|
58662
|
58663
|
58664
|
58665
|
58666
|
58667
|
58668
|
58669
|
58781
|
58782
|
58783
|
58784
|
58785
|
58792
|
58793
|
58794
|
58846
|
58860
|
58861
|
58862
|
58886
|
58892
|
58893
|
58894
|
58895
|
58896
|
58897
|
58898
|
58899
|
58900
|
58901
|
58902
|
58903
|
58904
|
58905
|
58906
|
58907
|
59037
|
59051
|
59140
|
59141
|
59174
|
59188
|
59277
|
59279
|
59280
|
59281
|
59628
|
59703
|
59705
|
59706
|
59707
|
59708
|
59709
|
59710
|
59711
|
59712
|
59742
|
59826
|
59830
|
59840
|
59841
|
59842
|
59856
|
59857
|
60092
|
61667
|
61668
|
61986
|
62186
|
62191
|
62192
|
62193
|
62220
|
62221
|
62222
|
62223
|
62231
|
62233
|
62234
|
62235
|
62236
|
62237
|
62238
|
62239
|
62240
|
62241
|
62242
|
62243
|
62251
|
62252
|
62253
|
62254
|
62255
|
62256
|
62257
|
62258
|
62259
|
62260
|
62261
|
62262
|
62263
|
62281
|
62282
|
62283
|
62284
|
62285
|
62286
|
62287
|
62288
|
62668
|
62669
|
62670
|
62671
|
62672
|
62673
|
62674
|
62675