summaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-10-02 07:41:03 +0200
committergerv%gerv.net <>2002-10-02 07:41:03 +0200
commit60b331bc2a1d89296f5c57df34171db3b3eca409 (patch)
tree241d081fab876eb42f3784ba67819e65662b0467 /enter_bug.cgi
parent8d6671f06bf7d6864cffcaccf4ef4b7e09b80675 (diff)
downloadbugzilla-60b331bc2a1d89296f5c57df34171db3b3eca409.tar.gz
bugzilla-60b331bc2a1d89296f5c57df34171db3b3eca409.tar.xz
Bug 163114 - Templatise all calls to DisplayError. Patch C. Patch by gerv; r=burnus.
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi27
1 files changed, 5 insertions, 22 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index f53c63dd6..ab3e1512d 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -79,9 +79,7 @@ if (!defined $::FORM{'product'}) {
my $prodsize = scalar(keys %products);
if ($prodsize == 0) {
- DisplayError("Either no products have been defined to enter bugs ".
- "against or you have not been given access to any.\n");
- exit;
+ ThrowUserError("no_products");
}
elsif ($prodsize > 1) {
$vars->{'proddesc'} = \%products;
@@ -225,34 +223,19 @@ if(Param("usebuggroupsentry")
&& GroupExists($product)
&& !UserInGroup($product))
{
- DisplayError("Sorry; you do not have the permissions necessary to " .
- "enter a bug against this product.\n");
- exit;
+ ThrowUserError("entry_access_denied", { product => $product});
}
GetVersionTable();
if (lsearch(\@::enterable_products, $product) == -1) {
- DisplayError("'" . html_quote($product) . "' is not a valid product.");
- exit;
+ ThrowUserError("invalid_product_name", { product => $product});
}
my $product_id = get_product_id($product);
-if (0 == @{$::components{$product}}) {
- my $error = "Sorry; there needs to be at least one component for this " .
- "product in order to create a new bug. ";
- if (UserInGroup('editcomponents')) {
- $error .= "<a href=\"editcomponents.cgi\">" .
- "Create a new component</a>\n";
- }
- else {
- $error .= "Please contact " . Param("maintainer") . ", detailing " .
- "the product in which you tried to create a new bug.\n";
- }
-
- DisplayError($error);
- exit;
+if (0 == @{$::components{$product}}) {
+ ThrowUserError("no_components");
}
elsif (1 == @{$::components{$product}}) {
# Only one component; just pick it.