Bugzilla – Attachment 172230 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: (follow-up) Split serial sequence upon editing and server
Bug-24172-follow-up-Split-serial-sequence-upon-edi.patch (text/plain), 10.12 KB, created by
Nick Clemens (kidclamp)
on 2024-09-30 16:03:03 UTC
(
hide
)
Description:
Bug 24172: (follow-up) Split serial sequence upon editing and server
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-09-30 16:03:03 UTC
Size:
10.12 KB
patch
obsolete
>From cbebf179c8ccff4b2c3b89a3951579038db78552 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 30 Sep 2024 15:56:54 +0000 >Subject: [PATCH] Bug 24172: (follow-up) Split serial sequence upon editing and > server > >This patch checks whether we find a season match in the numeration when editing/receiving a serial. If so, >we split the input into three boxes, the before string, the season as a dropdown, and the after string. > >The dropdown visible values wil be transalated, however, the values will be in English. >It's a bit ugly, but it works. > >To test: >1 - Apply patch, update translation >2 - Receive some issues of the serial >3 - Try receiving in English or your other lang >4 - Confirm values are saved in English in the DB either way >5 - Confirm issues show in the currently selected language either way >6 - Test with a non-seasonal serial, confirm no changes >--- > .../prog/en/includes/localizer.inc | 101 ++++++++++++++++-- > .../prog/en/modules/serials/serials-edit.tt | 14 ++- > 2 files changed, 103 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc >index 864dbc276f3..3045f83dff1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/localizer.inc >@@ -1,21 +1,104 @@ > [%~ BLOCK localize_numbering_pattern_season ~%] > [%~ IF ( matches = season.match('(.*)Spring(.*)') ) ~%] >- [%~ matches.0 | html ~%]Spring[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Spring</span>[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Summer(.*)') ) ~%] >- [%~ matches.0 | html ~%]Summer[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Summer<span>[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Fall(.*)') ) ~%] >- [%~ matches.0 | html ~%]Fall[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Fall[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Winter(.*)') ) ~%] >- [%~ matches.0 | html ~%]Winter[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Winter[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Spr(.*)') ) ~%] >- [%~ matches.0 | html ~%]Spr[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Spr</span>[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Sum(.*)') ) ~%] >- [%~ matches.0 | html ~%]Sum[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Sum</span>[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Fal(.*)') ) ~%] >- [%~ matches.0 | html ~%]Fal[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Fal</span>[%~ matches.1 | html ~%] > [%~ ELSIF ( matches = season.match('(.*)Win(.*)') ) ~%] >- [%~ matches.0 | html ~%]Win[%~ matches.1 | html ~%] >+ [%~ matches.0 | html ~%]<span>Win</span>[%~ matches.1 | html ~%] > [%~ ELSE ~%] > [%~ season | html ~%] > [%~ END ~%] >-[%~ END ~%] >\ No newline at end of file >+[%~ END ~%] >+[%~ BLOCK localize_numbering_pattern_season_input ~%] >+ [%~ IF ( matches = season.match('(.*)Spring(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown cur_season => 'Spring' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Summer(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown cur_season => 'Summer' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Fall(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown cur_season => 'Fall' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Winter(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown cur_season => 'Winter' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Spr(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown_abrv cur_season => 'Spr' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Sum(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown_abrv cur_season => 'Sum' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Fal(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown_abrv cur_season => 'Fal' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSIF ( matches = season.match('(.*)Win(.*)') ) ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.0 | html ~%]"> >+ [% PROCESS localize_numbering_pattern_season_dropdown_abrv cur_season => 'Win' %] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ matches.1 | html ~%]"> >+ [%~ ELSE ~%] >+ <input class="numbering_parts serial_id_[%serialid | html %]" type="text" value="[%~ season | html ~%]"> >+ [%~ END ~%] >+[%~ END ~%] >+[%~ BLOCK localize_numbering_pattern_season_dropdown ~%] >+ <select class="numbering_parts serial_id_[%serialid | html %]" name="season_dropdown"> >+ [% IF ( cur_season == 'Spring' ) %] >+ <option selected="selected" value='Spring'>Spring</option> >+ [% ELSE %] >+ <option value='Spring'>Spring</option> >+ [% END %] >+ [% IF ( cur_season == 'Summer' ) %] >+ <option selected="selected" value='Summer'>Summer</option> >+ [% ELSE %] >+ <option value='Summer'>Summer</option> >+ [% END %] >+ [% IF ( cur_season == 'Fall' ) %] >+ <option selected="selected" value='Fall'>Fall</option> >+ [% ELSE %] >+ <option value='Fall'>Fall</option> >+ [% END %] >+ [% IF ( cur_season == 'Winter' ) %] >+ <option selected="selected" value='Winter'>Winter</option> >+ [% ELSE %] >+ <option value='Winter'>Winter</option> >+ [% END %] >+[%~ END ~%] >+[%~ BLOCK localize_numbering_pattern_season_dropdown_abrv ~%] >+ <select class="numbering_parts serial_id_[%serialid | html %]" name="season_dropdown"> >+ [% IF ( cur_season == 'Spr' ) %] >+ <option selected="selected" value='Spr'>Spr</option> >+ [% ELSE %] >+ <option value='Spr'>Spr</option> >+ [% END %] >+ [% IF ( cur_season == 'Sum' ) %] >+ <option selected="selected" value='Sum'>Sum</option> >+ [% ELSE %] >+ <option value='Sum'>Sum</option> >+ [% END %] >+ [% IF ( cur_season == 'Fal' ) %] >+ <option selected="selected" value='Fal'>Fal</option> >+ [% ELSE %] >+ <option value='Fall'>Fal</option> >+ [% END %] >+ [% IF ( cur_season == 'Win' ) %] >+ <option selected="selected" value='Win'>Win</option> >+ [% ELSE %] >+ <option value='Win'>Win</option> >+ [% END %] >+[%~ 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 fcc19e40223..551fdb77299 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 >@@ -73,6 +73,15 @@ $(document).ready(function() { > return true; > }); > >+ $(".numbering_parts").change(function(){ >+ let num_parts = $(this).parent('td').children(".numbering_parts"); >+ let new_val = ""; >+ num_parts.each(function(){ >+ new_val += $(this).val(); >+ }); >+ let num_total = $(this).parent('td').children('.serialseq_hidden'); >+ num_total.val( new_val ); >+ }); > $("#toggle_skip_issues").on("change", function() { > if (this.checked) { > $("#skip_issues").removeClass("collapse").prop("disabled", false); >@@ -160,9 +169,8 @@ $(document).ready(function() { > <input type="hidden" name="biblionumber" value="[% serialslis.biblionumber | html %]" /> > <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="[% PROCESS localize_numbering_pattern_season season => serialslis.serialseq %]" >- size="20" maxlength="100" /> >+ <input type="hidden" name="serialseq" class="serialseq_hidden" id="serialseq[% serialslis.serialid | html %]" value="[% serialslis.serialseq | html %]" /> >+ Issue [% PROCESS localize_numbering_pattern_season_input season => serialslis.serialseq serialid => serialslis.serialid %] > </td> > <td> > <input type="text" name="publisheddate" value="[% serialslis.publisheddate | html %]" size="10" maxlength="15" class="flatpickr" /> >-- >2.39.5
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