diff --git a/webtools/litmus/Litmus/DB/Testresult.pm b/webtools/litmus/Litmus/DB/Testresult.pm index eaaea2c3e9c2..5d2d53c058fa 100755 --- a/webtools/litmus/Litmus/DB/Testresult.pm +++ b/webtools/litmus/Litmus/DB/Testresult.pm @@ -187,6 +187,8 @@ sub getTestResults($\@\@$) { foreach my $criterion (@$where_criteria) { if ($criterion->{'field'} eq 'branch') { $where .= " AND b.name='" . $criterion->{'value'} . "'"; + } elsif ($criterion->{'field'} eq 'locale') { + $where .= " AND tr.locale_abbrev='" . $criterion->{'value'} . "'"; } elsif ($criterion->{'field'} eq 'product') { $where .= " AND pr.name='" . $criterion->{'value'} . "'"; } elsif ($criterion->{'field'} eq 'platform') { @@ -228,7 +230,7 @@ sub getTestResults($\@\@$) { $where .= " AND tr.submission_time>=$timestamp"; } elsif ($criterion->{'field'} eq 'search_field') { - my $rv = &_processSearchField($criterion,\$from,\$where); + ($from,$where) = &_processSearchField($criterion,$from,$where); } else { # Skip unknown field } @@ -255,6 +257,8 @@ sub getTestResults($\@\@$) { $order_by .= "trsl.class_name $criterion->{'direction'},"; } elsif ($criterion->{'field'} eq 'branch') { $order_by .= "b.name $criterion->{'direction'},"; + } elsif ($criterion->{'field'} eq 'locale') { + $order_by .= "tr.locale_abbrev $criterion->{'direction'},"; } else { # Skip unknown field } @@ -283,17 +287,19 @@ sub getTestResults($\@\@$) { } ######################################################################### -# &_processSearchField(\%) +# &_processSearchField(\%\$\$) # ######################################################################### sub _processSearchField(\%) { my ($search_field,$from,$where) = @_; - + my $table_field = ""; if ($search_field->{'search_field'} eq 'buildid') { $table_field='tr.build_id'; } elsif ($search_field->{'search_field'} eq 'comments') { $table_field='c.comment'; + } elsif ($search_field->{'search_field'} eq 'locale') { + $table_field='tr.locale_abbrev'; } elsif ($search_field->{'search_field'} eq 'opsys') { $table_field='o.name'; } elsif ($search_field->{'search_field'} eq 'platform') { @@ -319,7 +325,7 @@ sub _processSearchField(\%) { } elsif ($search_field->{'search_field'} eq 'user_agent') { $table_field='tr.user_agent'; } else { - return undef; + return ($from,$where); } if ($search_field->{'match_criteria'} eq 'contains_all' or @@ -361,11 +367,11 @@ sub _processSearchField(\%) { } elsif ($search_field->{'match_criteria'} eq 'not_regexp') { $where .= " AND $table_field NOT REGEXP '" . $search_field->{'value'} . "'"; } else { - # Ignore unknown match criteria. - return undef; + # Ignore unknown match criteria. + return ($from,$where); } - return 0; + return ($from,$where); } ######################################################################### diff --git a/webtools/litmus/Litmus/FormWidget.pm b/webtools/litmus/Litmus/FormWidget.pm index a460a50ceae2..1a8c0dd41afd 100755 --- a/webtools/litmus/Litmus/FormWidget.pm +++ b/webtools/litmus/Litmus/FormWidget.pm @@ -133,6 +133,13 @@ sub getBranches() return _getValues($sql); } +######################################################################### +sub getLocales() +{ + my $sql = "SELECT DISTINCT(abbrev) FROM locale_lookup ORDER BY abbrev"; + return _getValues($sql); +} + ######################################################################### sub getOpsyses() { @@ -183,6 +190,8 @@ sub getFields() display_string => "Build ID", }, { name => 'comment', display_string => "Comments", }, + { name => 'locale', + display_string => "Locale", }, { name => 'opsys', display_string => "Operating System", }, { name => 'platform', @@ -251,6 +260,8 @@ sub getSortFields() display_string => "Status"}, { name => "branch", display_string => "Branch"}, + { name => "locale", + display_string => "Locale"}, ); return \@sort_fields; } diff --git a/webtools/litmus/advanced_search.cgi b/webtools/litmus/advanced_search.cgi index 83e11026b102..2e7fdeb8a875 100755 --- a/webtools/litmus/advanced_search.cgi +++ b/webtools/litmus/advanced_search.cgi @@ -125,6 +125,12 @@ if ($c->param) { value => $value}; $where_criteria .= "Branch is \'".$c->param($param)."\'
"; $defaults->{branch} = $c->param($param); + } elsif ($param eq 'locale') { + my $value = $c->param($param); + push @where, {field => 'locale', + value => $value}; + $where_criteria .= "Locale is \'".$c->param($param)."\'
"; + $defaults->{locale} = $c->param($param); } elsif ($param eq 'product') { my $value = $c->param($param); push @where, {field => $param, @@ -195,6 +201,7 @@ my $test_groups = Litmus::FormWidget->getTestGroups; my $test_ids = Litmus::FormWidget->getTestIDs; my $result_statuses = Litmus::FormWidget->getResultStatuses; my $branches = Litmus::FormWidget->getBranches; +my $locales = Litmus::FormWidget->getLocales; my $fields = Litmus::FormWidget->getFields; my $match_criteria = Litmus::FormWidget->getMatchCriteria; @@ -211,6 +218,7 @@ my $vars = { test_ids => $test_ids, result_statuses => $result_statuses, branches => $branches, + locales => $locales, fields => $fields, match_criteria => $match_criteria, sort_fields => $sort_fields, diff --git a/webtools/litmus/populatedb.pl b/webtools/litmus/populatedb.pl index e7491a313460..d969618d82ee 100755 --- a/webtools/litmus/populatedb.pl +++ b/webtools/litmus/populatedb.pl @@ -56,10 +56,10 @@ our \$db_pass = ""; our \$user_cookiename = "litmus_login"; our \$sysconfig_cookiename = "litmustestingconfiguration"; -our $bugzilla_db = "bugzilla"; -our $bugzilla_host = "localhost"; -our $bugzilla_user = "litmus"; -out $bugzilla_pass = "litmus"; +our \$bugzilla_db = "bugzilla"; +our \$bugzilla_host = "localhost"; +our \$bugzilla_user = "litmus"; +out \$bugzilla_pass = "litmus"; EOT close(OUT); print "Go edit 'localconfig' with your configuration and \n"; diff --git a/webtools/litmus/search_results.cgi b/webtools/litmus/search_results.cgi index e40000208ca5..be08ba05561c 100755 --- a/webtools/litmus/search_results.cgi +++ b/webtools/litmus/search_results.cgi @@ -69,6 +69,11 @@ if ($c->param) { push @where, {field => $param, value => $value}; $where_criteria .= "Branch is \'".$c->param($param)."\'
"; + } elsif ($param eq 'locale') { + my $value = quotemeta($c->param($param)); + push @where, {field => 'locale_abbrev', + value => $value}; + $where_criteria .= "Branch is \'".$c->param($param)."\'
"; } elsif ($param eq 'product') { my $value = quotemeta($c->param($param)); push @where, {field => $param, diff --git a/webtools/litmus/single_result.cgi b/webtools/litmus/single_result.cgi index 2aa78d4af9fa..644821d6e4d5 100755 --- a/webtools/litmus/single_result.cgi +++ b/webtools/litmus/single_result.cgi @@ -106,22 +106,3 @@ if ($c->param && $c->param('id')) { } exit 0; - - - - - - - - - - - - - - - - - - - diff --git a/webtools/litmus/templates/en/default/reporting/advanced_search_form.tmpl b/webtools/litmus/templates/en/default/reporting/advanced_search_form.tmpl index 3ab299511165..ad3d7153c6b9 100644 --- a/webtools/litmus/templates/en/default/reporting/advanced_search_form.tmpl +++ b/webtools/litmus/templates/en/default/reporting/advanced_search_form.tmpl @@ -71,6 +71,10 @@ Limit your search to specific values of visible fields. Branch: [% INCLUDE form_widgets/select_branch.tmpl name="branch" placeholder=1 %] + +Locale: +[% INCLUDE form_widgets/select_locale.tmpl name="locale" placeholder=1 %] + diff --git a/webtools/litmus/templates/en/default/reporting/result_display.tmpl b/webtools/litmus/templates/en/default/reporting/result_display.tmpl index 059396709929..f85df1e7624d 100644 --- a/webtools/litmus/templates/en/default/reporting/result_display.tmpl +++ b/webtools/litmus/templates/en/default/reporting/result_display.tmpl @@ -80,6 +80,9 @@ Product and Platform Build ID:[% result.buildid | html %] +Locale:[% result.locale_abbrev.name | html %] ([% result.locale_abbrev | html %]) + + User Agent:[% result.user_agent | html %]