View | Details | Raw Unified | Return to bug 8954
Collapse All | Expand All

(-)a/C4/Languages.pm (-1 / +5 lines)
Lines 179-187 Returns a reference to an array of hashes: Link Here
179
=cut
179
=cut
180
180
181
sub getAllLanguages {
181
sub getAllLanguages {
182
    my $lang = shift;
182
    my @languages_loop;
183
    my @languages_loop;
183
    my $dbh=C4::Context->dbh;
184
    my $dbh=C4::Context->dbh;
184
    my $current_language = shift || 'en';
185
    my $current_language = 'en';
186
    if ($lang) {
187
        $current_language = lc(substr($lang, 0, 2));
188
    }
185
    my $sth = $dbh->prepare('SELECT * FROM language_subtag_registry WHERE type=\'language\'');
189
    my $sth = $dbh->prepare('SELECT * FROM language_subtag_registry WHERE type=\'language\'');
186
    $sth->execute();
190
    $sth->execute();
187
    while (my $language_subtag_registry = $sth->fetchrow_hashref) {
191
    while (my $language_subtag_registry = $sth->fetchrow_hashref) {
(-)a/catalogue/search.pl (-3 / +2 lines)
Lines 158-164 use CGI qw('-no_undef_params'); Link Here
158
my $cgi = new CGI;
158
my $cgi = new CGI;
159
159
160
my ($template,$borrowernumber,$cookie);
160
my ($template,$borrowernumber,$cookie);
161
161
my $lang = C4::Templates::getlanguage($cgi, 'intranet');
162
# decide which template to use
162
# decide which template to use
163
my $template_name;
163
my $template_name;
164
my $template_type;
164
my $template_type;
Lines 334-340 if ( $template_type eq 'advsearch' ) { Link Here
334
                      search_boxes_loop => \@search_boxes_array);
334
                      search_boxes_loop => \@search_boxes_array);
335
335
336
    # load the language limits (for search)
336
    # load the language limits (for search)
337
    my $languages_limit_loop = getAllLanguages();
337
    my $languages_limit_loop = getAllLanguages($lang);
338
    $template->param(search_languages_loop => $languages_limit_loop,);
338
    $template->param(search_languages_loop => $languages_limit_loop,);
339
339
340
    # Expanded search options in advanced search:
340
    # Expanded search options in advanced search:
Lines 472-478 my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit Link Here
472
my @results;
472
my @results;
473
473
474
## I. BUILD THE QUERY
474
## I. BUILD THE QUERY
475
my $lang = C4::Templates::getlanguage($cgi, 'intranet');
476
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan,$lang);
475
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan,$lang);
477
476
478
## parse the query_cgi string and put it into a form suitable for <input>s
477
## parse the query_cgi string and put it into a form suitable for <input>s
(-)a/opac/opac-search.pl (-4 / +2 lines)
Lines 71-77 BEGIN { Link Here
71
}
71
}
72
72
73
my ($template,$borrowernumber,$cookie);
73
my ($template,$borrowernumber,$cookie);
74
74
my $lang = C4::Templates::getlanguage($cgi, 'opac');
75
# decide which template to use
75
# decide which template to use
76
my $template_name;
76
my $template_name;
77
my $template_type = 'basic';
77
my $template_type = 'basic';
Lines 178-184 $template->param( Link Here
178
);
178
);
179
179
180
# load the language limits (for search)
180
# load the language limits (for search)
181
my $languages_limit_loop = getAllLanguages();
181
my $languages_limit_loop = getAllLanguages($lang);
182
$template->param(search_languages_loop => $languages_limit_loop,);
182
$template->param(search_languages_loop => $languages_limit_loop,);
183
183
184
# load the Type stuff
184
# load the Type stuff
Lines 418-424 my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_ Link Here
418
my @results;
418
my @results;
419
419
420
## I. BUILD THE QUERY
420
## I. BUILD THE QUERY
421
my $lang = C4::Templates::getlanguage($cgi, 'opac');
422
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang);
421
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang);
423
422
424
sub _input_cgi_parse {
423
sub _input_cgi_parse {
425
- 

Return to bug 8954