Bugzilla – Attachment 98873 Details for
Bug 20307
Language overlay for authorized values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20307: Code for AVs must be category and value
Bug-20307-Code-for-AVs-must-be-category-and-value.patch (text/plain), 4.40 KB, created by
Martin Renvoize (ashimema)
on 2020-02-13 16:09:51 UTC
(
hide
)
Description:
Bug 20307: Code for AVs must be category and value
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-13 16:09:51 UTC
Size:
4.40 KB
patch
obsolete
>From 35ee21eadd63f38569da864c6a506d8fac7551ab Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 19 Aug 2019 16:15:38 -0400 >Subject: [PATCH] Bug 20307: Code for AVs must be category and value > >And not only the authorized value, otherwise we could not handle the >case where 2 categories have an identical authorized value. > >FIXME: When editing an AV, if you translate then change the AV's value, >we will have inconsistent data, we should add some JS code to disable >the translate link if the AV's value is modified. I would suggest to do >it on a follow-up bug. > >Signed-off-by: Michal Denar <black23@gmail.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/AuthorisedValue.pm | 6 +++--- > .../prog/en/modules/admin/authorised_values.tt | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm >index 08f77f24b2..8eee2fc450 100644 >--- a/Koha/AuthorisedValue.pm >+++ b/Koha/AuthorisedValue.pm >@@ -68,7 +68,7 @@ sub opac_translated_description { > } > $lang ||= C4::Languages::getlanguage; > my $translated_description = Koha::Localizations->search({ >- code => $self->authorised_value, >+ code => sprintf "%s_%s", $self->category, $self->authorised_value, > entity => 'authorised_values', > lang => $lang, > interface => 'opac', >@@ -94,7 +94,7 @@ sub translated_description { > } > $lang ||= C4::Languages::getlanguage; > my $translated_description = Koha::Localizations->search({ >- code => $self->authorised_value, >+ code => sprintf "%s_%s", $self->category, $self->authorised_value, > entity => 'authorised_values', > lang => $lang, > })->next; >@@ -111,7 +111,7 @@ sub translated_descriptions { > my ( $self ) = @_; > my @translated_descriptions = Koha::Localizations->search( > { entity => 'authorised_values', >- code => $self->authorised_value, >+ code => sprintf "%s_%s", $self->category, $self->authorised_value, > } > ); > return [ map { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 4021243fdb..1efe5967e8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -77,7 +77,7 @@ > <input type="text" name="lib" id="lib" value="[% lib | html %]" maxlength="200" /> > [% IF can_be_translated %] > [% IF action_modify %] >- <a href="/cgi-bin/koha/admin/localization.pl?entity=authorised_values&code=[% authorised_value | uri %]&interface=intranet"" title="Translate description" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a> >+ <a href="/cgi-bin/koha/admin/localization.pl?entity=authorised_values&code=[% category | uri %]_[% authorised_value | uri %]&interface=intranet"" title="Translate description" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a> > [% ELSE %] > <a href="#" class="disabled" title="The authorized value has to be saved to make it translatable"><i class="fa fa-pencil"></i> Translate into other languages</a> > [% END %] >@@ -88,7 +88,7 @@ > <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac | html %]" maxlength="200" /> > [% IF can_be_translated %] > [% IF action_modify %] >- <a href="/cgi-bin/koha/admin/localization.pl?entity=authorised_values&code=[% authorised_value | uri %]&interface=opac" title="Translate OPAC description" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a> >+ <a href="/cgi-bin/koha/admin/localization.pl?entity=authorised_values&code=[% category | uri %]_[% authorised_value | uri %]&interface=opac" title="Translate OPAC description" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a> > [% ELSE %] > <a href="#" class="disabled" title="The authorized value has to be saved to make it translatable"><i class="fa fa-pencil"></i> Translate into other languages</a> > [% END %] >-- >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 20307
:
86622
|
86623
|
86624
|
86625
|
86626
|
86627
|
89538
|
91645
|
91646
|
91647
|
91648
|
91649
|
91650
|
91651
|
91653
|
92192
|
92193
|
92359
|
92360
|
92361
|
94245
|
94246
|
94247
|
94248
|
94249
|
94250
|
94251
|
94252
|
94253
|
94254
|
94255
|
94256
|
94700
|
94701
|
94702
|
94703
|
94704
|
94705
|
94706
|
94707
|
94708
|
94709
|
94710
|
94711
|
97074
|
97075
|
98863
|
98864
|
98865
|
98866
|
98867
|
98868
|
98869
|
98870
|
98871
|
98872
| 98873 |
98874
|
98875
|
98876
|
101070
|
101450