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
9c07e003
Commit
9c07e003
authored
Nov 25, 2002
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 180460 request.cgi doesn't filter list of products/components
patch by joel r=bbaetz a=justdave
parent
8d943673
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
3 deletions
+49
-3
globals.pl
globals.pl
+45
-0
request.cgi
request.cgi
+4
-3
No files found.
globals.pl
View file @
9c07e003
...
...
@@ -795,6 +795,51 @@ sub GetEnterableProducts {
return
(
@products
);
}
# GetEnterableProductHash
# returns a hash containing
# legal_products => an enterable product list
# legal_components => the list of components of enterable products
# components => a hash of component lists for each enterable product
sub
GetEnterableProductHash
{
my
$query
=
"SELECT products.name, components.name "
.
"FROM products "
.
"LEFT JOIN components "
.
"ON components.product_id = products.id "
.
"LEFT JOIN group_control_map "
.
"ON group_control_map.product_id = products.id "
.
"AND group_control_map.entry != 0 "
;
if
((
defined
@
{
$::vars
->
{
user
}{
groupids
}})
&&
(
@
{
$::vars
->
{
user
}{
groupids
}}
>
0
))
{
$query
.=
"AND group_id NOT IN("
.
join
(
','
,
@
{
$::vars
->
{
user
}{
groupids
}})
.
") "
;
}
$query
.=
"WHERE group_id IS NULL "
.
"ORDER BY products.name, components.name"
;
PushGlobalSQLState
();
SendSQL
(
$query
);
my
@products
=
();
my
%
components
=
();
my
%
components_by_product
=
();
while
(
MoreSQLData
())
{
my
(
$product
,
$component
)
=
FetchSQLData
();
if
(
!
grep
(
$_
eq
$product
,
@products
))
{
push
@products
,
$product
;
}
if
(
$component
)
{
$components
{
$component
}
=
1
;
push
@
{
$components_by_product
{
$product
}},
$component
;
}
}
PopGlobalSQLState
();
my
@componentlist
=
(
sort
keys
%
components
);
return
{
legal_products
=>
\
@products
,
legal_components
=>
\
@componentlist
,
components
=>
\%
components_by_product
,
};
}
sub
CanSeeBug
{
my
(
$id
,
$userid
)
=
@_
;
...
...
request.cgi
View file @
9c07e003
...
...
@@ -254,9 +254,10 @@ sub queue {
# menu when the products menu changes; used by the template to populate
# the menus and keep the components menu consistent with the products menu
GetVersionTable
();
$vars
->
{
'products'
}
=
\
@::legal_product
;
$vars
->
{
'components'
}
=
\
@::legal_components
;
$vars
->
{
'components_by_product'
}
=
\%::
components
;
my
$enterable
=
GetEnterableProductHash
();
$vars
->
{
'products'
}
=
$enterable
->
{
legal_products
};
$vars
->
{
'components'
}
=
$enterable
->
{
legal_components
};
$vars
->
{
'components_by_product'
}
=
$enterable
->
{
components
};
$vars
->
{
'excluded_columns'
}
=
\
@excluded_columns
;
$vars
->
{
'group_field'
}
=
$::FORM
{
'group'
};
...
...
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