Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
a224d895
Commit
a224d895
authored
Mar 20, 1999
by
terry%netscape.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch by David Gardiner <david.gardiner@unisa.edu.au> (with further
hacks by me): Added javascript magic to adjust component/version lists when products get selected.
parent
5066e675
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
1 deletion
+127
-1
query.cgi
query.cgi
+127
-1
No files found.
query.cgi
View file @
a224d895
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
# Netscape Communications Corporation. All Rights Reserved.
# Netscape Communications Corporation. All Rights Reserved.
#
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Contributor(s): Terry Weissman <terry@mozilla.org>
# David Gardiner <david.gardiner@unisa.edu.au>
use
diagnostics
;
use
diagnostics
;
use
strict
;
use
strict
;
...
@@ -37,6 +38,8 @@ use vars @::legal_resolution,
...
@@ -37,6 +38,8 @@ use vars @::legal_resolution,
@::legal_versions
,
@::legal_versions
,
@::legal_severity
,
@::legal_severity
,
@::legal_target_milestone
,
@::legal_target_milestone
,
%::
versions
,
%::
components
,
%::
FORM
;
%::
FORM
;
...
@@ -181,6 +184,127 @@ my $emailinput1 = GenerateEmailInput(1);
...
@@ -181,6 +184,127 @@ my $emailinput1 = GenerateEmailInput(1);
my
$emailinput2
=
GenerateEmailInput
(
2
);
my
$emailinput2
=
GenerateEmailInput
(
2
);
# javascript
my
$jscript
=
<<
'ENDSCRIPT'
;
<
script
language
=
"Javascript1.1"
>
<!--
var
cpts
=
new
Array
();
var
vers
=
new
Array
();
ENDSCRIPT
my
$p
;
my
$v
;
my
$c
;
my
$i
=
0
;
my
$j
=
0
;
foreach
$c
(
@::legal_components
)
{
$jscript
.=
"cpts['$c'] = [];\n"
;
}
foreach
$v
(
@::legal_versions
)
{
$jscript
.=
"vers['$v'] = [];\n"
;
}
for
$p
(
@::legal_product
)
{
foreach
$c
(
@
{
$::components
{
$p
}})
{
$jscript
.=
"cpts['$c'].push('$p');\n"
;
}
foreach
$v
(
@
{
$::versions
{
$p
}})
{
$jscript
.=
"vers['$v'].push('$p');\n"
;
}
}
$i
=
0
;
$jscript
.=
"
// Only display versions/components valid for selected product(s)
function selectProduct(f) {
var cnt = 0;
var i;
var j;
for (i=0 ; i<f.product.length ; i++) {
if (f.product[i].selected) {
cnt++;
}
}
var doall = (cnt == f.product.length || cnt == 0);
var csel = new Array();
for (i=0 ; i<f.component.length ; i++) {
if (f.component[i].selected) {
csel[f.component[i].value] = 1;
}
}
f.component.options.length = 0;
for (c in cpts) {
var doit = doall;
for (i=0 ; !doit && i<f.product.length ; i++) {
if (f.product[i].selected) {
var p = f.product[i].value;
for (j in cpts[c]) {
var p2 = cpts[c][j];
if (p2 == p) {
doit = true;
break;
}
}
}
}
if (doit) {
var l = f.component.length;
f.component[l] = new Option(c, c);
if (csel[c] != undefined) {
f.component[l].selected = true;
}
}
}
var vsel = new Array();
for (i=0 ; i<f.version.length ; i++) {
if (f.version[i].selected) {
vsel[f.version[i].value] = 1;
}
}
f.version.options.length = 0;
for (v in vers) {
var doit = doall;
for (i=0 ; !doit && i<f.product.length ; i++) {
if (f.product[i].selected) {
var p = f.product[i].value;
for (j in vers[v]) {
var p2 = vers[v][j];
if (p2 == p) {
doit = true;
break;
}
}
}
}
if (doit) {
var l = f.version.length;
f.version[l] = new Option(v, v);
if (vsel[v] != undefined) {
f.version[l].selected = true;
}
}
}
}
// -->
</script>\n"
;
# Muck the "legal product" list so that the default one is always first (and
# Muck the "legal product" list so that the default one is always first (and
...
@@ -198,6 +322,8 @@ PutHeader("Bugzilla Query Page", "Query Page");
...
@@ -198,6 +322,8 @@ PutHeader("Bugzilla Query Page", "Query Page");
push
@::legal_resolution
,
"---"
;
# Oy, what a hack.
push
@::legal_resolution
,
"---"
;
# Oy, what a hack.
push
@::legal_target_milestone
,
"---"
;
# Oy, what a hack.
push
@::legal_target_milestone
,
"---"
;
# Oy, what a hack.
print
$jscript
;
print
"
print
"
<FORM NAME=queryForm METHOD=GET ACTION=\"buglist.cgi\">
<FORM NAME=queryForm METHOD=GET ACTION=\"buglist.cgi\">
...
@@ -271,7 +397,7 @@ print "
...
@@ -271,7 +397,7 @@ print "
<tr>
<tr>
<td align=left valign=top>
<td align=left valign=top>
<SELECT NAME=\"product\" MULTIPLE SIZE=5>
<SELECT NAME=\"product\" MULTIPLE SIZE=5
onChange=\"selectProduct(this.form);\"
>
@{[make_options(\@::legal_product, $default{'product'}, $type{'product'})]}
@{[make_options(\@::legal_product, $default{'product'}, $type{'product'})]}
</SELECT>
</SELECT>
</td>
</td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment