From de177c6bdf5d413b4fdb860970e422fadc943669 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Fri, 16 Aug 2002 05:57:10 +0000 Subject: Bug 162068 - Fix callers of ThrowUserError to use messages.html.tmpl. Patch by gerv; r=bbaetz. --- Bugzilla/Search.pm | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'Bugzilla/Search.pm') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 16dd493d6..88687392f 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -95,10 +95,8 @@ sub init { my $c = &::trim($F{'votes'}); if ($c ne "") { if ($c !~ /^[0-9]*$/) { - my $htmlc = html_quote($c); - &::ThrowUserError("The At least ___ votes field must - be a simple number. You entered - $htmlc, which doesn't cut it."); + $vars->{'value'} = $c; + &::ThrowUserError("illegal_at_least_x_votes"); } push(@specialchart, ["votes", "greaterthan", $c - 1]); } @@ -181,9 +179,8 @@ sub init { if (@clist) { push(@specialchart, \@clist); } else { - my $htmlemail = html_quote($email); - &::ThrowUserError("You must specify one or more fields in which - to search for $htmlemail."); + $vars->{'email'} = $email; + &::ThrowUserError("missing_email_type"); } } @@ -192,10 +189,8 @@ sub init { my $c = &::trim($F{'changedin'}); if ($c ne "") { if ($c !~ /^[0-9]*$/) { - my $htmlc = &::html_quote($c); - &::ThrowUserError("The changed in last ___ days field - must be a simple number. You entered - $htmlc, which doesn't cut it."); + $vars->{'value'} = $c; + &::ThrowUserError("illegal_changed_in_last_x_days"); } push(@specialchart, ["changedin", "lessthan", $c + 1]); @@ -341,14 +336,10 @@ sub init { $t = "greaterthan"; } if ($field eq "ispatch" && $v ne "0" && $v ne "1") { - &::ThrowUserError("The only legal values for the - Attachment is patch field are - 0 and 1."); + &::ThrowUserError("illegal_attachment_is_patch"); } if ($field eq "isobsolete" && $v ne "0" && $v ne "1") { - &::ThrowUserError("The only legal values for the - Attachment is obsolete field are - 0 and 1."); + &::ThrowUserError("illegal_is_obsolete"); } $f = "$table.$field"; }, @@ -446,11 +437,8 @@ sub init { push(@list, "$table.keywordid = $id"); } else { - my $htmlv = &::html_quote($v); - &::ThrowUserError("There is no keyword named$htmlv - . To search for keywords, consult - the list - of legal keywords."); + $vars->{'keyword'} = $v; + &::ThrowUserError("unknown_keyword"); } } my $haveawordterm; @@ -854,9 +842,8 @@ sub SqlifyDate { } my $date = str2time($str); if (!defined($date)) { - my $htmlstr = html_quote($str); - ThrowUserError("The string $htmlstr is not a legal date."); - exit; + $vars->{'date'} = $str; + ThrowUserError("illegal_date"); } return time2str("%Y-%m-%d %H:%M:%S", $date); } -- cgit v1.2.3-24-g4f1b