Bugzilla – Attachment 59840 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]
Bug 17855 - Follow up on copyright text, removal of summary info, removal of duplicate js and improved js indentation, removed useless use pragmas
Bug-17855---Follow-up-on-copyright-text-removal-of.patch (text/plain), 20.20 KB, created by
Mark Tompsett
on 2017-02-03 04:53:02 UTC
(
hide
)
Description:
Bug 17855 - Follow up on copyright text, removal of summary info, removal of duplicate js and improved js indentation, removed useless use pragmas
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-02-03 04:53:02 UTC
Size:
20.20 KB
patch
obsolete
>From fe004917a6c74ff58b1e1557624a9a599f2ed5ea Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 3 Feb 2017 10:19:57 +1300 >Subject: [PATCH] Bug 17855 - Follow up on copyright text, removal of summary > info, removal of duplicate js and improved js indentation, removed useless > use pragmas > >Tets plan: Same as outlined in previous comments: >Go to and go through the web installer and onboarding tool: >https://koha-community.org/manual/installation/html/ > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > installer/onboarding.pl | 10 +- > .../intranet-tmpl/prog/en/includes/header.inc | 2 - > .../prog/en/modules/onboarding/onboardingstep2.tt | 240 +-------------------- > .../prog/en/modules/onboarding/onboardingstep3.tt | 50 ++--- > koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt | 41 ---- > summary.pl | 43 ---- > 6 files changed, 25 insertions(+), 361 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt > delete mode 100755 summary.pl > >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index 6773f8f..aea7395 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -2,7 +2,7 @@ > > # This file is part of Koha. > # >-# Copyright (C) YEAR YOURNAME-OR-YOUREMPLOYER >+# Copyright (C) 2017 Catalyst IT > # > # Koha is free software; you can redistribute it and/or modify it > # under the terms of the GNU General Public License as published by >@@ -27,11 +27,6 @@ use Encode qw( encode ); > use C4::Koha; > use C4::Output; > use C4::Members; >-use C4::Members::Attributes; >-use C4::Members::AttributeTypes; >-use C4::Log; >-use Koha::AuthorisedValues; >-use Koha::Patron::Debarments; > use Koha::Patrons; > use Koha::Items; > use Koha::Libraries; >@@ -39,12 +34,9 @@ use Koha::Database; > use Koha::DateUtils; > use Koha::Patron::Categories; > use Koha::Patron::Category; >-use Koha::Patron::HouseboundRole; >-use Koha::Patron::HouseboundRoles; > use Koha::ItemTypes; > use Koha::IssuingRule; > use Koha::IssuingRules; >-use Data::Dumper; > > #Setting variables > my $input = new CGI; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 7c5c2c0..2c88c6c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -42,8 +42,6 @@ > <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/modules/onboarding/onboardingstep2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >index 86b68f2..f0e90aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt >@@ -1,4 +1,3 @@ >-<!--Pragmas for using and including packages for create patron category--> > [% USE Koha %] > [% USE KohaDates %] > [% USE Price %] >@@ -6,181 +5,12 @@ > <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> >- >- >+[% INCLUDE 'js_includes.inc' %] >+[% INCLUDE 'datatables.inc' %] > <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.")); >-</script> >- >-<script type="text/javascript"> >-jQuery.validator.addMethod( "category_code_check", function(value,element){ >- var patt = /[0-9A-Za-z]{1,10}$/g; >- if (patt.test(element.value)) { >- return true; >- } else { >- return false; >- } >- }, MSG_CATEGORYCODE_CHARS >-); > > jQuery.validator.addMethod( "enrollment_period", function(){ > enrolmentperiod = $("#enrolmentperiod").val(); >@@ -190,72 +20,10 @@ jQuery.validator.addMethod( "enrollment_period", function(){ > } else { > return true; > } >- }, MSG_ONLY_ONE_ENROLLMENTPERIOD >+ }, MSG_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, >- }, >- enrolmentperiod: { >- required: function(element){ >- return $("#enrolmentperioddate").val() === ""; >- }, >- digits: true, >- enrollment_period: true, >- }, >- enrolmentperioddate: { >- required: function(element){ >- return $("#enrolmentperiod").val() === ""; >- }, >- enrollment_period: true, >- }, >- dateofbirthrequired: { >- digits: true >- }, >- upperagelimit: { >- digits: true >- }, >- enrolmentfee: { >- number: true >- }, >- reservefee: { >- number: true >- }, >- category_type: { >- required: true >- } >- }, >- messages: { >- categorycode: { >- required: MSG_CATEGORYCODE_CHARS >- }, >- enrolmentperiod: { >- required: MSG_ONE_ENROLLMENTPERIOD >- }, >- enrolmentperioddate: { >- required: MSG_ONE_ENROLLMENTPERIOD >- } >- } >- }); >-}); >- > </script> >+<script type="text/javascript" src="[% themelang %]/js/categories.js"></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--> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >index a484835..de2e595 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt >@@ -7,39 +7,30 @@ > [% INCLUDE 'installer-doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+[% INCLUDE 'js_includes.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_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")); >+ jQuery.validator.addMethod( "password_match", function(value,element){ > var password = document.getElementById('password').value > var confirmpassword = document.getElementById('password2').value >- > if ( password != confirmpassword ){ >- return false; >- } >- else{ >- return true >- } >- }, MSG_PASSWORD_MISMATCH >+ return false; >+ } >+ else{ >+ return true >+ } >+ }, MSG_PASSWORD_MISMATCH > ); > > $(document).ready(function(){ >- >- $("#Submit").click(function(){ >- $("#createpatron").validate({ >- rules: { >+ $("#Submit").click(function(){ >+ $("#createpatron").validate({ >+ rules: { > surname: { > required: true, > }, >@@ -49,18 +40,17 @@ $(document).ready(function(){ > cardnumber: { > required: true, > }, >- password: { >+ password: { > password_match:true > } >- }, >- messages: { >- password: { >+ }, >+ messages: { >+ password: { > required: MSG_PASSWORD_MISMATCH >- }, >- } >- >- }); >-}); >+ }, >+ } >+ }); >+ }); > }); > </script> > </head> >@@ -184,7 +174,7 @@ $(document).ready(function(){ > <ol> > <h3>OPAC/Staff Login</h3> > <li> >- <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] /> >+ <input type="hidden" name="BorrowerMandatoryField" value = "[% BorrowerMandatoryField %]" /> > <label for="userid" class="required">Username: </label> > <input type="text" name="userid" id ="userid" size="20" title="Please only enter a username of letters and numbers" value="[% userid |html %]" class="required" required="required" /> > <span class="required">Required</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt >deleted file mode 100644 >index f7fe9a4..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt >+++ /dev/null >@@ -1,41 +0,0 @@ >-[% 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 >deleted file mode 100755 >index f1d41b4..0000000 >--- a/summary.pl >+++ /dev/null >@@ -1,43 +0,0 @@ >-#!/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