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
22c14103
Commit
22c14103
authored
Feb 22, 2006
by
lpsolit%gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 311278: Eliminate %::proddesc - Patch by Max Kanat-Alexander…
Bug 311278: Eliminate %::proddesc - Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit a=justdave
parent
286c0ad1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
29 deletions
+22
-29
describecomponents.cgi
describecomponents.cgi
+15
-21
enter_bug.cgi
enter_bug.cgi
+3
-2
globals.pl
globals.pl
+4
-6
No files found.
describecomponents.cgi
View file @
22c14103
...
...
@@ -42,28 +42,21 @@ my $product = trim($cgi->param('product') || '');
my
$product_id
=
get_product_id
(
$product
);
if
(
!
$product_id
||
!
$user
->
can_enter_product
(
$product
))
{
# Reference to a subset of %::proddesc, which the user is allowed to see
my
%
products
;
if
(
AnyEntryGroups
())
{
# OK, now only add products the user can see
Bugzilla
->
login
(
LOGIN_REQUIRED
);
foreach
my
$p
(
@::legal_product
)
{
if
(
$user
->
can_enter_product
(
$p
))
{
$products
{
$p
}
=
$::proddesc
{
$p
};
}
}
}
else
{
%
products
=
%::
proddesc
;
}
# Products which the user is allowed to see.
my
@products
=
@
{
$user
->
get_enterable_products
()};
my
$prodsize
=
scalar
(
keys
%
products
);
if
(
$prodsize
==
0
)
{
if
(
scalar
(
@products
)
==
0
)
{
ThrowUserError
(
"no_products"
);
}
elsif
(
$prodsize
>
1
)
{
$vars
->
{
'proddesc'
}
=
\%
products
;
elsif
(
scalar
(
@products
)
>
1
)
{
# XXX - For backwards-compatibility with old template
# interfaces, we now create a proddesc hash. This can go away
# once we update the templates.
my
%
product_desc
;
foreach
my
$product
(
@products
)
{
$product_desc
{
$product
->
name
}
=
$product
->
description
;
}
$vars
->
{
'proddesc'
}
=
\%
product_desc
;
$vars
->
{
'target'
}
=
"describecomponents.cgi"
;
# If an invalid product name is given, or the user is not
# allowed to access that product, a message is displayed
...
...
@@ -79,8 +72,9 @@ if (!$product_id || !$user->can_enter_product($product)) {
exit
;
}
$product
=
(
keys
%
products
)[
0
];
$product_id
=
get_product_id
(
$product
);
# Else, if there is only one product:
$product
=
$products
[
0
]
->
name
;
$product_id
=
$products
[
0
]
->
id
;
}
######################################################################
...
...
enter_bug.cgi
View file @
22c14103
...
...
@@ -53,7 +53,6 @@ use vars qw(
@legal_keywords
%versions
%target_milestone
$proddesc
)
;
# If we're using bug groups to restrict bug entry, we need to know who the
...
...
@@ -115,11 +114,13 @@ if (!defined $product || $product eq "") {
}
my
%
products
;
# XXX - This loop should work in some more sensible, efficient way.
foreach
my
$p
(
@enterable_products
)
{
if
(
Bugzilla
->
user
->
can_enter_product
(
$p
))
{
if
(
IsInClassification
(
scalar
$cgi
->
param
(
'classification'
),
$p
)
||
$cgi
->
param
(
'classification'
)
eq
"__all"
)
{
$products
{
$p
}
=
$::proddesc
{
$p
};
my
$product_object
=
new
Bugzilla::
Product
({
name
=>
$p
});
$products
{
$p
}
=
$product_object
->
description
;
}
}
}
...
...
globals.pl
View file @
22c14103
...
...
@@ -57,7 +57,6 @@ sub globals_pl_sillyness {
$zz
=
@
main::
legal_target_milestone
;
$zz
=
@
main::
legal_versions
;
$zz
=
@
main::
milestoneurl
;
$zz
=
%
main::
proddesc
;
$zz
=
@
main::
prodmaxvotes
;
}
...
...
@@ -158,11 +157,10 @@ sub GenerateVersionTable {
my
$mpart
=
$dotargetmilestone
?
", milestoneurl"
:
""
;
SendSQL
(
"SELECT name,
description,
votesperuser, disallownew$mpart "
.
SendSQL
(
"SELECT name, votesperuser, disallownew$mpart "
.
"FROM products ORDER BY name"
);
while
(
@line
=
FetchSQLData
())
{
my
(
$p
,
$d
,
$votesperuser
,
$dis
,
$u
)
=
(
@line
);
$::proddesc
{
$p
}
=
$d
;
my
(
$p
,
$votesperuser
,
$dis
,
$u
)
=
(
@line
);
if
(
!
$dis
&&
scalar
(
$::components
{
$p
}))
{
push
@::enterable_products
,
$p
;
}
...
...
@@ -241,10 +239,10 @@ sub GenerateVersionTable {
'*::legal_platform'
,
'*::legal_opsys'
,
'*::legal_bug_status'
,
'*::legal_resolution'
]));
print
$fh
(
Data::
Dumper
->
Dump
([
\
@::settable_resolution
,
\%::
proddesc
,
print
$fh
(
Data::
Dumper
->
Dump
([
\
@::settable_resolution
,
\%::
classifications
,
\
@::enterable_products
,
\%::
prodmaxvotes
],
[
'*::settable_resolution'
,
'*::proddesc'
,
[
'*::settable_resolution'
,
'*::classifications'
,
'*::enterable_products'
,
'*::prodmaxvotes'
]));
...
...
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