Bugzilla – Attachment 46388 Details for
Bug 15306
Don't show translate link for item types if only one language is installed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15306: Do not display the translate link if only 1 language is installed
Bug-15306-Do-not-display-the-translate-link-if-onl.patch (text/plain), 3.24 KB, created by
Jonathan Druart
on 2016-01-07 12:37:45 UTC
(
hide
)
Description:
Bug 15306: Do not display the translate link if only 1 language is installed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-07 12:37:45 UTC
Size:
3.24 KB
patch
obsolete
>From 0a0a3bb9c291926d2dc584659ac2c0eefbfb8959 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Jan 2016 12:34:54 +0000 >Subject: [PATCH] Bug 15306: Do not display the translate link if only 1 > language is installed > >It doesn't make sense to offer the option to translate an item type >description into another language if there is only one language >installed. > >Test plan: >Enable only 1 language at the OPAC and the intranet. >Edit an item type and confirm that the link "translate into..." is not >displayed. >Enable 1+ languages at the intranet and 1 at the opac, confirm that the >link is displayed. >Enable 1 language at the intranet and 1+ at the opac, confirm that the >link is displayed. >Enable 1+ language at the intranet and 1+ at the opac, confirm that the >link is displayed. >--- > admin/itemtypes.pl | 3 +++ > koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt | 4 +++- > 2 files changed, 6 insertions(+), 1 deletion(-) > >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index f5182cd..a604307 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -60,10 +60,13 @@ if ( $op eq 'add_form' ) { > my $itemtype = Koha::ItemTypes->find($itemtype_code); > my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) ); > my $searchcategory = GetAuthorisedValues("ITEMTYPECAT", ( $itemtype ? $itemtype->searchcategory : '' ) ); >+ my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') ); >+ my $nb_of_languages = grep {$_->{group_enabled}} @$translated_languages; > $template->param( > itemtype => $itemtype, > imagesets => $imagesets, > searchcategory => $searchcategory, >+ can_be_translated => ( $nb_of_languages > 1 ? 1 : 0 ), > ); > } elsif ( $op eq 'add_validate' ) { > my $is_a_modif = $input->param('is_a_modif'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index 077eb7e..235b1d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -140,7 +140,9 @@ Item types administration > <li> > <label for="description" class="required">Description: </label> > <input type="text" id="description" name="description" size="48" value="[% itemtype.description |html %]" required="required" /> <span class="required">Required</span> >- <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype %]" title="Translate item type [% itemtype.itemtype %]" rel="gb_page_center[600,500]"><i class="icon-edit"></i> Translate into other languages</a> >+ [% IF can_be_translated %] >+ <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype %]" title="Translate item type [% itemtype.itemtype %]" rel="gb_page_center[600,500]"><i class="icon-edit"></i> Translate into other languages</a> >+ [% END %] > </li> > <li> > <span class="label">Search category</span> >-- >2.1.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 15306
:
46388
|
46391
|
46394
|
46480
|
46483
|
46764