From a4d6f27b553626d0964f1c5a36cfb2934b607538 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 20 Feb 2017 10:49:11 +0100 Subject: [PATCH] Bug 18026: Correct URL to database columns from .pref files [3.22.x] Recently the DB schema website has been updated. The link to the columns' tables is now http://schema.koha-community.org/master/tables/table.html http://schema.koha-community.org/16_11/tables/table.html http://schema.koha-community.org/16_05/tables/table.html instead of http://schema.koha-community.org/tables/table.html To have a specific schema per Koha version. To avoid fixing this link every release this patch adds a __VERSION__ marker to replace with the $version if stable ($version % 2) or 'master' Test plan: On master, 16.11.x and 16.05.x Search for PatronSelfRegistrationBorrowerUnwantedField, BorrowerMandatoryField and UniqueItemFields Click on the link You should get the correct page NOTE: The master vs stable release logic changed when the major number became the YY format. This corrects the backported logic. Signed-off-by: Mark Tompsett --- Koha/Template/Plugin/Koha.pm | 1 + admin/preferences.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/acquisitions.pref | 2 +- .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 4 ++-- .../intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref | 4 ++-- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index fc26316..0532a04 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -51,6 +51,7 @@ sub Version { return { major => $major, + minor => $minor, release => $major . "." . $minor, maintenance => $major . "." . $minor . "." . $maintenance, development => ( $development ne '000' ) ? $development : undef, diff --git a/admin/preferences.pl b/admin/preferences.pl index a01e212..6c667d7 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -186,6 +186,15 @@ sub TransformPrefsToHTML { push @chunks, $piece; } } else { + if ( $piece ) { + my $version = Koha::version(); + my ( $major, $minor, $maintenance, $development ) = split( '\.', $version ); + if ( $minor % 2 == 0 ) { + $piece =~ s|__VERSION__|${major}_${minor}|g; + } else { + $piece =~ s|__VERSION__|master|g; + } + } push @chunks, { type_text => 1, contents => $piece }; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index 3d6e264..a0f2383 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -9,7 +9,7 @@ Acquisitions: receiving: receiving an order. cataloguing: cataloging the record. - - - "The following database columns should be unique in an item:" + - "The following database columns should be unique in an item:" - pref: UniqueItemFields - (separated by a space) - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index b6c9936..d63fc6f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -677,12 +677,12 @@ OPAC: class: integer - "days." - - - "The following database columns must be filled in on the patron entry screen:" + - "The following database columns must be filled in on the patron entry screen:" - pref: PatronSelfRegistrationBorrowerMandatoryField class: multi - (separate columns with |) - - - "The following database columns will not appear on the patron entry screen:" + - "The following database columns will not appear on the patron self-registration screen:" - pref: PatronSelfRegistrationBorrowerUnwantedField class: multi - (separate columns with |) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index da7e7f4..a5654e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -24,12 +24,12 @@ Patrons: no: "Don't" - default the card number field on the patron addition screen to the next available card number (for example, if the largest currently used card number is 26345000012941, then this field will default to 26345000012942). - - - "The following database columns must be filled in on the patron entry screen:" + - "The following database columns must be filled in on the patron entry screen:" - pref: BorrowerMandatoryField class: multi - (separate columns with |) - - - "The following database columns will not appear on the patron entry screen:" + - "The following database columns will not appear on the patron entry screen:" - pref: BorrowerUnwantedField class: multi - (separate columns with |) -- 2.1.4