Bugzilla – Attachment 94709 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: Use 'auhorised_values' instead of 'avs' to avoid confusion
Bug-20307-Use-auhorisedvalues-instead-of-avs-to-av.patch (text/plain), 6.30 KB, created by
Michal Denar
on 2019-10-24 21:44:51 UTC
(
hide
)
Description:
Bug 20307: Use 'auhorised_values' instead of 'avs' to avoid confusion
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2019-10-24 21:44:51 UTC
Size:
6.30 KB
patch
obsolete
>From db80ff780b1cff0e8f1b415ab29702bda13d0a47 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 19 Aug 2019 15:44:17 -0400 >Subject: [PATCH] Bug 20307: Use 'auhorised_values' instead of 'avs' to avoid > confusion > >And so we need to extend the size of localization.entity > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > Koha/AuthorisedValue.pm | 6 +++--- > Koha/Schema/Result/AuthorisedValueLocalization.pm | 2 +- > installer/data/mysql/atomicupdate/bug_20307.perl | 1 + > installer/data/mysql/kohastructure.sql | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt | 4 ++-- > 5 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm >index 2c2e4cd051..08f77f24b2 100644 >--- a/Koha/AuthorisedValue.pm >+++ b/Koha/AuthorisedValue.pm >@@ -69,7 +69,7 @@ sub opac_translated_description { > $lang ||= C4::Languages::getlanguage; > my $translated_description = Koha::Localizations->search({ > code => $self->authorised_value, >- entity => 'avs', >+ entity => 'authorised_values', > lang => $lang, > interface => 'opac', > })->next; >@@ -95,7 +95,7 @@ sub translated_description { > $lang ||= C4::Languages::getlanguage; > my $translated_description = Koha::Localizations->search({ > code => $self->authorised_value, >- entity => 'avs', >+ entity => 'authorised_values', > lang => $lang, > })->next; > return $translated_description >@@ -110,7 +110,7 @@ sub translated_description { > sub translated_descriptions { > my ( $self ) = @_; > my @translated_descriptions = Koha::Localizations->search( >- { entity => 'avs', >+ { entity => 'authorised_values', > code => $self->authorised_value, > } > ); >diff --git a/Koha/Schema/Result/AuthorisedValueLocalization.pm b/Koha/Schema/Result/AuthorisedValueLocalization.pm >index fa2c69662b..b283172b1e 100644 >--- a/Koha/Schema/Result/AuthorisedValueLocalization.pm >+++ b/Koha/Schema/Result/AuthorisedValueLocalization.pm >@@ -9,7 +9,7 @@ __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); > __PACKAGE__->table('authorised_value_localizations'); > __PACKAGE__->result_source_instance->is_virtual(1); > __PACKAGE__->result_source_instance->view_definition( >- "SELECT localization_id, code, lang, translation FROM localization WHERE entity='avs'" >+ "SELECT localization_id, code, lang, translation FROM localization WHERE entity='authorised_values'" > ); > > __PACKAGE__->add_columns( >diff --git a/installer/data/mysql/atomicupdate/bug_20307.perl b/installer/data/mysql/atomicupdate/bug_20307.perl >index 36896af3be..c82a7af872 100644 >--- a/installer/data/mysql/atomicupdate/bug_20307.perl >+++ b/installer/data/mysql/atomicupdate/bug_20307.perl >@@ -4,6 +4,7 @@ if ( CheckVersion($DBversion) ) { > $dbh->do("ALTER TABLE `localization` ADD COLUMN `interface` VARCHAR(30) DEFAULT NULL AFTER `entity`"); > $dbh->do("ALTER TABLE `localization` DROP FOREIGN KEY `entity_code_lang`"); > $dbh->do("ALTER TABLE `localization` ADD UNIQUE KEY `entity_code_interface_lang` (entity, code, interface, lang)"); >+ $dbh->do("ALTER TABLE `localization` MODIFY entity VARCHAR(30) NOT NULL"); > } > > SetVersion($DBversion); >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 81b98abe9d..9129f67fa3 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3732,7 +3732,7 @@ CREATE TABLE `additional_field_values` ( > DROP TABLE IF EXISTS localization; > CREATE TABLE `localization` ( > localization_id int(11) NOT NULL AUTO_INCREMENT, >- entity varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL, >+ entity varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, > interface varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL, > code varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, > lang varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL, -- could be a foreign key >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 48a5a0a71b..e01aed9c71 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=avs&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=[% 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=avs&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=[% 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.11.0
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