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
80e765fb
Commit
80e765fb
authored
Feb 02, 2005
by
travis%sedsystems.ca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 279740 : Move CountOpenDependencies out of globals.pl
Patch by Max Kanat-Alexander <mkanat@kerio.com> r=wurblzap a=justdave
parent
6139fe45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
33 deletions
+27
-33
Bug.pm
Bugzilla/Bug.pm
+26
-0
globals.pl
globals.pl
+0
-32
process_bug.cgi
process_bug.cgi
+1
-1
No files found.
Bugzilla/Bug.pm
View file @
80e765fb
...
...
@@ -536,6 +536,32 @@ sub GetComments {
return
\
@comments
;
}
# CountOpenDependencies counts the number of open dependent bugs for a
# list of bugs and returns a list of bug_id's and their dependency count
# It takes one parameter:
# - A list of bug numbers whose dependencies are to be checked
sub
CountOpenDependencies
{
my
(
@bug_list
)
=
@_
;
my
@dependencies
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$sth
=
$dbh
->
prepare
(
"SELECT blocked, count(bug_status) "
.
"FROM bugs, dependencies "
.
"WHERE blocked IN ("
.
(
join
","
,
@bug_list
)
.
") "
.
"AND bug_id = dependson "
.
"AND bug_status IN ('"
.
(
join
"','"
,
&::
OpenStates
())
.
"') "
.
"GROUP BY blocked "
);
$sth
->
execute
();
while
(
my
(
$bug_id
,
$dependencies
)
=
$sth
->
fetchrow_array
())
{
push
(
@dependencies
,
{
bug_id
=>
$bug_id
,
dependencies
=>
$dependencies
});
}
return
@dependencies
;
}
sub
AUTOLOAD
{
use
vars
qw($AUTOLOAD)
;
my
$attr
=
$AUTOLOAD
;
...
...
globals.pl
View file @
80e765fb
...
...
@@ -999,38 +999,6 @@ sub GetBugLink {
}
}
# CountOpenDependencies counts the number of open dependent bugs for a
# list of bugs and returns a list of bug_id's and their dependency count
# It takes one parameter:
# - A list of bug numbers whose dependencies are to be checked
sub
CountOpenDependencies
{
my
(
@bug_list
)
=
@_
;
my
@dependencies
;
# Make sure any unfetched data from a currently running query
# is saved off rather than overwritten
PushGlobalSQLState
();
SendSQL
(
"SELECT blocked, count(bug_status) "
.
"FROM bugs, dependencies "
.
"WHERE blocked IN ("
.
(
join
","
,
@bug_list
)
.
") "
.
"AND bug_id = dependson "
.
"AND bug_status IN ('"
.
(
join
"','"
,
OpenStates
())
.
"') "
.
"GROUP BY blocked "
);
while
(
MoreSQLData
())
{
my
(
$bug_id
,
$dependencies
)
=
FetchSQLData
();
push
(
@dependencies
,
{
bug_id
=>
$bug_id
,
dependencies
=>
$dependencies
});
}
# All done with this sidetrip
PopGlobalSQLState
();
return
@dependencies
;
}
sub
GetLongDescriptionAsText
{
my
(
$id
,
$start
,
$end
)
=
(
@_
);
my
$result
=
""
;
...
...
process_bug.cgi
View file @
80e765fb
...
...
@@ -935,7 +935,7 @@ SWITCH: for ($::FORM{'knob'}) {
if
(
Param
(
"noresolveonopenblockers"
)
&&
$::FORM
{
'resolution'
}
eq
'FIXED'
)
{
my
@dependencies
=
CountOpenDependencies
(
@idlist
);
my
@dependencies
=
Bugzilla::Bug::
CountOpenDependencies
(
@idlist
);
if
(
scalar
@dependencies
>
0
)
{
ThrowUserError
(
"still_unresolved_bugs"
,
{
dependencies
=>
\
@dependencies
,
...
...
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