Группа :: Сети/WWW
Пакет: bugzilla
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: bugzilla-enter-bug-chg.patch
diff -uNr bugzilla-2.16.3-old/enter_bug.cgi bugzilla-2.16.3/enter_bug.cgi
--- bugzilla-2.16.3-old/enter_bug.cgi 2003-05-28 18:34:39 +0400
+++ bugzilla-2.16.3/enter_bug.cgi 2003-05-28 19:55:31 +0400
@@ -240,7 +240,7 @@
exit;
}
-if (0 == @{$::components{$product}}) {
+if (0 == @{$::components{$product}} && !defined $::FORM{'querymatch'}) {
my $error = "Sorry; there needs to be at least one component for this " .
"product in order to create a new bug. ";
if (UserInGroup('editcomponents')) {
@@ -261,6 +261,37 @@
}
my @components;
+if($::FORM{'querymatch'}) {
+ $vars->{'results'} = "yes";
+ my $query = "SELECT value,description FROM components WHERE program=".SqlQuote($::FORM{'product'});
+ my $matchstr = $::FORM{'matchstr'};
+
+ if ($::FORM{'matchtype'} eq 'substr') {
+ $query .= " AND value LIKE ";
+ $matchstr = '%' . $matchstr . '%';
+ } elsif ($::FORM{'matchtype'} eq 'regexp') {
+ $query .= " AND value REGEXP ";
+ $matchstr = '.'
+ unless $matchstr;
+ } elsif ($::FORM{'matchtype'} eq 'notregexp') {
+ $query .= " AND value NOT REGEXP ";
+ $matchstr = '.'
+ unless $matchstr;
+ }
+ $query .= SqlQuote($matchstr) . " ORDER BY value";
+
+ SendSQL($query);
+ while (MoreSQLData()) {
+ my ($name, $description) = FetchSQLData();
+
+ my %component;
+
+ $component{'name'} = $name;
+ $component{'description'} = $description;
+
+ push @components, \%component;
+ }
+} else {
SendSQL("SELECT value, description FROM components " .
"WHERE program = " . SqlQuote($product) . " ORDER BY value");
while (MoreSQLData()) {
@@ -273,7 +304,7 @@
push @components, \%component;
}
-
+}
my %default;
$vars->{'component_'} = \@components;
diff -uNr bugzilla-2.16.3-old/template/en/default/bug/create/create.html.tmpl bugzilla-2.16.3/template/en/default/bug/create/create.html.tmpl
--- bugzilla-2.16.3-old/template/en/default/bug/create/create.html.tmpl 2003-05-28 18:34:39 +0400
+++ bugzilla-2.16.3/template/en/default/bug/create/create.html.tmpl 2003-05-28 18:22:36 +0400
@@ -25,7 +25,11 @@
h2 = "This page lets you enter a new bug into Bugzilla."
%]
+[% IF results %]
<form method="post" action="post_bug.cgi">
+[% ELSE %]
+<form method="post" action="enter_bug.cgi">
+[% END %]
<input type="hidden" name="product" value="[% product FILTER html %]">
<table cellspacing="2" cellpadding="0" border="0">
@@ -77,6 +81,17 @@
Component</a>:
</strong>
</td>
+[% UNLESS results %]
+ <td>
+ <input type="text" name="matchstr">
+ <select name="matchtype">
+ <option value="substr">substring</option>
+ <option value="regexp">regexp</option>
+ <option value="notregexp">not regexp</option>
+ </select>
+ <input type="hidden" name="querymatch" value="1">
+ </td>
+[% ELSE %]
<td>
<select name="component" size="5">
[%- FOREACH c = component_ %]
@@ -86,7 +101,8 @@
</option>
[%- END %]
</select>
- </td>
+ </td>
+[% END %]
</tr>
<tr>