Bug 11263: Use all languages instead of just the translated ones
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 12 Dec 2013 10:27:26 +0000 (11:27 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 05:01:36 +0000 (05:01 +0000)
This patch produces the same dropdown list as the one in the adv search.
With this way, it won't be necessary to install additional templates to
fill the locale list.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
serials/subscription-add.pl
serials/subscription-numberpatterns.pl

index c6edab4..e31b8f2 100755 (executable)
@@ -215,10 +215,10 @@ if ($op eq 'addsubscription') {
 
     my $languages = [ map {
         {
-            language => $_->{language},
-            description => $_->{native_description} || $_->{language}
+            language => $_->{iso639_2_code},
+            description => $_->{language_description} || $_->{language}
         }
-    } @{ C4::Languages::getTranslatedLanguages() } ];
+    } @{ C4::Languages::getAllLanguages() } ];
 
     $template->param( locales => $languages );
 
index 065ab01..71e5d4b 100755 (executable)
@@ -105,12 +105,13 @@ if($op && ($op eq 'new' || $op eq 'modify')) {
     my @frequencies = GetSubscriptionFrequencies();
     my @subtypes;
     push @subtypes, { value => $_ } for (qw/ issues weeks months /);
+
     my $languages = [ map {
         {
-            language => $_->{language},
-            description => $_->{native_description} || $_->{language}
+            language => $_->{iso639_2_code},
+            description => $_->{language_description} || $_->{language}
         }
-    } @{ C4::Languages::getTranslatedLanguages() } ];
+    } @{ C4::Languages::getAllLanguages() } ];
 
     $template->param(
         $op => 1,