Bugzilla – Attachment 100888 Details for
Bug 24172
Locale is ignored when saving season name in the database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24172: Move duplicated code to an include file
Bug-24172-Move-duplicated-code-to-an-include-file.patch (text/plain), 13.95 KB, created by
Jonathan Druart
on 2020-03-17 11:48:54 UTC
(
hide
)
Description:
Bug 24172: Move duplicated code to an include file
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-17 11:48:54 UTC
Size:
13.95 KB
patch
obsolete
>From 7cd64260d6e38081285eb10083fd8639b7a61765 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 17 Mar 2020 12:38:40 +0100 >Subject: [PATCH] Bug 24172: Move duplicated code to an include file > >--- > .../prog/en/includes/localizer.inc | 21 +++++++++++++++++++ > .../prog/en/modules/catalogue/detail.tt | 21 ++----------------- > .../en/modules/serials/serials-collection.tt | 21 ++----------------- > .../prog/en/modules/serials/serials-edit.tt | 3 ++- > .../modules/serials/showpredictionpattern.tt | 21 ++----------------- > .../en/modules/serials/subscription-detail.tt | 21 ++----------------- > 6 files changed, 31 insertions(+), 77 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc >new file mode 100644 >index 0000000000..fcc527f9e0 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc >@@ -0,0 +1,21 @@ >+[%~ BLOCK localize_numbering_pattern_season ~%] >+ [%~ IF ( matches = season.match('(.*)Spring(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Spring[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Summer(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Summer[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Fall(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Fall[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Winter(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Winter[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Spr(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Spr[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Sum(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Sum[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Fal(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Fal[%~ matches.1 | html ~%] >+ [%~ ELSIF ( matches = season.match('(.*)Win(.*)') ) ~%] >+ [%~ matches.0 | html ~%]Win[%~ matches.1 | html ~%] >+ [%~ ELSE ~%] >+ [%~ season | html ~%] >+ [%~ END ~%] >+[%~ END ~%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 01db250218..cd3ee632e5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -6,6 +6,7 @@ > [% USE Branches %] > [% USE Biblio %] > [% USE ColumnsSettings %] >+[% PROCESS 'localizer.inc' %] > [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] > [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] > >@@ -580,25 +581,7 @@ Note that permanent location is a code, and location may be an authval. > [% FOREACH latestserial IN subscription.latestserials %] > <tr> > <td> >- [% IF ( matches = latestserial.serialseq.match('(.*)Spring(.*)') ) %] >- [% matches.0 | html %]Spring[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Summer(.*)') ) %] >- [% matches.0 | html %]Summer[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Fall(.*)') ) %] >- [% matches.0 | html %]Fall[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Winter(.*)') ) %] >- [% matches.0 | html %]Winter[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Spr(.*)') ) %] >- [% matches.0 | html %]Spr[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Sum(.*)') ) %] >- [% matches.0 | html %]Sum[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Fal(.*)') ) %] >- [% matches.0 | html %]Fal[% matches.1 | html %] >- [% ELSIF ( matches = latestserial.serialseq.match('(.*)Win(.*)') ) %] >- [% matches.0 | html %]Win[% matches.1 | html %] >- [% ELSE %] >- [% latestserial.serialseq | html %] >- [% END %] >+ [% PROCESS localize_numbering_pattern_season season => latestserial.serialseq %] > </td> > <td><span title="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</span></td> > <td><span title="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</span></td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index 7d4310d406..3ec7576ba4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -3,6 +3,7 @@ > [% USE AuthorisedValues %] > [% USE Branches %] > [% USE KohaDates %] >+[% PROCESS 'localizer.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Serial collection information for [% bibliotitle | html %]</title> >@@ -200,25 +201,7 @@ > </span> > </td> > <td> >- [% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %] >- [% matches.0 | html %]Spring[% matches.1 | html %] >- [% ELSIF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %] >- [% matches.0 | html %]Summer[% matches.1 | html %] >- [% ELSIF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %] >- [% matches.0 | html %]Fall[% matches.1 | html %] >- [% ELSIF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %] >- [% matches.0 | html %]Winter[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %] >- [% matches.0 | html %]Spr[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %] >- [% matches.0 | html %]Sum[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %] >- [% matches.0 | html %]Fal[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %] >- [% matches.0 | html %]Win[% matches.1 | html %] >- [% ELSE %] >- [% serial.serialseq | html %] >- [% END %] >+ [% PROCESS localize_numbering_pattern_season season => serial.serialseq %] > </td> > <td> > [% IF ( serial.status1 ) %]Expected[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index 538fdcacf4..e74c15eac5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Asset %] > [% USE AuthorisedValues %] >+[% PROCESS 'localizer.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Serial edition [% bibliotitle | html %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -127,7 +128,7 @@ $(document).ready(function() { > <input type="hidden" name="itemcount" value="[% serialslis.issuesatonce | html %]" /> > <input type="hidden" name="user" value="[% serialslis.librarian | html %]" /> > Issue <input type="text" name="serialseq" id="serialseq[% serialslis.serialid | html %]" >- value="[% IF ( matches = serialslis.serialseq.match('(.*)Spring(.*)') ) %][% matches.0 | html %]Spring[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Summer(.*)') ) %][% matches.0 | html %]Summer[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Fall(.*)') ) %][% matches.0 | html %]Fall[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Winter(.*)') ) %][% matches.0 | html %]Winter[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Spr(.*)') ) %][% matches.0 | html %]Spr[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Sum(.*)') ) %][% matches.0 | html %]Sum[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Fal(.*)') ) %][% matches.0 | html %]Fal[% matches.1 | html %][% ELSIF ( matches = serialslis.serialseq.match('(.*)Win(.*)') ) %][% matches.0 | html %]Win[% matches.1 | html %][% ELSE %][% serialslis.serialseq | html %][% END %]" >+ value="[% PROCESS localize_numbering_pattern_season season => serialslis.serialseq %]" > size="20" maxlength="100" /> > </td> > <td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt >index c684348deb..fdb7e43c71 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% PROCESS 'localizer.inc' %] > <h2>Prediction pattern</h1> > [% IF (not_consistent_end_date) %] > <p><em>End date is not consistent with subscription length.</em></p> >@@ -41,25 +42,7 @@ > [% FOREACH prediction IN predictions_loop %] > <tr> > <td> >- [% IF ( matches = prediction.number.match('(.*)Spring(.*)') ) %] >- [% matches.0 | html %]Spring[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Summer(.*)') ) %] >- [% matches.0 | html %]Summer[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Fall(.*)') ) %] >- [% matches.0 | html %]Fall[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Winter(.*)') ) %] >- [% matches.0 | html %]Winter[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %] >- [% matches.0 | html %]Spr[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %] >- [% matches.0 | html %]Sum[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %] >- [% matches.0 | html %]Fal[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %] >- [% matches.0 | html %]Win[% matches.1 | html %] >- [% ELSE %] >- [% prediction.number | html %] >- [% END %] >+ [% PROCESS localize_numbering_pattern_season season => prediction.number %] > </td> > <td> > [% IF (prediction.publicationdate) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index dea84abf17..7e28f35b8a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -7,6 +7,7 @@ > [% USE Price %] > [% USE ColumnsSettings %] > [% SET footerjs = 1 %] >+[% PROCESS 'localizer.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Details for subscription #[% subscriptionid | html %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -308,25 +309,7 @@ > [% FOREACH serialslis IN serialslist %] > <tr> > <td> >- [% IF ( matches = serialslis.serialseq.match('(.*)Spring(.*)') ) %] >- [% matches.0 | html %]Spring[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Summer(.*)') ) %] >- [% matches.0 | html %]Summer[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Fall(.*)') ) %] >- [% matches.0 | html %]Fall[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Winter(.*)') ) %] >- [% matches.0 | html %]Winter[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Spr(.*)') ) %] >- [% matches.0 | html %]Spr[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Sum(.*)') ) %] >- [% matches.0 | html %]Sum[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Fal(.*)') ) %] >- [% matches.0 | html %]Fal[% matches.1 | html %] >- [% ELSIF ( matches = serialslis.serialseq.match('(.*)Win(.*)') ) %] >- [% matches.0 | html %]Win[% matches.1 | html %] >- [% ELSE %] >- [% serialslis.serialseq | html %] >- [% END %] >+ [% PROCESS localize_numbering_pattern_season season => serialslis.serialseq %] > </td> > <td> > [% IF serialslis.planneddate %] >-- >2.20.1
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 24172
:
95996
|
95998
|
96051
|
100331
|
100332
|
100888
|
139803
|
139804
|
139805
|
139806
|
139807
|
139808
|
139809
|
148921
|
151330
|
158671
|
170319
|
171104
|
172223
|
172230
|
174095