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
93ed3ae8
Commit
93ed3ae8
authored
Mar 07, 2006
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 282628: Move OpenStates and IsOpenedState out of globals.pl
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wicked, a=myk
parent
eb411e0d
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
44 additions
and
41 deletions
+44
-41
Bug.pm
Bugzilla/Bug.pm
+9
-2
BugMail.pm
Bugzilla/BugMail.pm
+2
-1
Constants.pm
Bugzilla/Constants.pm
+6
-0
Search.pm
Bugzilla/Search.pm
+3
-2
Quicksearch.pm
Bugzilla/Search/Quicksearch.pm
+4
-2
Template.pm
Bugzilla/Template.pm
+2
-1
buglist.cgi
buglist.cgi
+1
-1
checksetup.pl
checksetup.pl
+5
-2
config.cgi
config.cgi
+2
-1
editproducts.cgi
editproducts.cgi
+1
-1
globals.pl
globals.pl
+0
-19
importxml.pl
importxml.pl
+1
-1
process_bug.cgi
process_bug.cgi
+4
-4
sanitycheck.cgi
sanitycheck.cgi
+1
-1
showdependencygraph.cgi
showdependencygraph.cgi
+1
-1
showdependencytree.cgi
showdependencytree.cgi
+1
-1
votes.cgi
votes.cgi
+1
-1
No files found.
Bugzilla/Bug.pm
View file @
93ed3ae8
...
...
@@ -54,6 +54,7 @@ use base qw(Exporter);
bug_alias_to_id ValidateBugAlias ValidateBugID
RemoveVotes CheckIfVotedConfirmed
LogActivityEntry
is_open_state
)
;
#####################################################################
...
...
@@ -203,7 +204,7 @@ sub initBug {
}
$self
->
{
'isunconfirmed'
}
=
(
$self
->
{
bug_status
}
eq
'UNCONFIRMED'
);
$self
->
{
'isopened'
}
=
&::
IsOpenedS
tate
(
$self
->
{
bug_status
});
$self
->
{
'isopened'
}
=
is_open_s
tate
(
$self
->
{
bug_status
});
return
$self
;
}
...
...
@@ -758,6 +759,12 @@ sub EmitDependList {
return
$list_ref
;
}
# Tells you whether or not the argument is a valid "open" state.
sub
is_open_state
{
my
(
$state
)
=
@_
;
return
(
grep
(
$_
eq
$state
,
BUG_STATE_OPEN
)
?
1
:
0
);
}
sub
ValidateTime
{
my
(
$time
,
$field
)
=
@_
;
...
...
@@ -979,7 +986,7 @@ sub CountOpenDependencies {
"FROM bugs, dependencies "
.
"WHERE blocked IN ("
.
(
join
","
,
@bug_list
)
.
") "
.
"AND bug_id = dependson "
.
"AND bug_status IN ('"
.
(
join
"','"
,
&::
OpenStates
()
)
.
"') "
.
"AND bug_status IN ('"
.
(
join
"','"
,
BUG_STATE_OPEN
)
.
"') "
.
$dbh
->
sql_group_by
(
'blocked'
));
$sth
->
execute
();
...
...
Bugzilla/BugMail.pm
View file @
93ed3ae8
...
...
@@ -37,6 +37,7 @@ use Bugzilla::User;
use
Bugzilla::
Constants
;
use
Bugzilla::
Config
qw(:DEFAULT $datadir)
;
use
Bugzilla::
Util
;
use
Bugzilla::
Bug
;
use
Date::
Parse
;
use
Date::
Format
;
...
...
@@ -309,7 +310,7 @@ sub ProcessOneBug {
$interestingchange
=
0
;
}
$thisdiff
.=
FormatTriple
(
$fielddescription
{
$what
},
$old
,
$new
);
if
(
$what
eq
'bug_status'
&&
&::
IsOpenedState
(
$old
)
ne
&::
IsOpenedS
tate
(
$new
))
{
if
(
$what
eq
'bug_status'
&&
is_open_state
(
$old
)
ne
is_open_s
tate
(
$new
))
{
$interestingchange
=
1
;
}
...
...
Bugzilla/Constants.pm
View file @
93ed3ae8
...
...
@@ -94,6 +94,8 @@ use base qw(Exporter);
FIELD_TYPE_UNKNOWN
FIELD_TYPE_FREETEXT
BUG_STATE_OPEN
)
;
@
Bugzilla::Constants::
EXPORT_OK
=
qw(contenttypes)
;
...
...
@@ -256,4 +258,8 @@ use constant SENDMAIL_EXE => '/usr/lib/sendmail.exe';
use
constant
FIELD_TYPE_UNKNOWN
=>
0
;
use
constant
FIELD_TYPE_FREETEXT
=>
1
;
# States that are considered to be "open" for bugs.
use
constant
BUG_STATE_OPEN
=>
(
'NEW'
,
'REOPENED'
,
'ASSIGNED'
,
'UNCONFIRMED'
);
1
;
Bugzilla/Search.pm
View file @
93ed3ae8
...
...
@@ -41,6 +41,7 @@ use Bugzilla::Constants;
use
Bugzilla::
Group
;
use
Bugzilla::
User
;
use
Bugzilla::
Field
;
use
Bugzilla::
Bug
;
use
Date::
Format
;
use
Date::
Parse
;
...
...
@@ -186,11 +187,11 @@ sub init {
$params
->
delete
(
'bug_status'
);
}
elsif
(
$bug_statuses
[
0
]
eq
'__open__'
)
{
$params
->
param
(
'bug_status'
,
map
(
&::
IsOpenedS
tate
(
$_
)
?
$_
:
undef
,
$params
->
param
(
'bug_status'
,
map
(
is_open_s
tate
(
$_
)
?
$_
:
undef
,
@::legal_bug_status
));
}
elsif
(
$bug_statuses
[
0
]
eq
"__closed__"
)
{
$params
->
param
(
'bug_status'
,
map
(
&::
IsOpenedS
tate
(
$_
)
?
undef
:
$_
,
$params
->
param
(
'bug_status'
,
map
(
is_open_s
tate
(
$_
)
?
undef
:
$_
,
@::legal_bug_status
));
}
}
...
...
Bugzilla/Search/Quicksearch.pm
View file @
93ed3ae8
...
...
@@ -26,6 +26,8 @@ use strict;
use
Bugzilla
;
use
Bugzilla::
Config
;
use
Bugzilla::
Error
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Bug
;
use
base
qw(Exporter)
;
@
Bugzilla::Search::Quicksearch::
EXPORT
=
qw(quicksearch)
;
...
...
@@ -153,12 +155,12 @@ sub quicksearch {
my
@words
=
splitString
(
$searchstring
);
my
$searchComments
=
$#words
<
Param
(
'quicksearch_comment_cutoff'
);
my
@openStates
=
&::
OpenStates
()
;
my
@openStates
=
BUG_STATE_OPEN
;
my
@closedStates
;
my
(
%
states
,
%
resolutions
);
foreach
(
@::legal_bug_status
)
{
push
(
@closedStates
,
$_
)
unless
&::
IsOpenedS
tate
(
$_
);
push
(
@closedStates
,
$_
)
unless
is_open_s
tate
(
$_
);
}
foreach
(
@openStates
)
{
$states
{
$_
}
=
1
}
if
(
$words
[
0
]
eq
'ALL'
)
{
...
...
Bugzilla/Template.pm
View file @
93ed3ae8
...
...
@@ -40,6 +40,7 @@ use Bugzilla::Util;
use
Bugzilla::
User
;
use
Bugzilla::
Error
;
use
MIME::
Base64
;
use
Bugzilla::
Bug
;
# for time2str - replace by TT Date plugin??
use
Date::
Format
();
...
...
@@ -415,7 +416,7 @@ sub get_bug_link {
$pre
=
"<i>"
;
$post
=
"</i>"
;
}
elsif
(
!
&::
IsOpenedS
tate
(
$bug_state
))
{
elsif
(
!
is_open_s
tate
(
$bug_state
))
{
$pre
=
'<span class="bz_closed">'
;
$title
.=
" $bug_res"
;
$post
=
'</span>'
;
...
...
buglist.cgi
View file @
93ed3ae8
...
...
@@ -1007,7 +1007,7 @@ $vars->{'buglist_joined'} = join(',', @bugidlist);
$vars
->
{
'columns'
}
=
$columns
;
$vars
->
{
'displaycolumns'
}
=
\
@displaycolumns
;
my
@openstates
=
OpenStates
()
;
my
@openstates
=
BUG_STATE_OPEN
;
$vars
->
{
'openstates'
}
=
\
@openstates
;
$vars
->
{
'closedstates'
}
=
[
'CLOSED'
,
'VERIFIED'
,
'RESOLVED'
];
...
...
checksetup.pl
View file @
93ed3ae8
...
...
@@ -1449,6 +1449,9 @@ import Bugzilla::Util qw(bz_crypt trim html_quote is_7bit_clean);
require
Bugzilla::
User
;
import
Bugzilla::
User
qw(insert_new_user)
;
require
Bugzilla::
Bug
;
import
Bugzilla::
Bug
qw(is_open_state)
;
# globals.pl clears the PATH, but File::Find uses Cwd::cwd() instead of
# Cwd::getcwd(), which we need to do because `pwd` isn't in the path - see
# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-09/msg00115.html
...
...
@@ -3545,7 +3548,7 @@ if (!$series_exists) {
$data
{
$fields
[
$i
]}{
$numbers
[
0
]}
=
$numbers
[
$i
+
1
];
# Keep a total of the number of open bugs for this day
if
(
IsOpenedS
tate
(
$fields
[
$i
]))
{
if
(
is_open_s
tate
(
$fields
[
$i
]))
{
$data
{
$open_name
}{
$numbers
[
0
]}
+=
$numbers
[
$i
+
1
];
}
}
...
...
@@ -4120,7 +4123,7 @@ if (@$broken_nonopen_series) {
join
(
"&"
,
map
{
"bug_status="
.
url_quote
(
$_
)
}
(
'UNCONFIRMED'
,
'NEW'
,
'ASSIGNED'
,
'REOPENED'
));
my
$open_bugs_query_base_new
=
join
(
"&"
,
map
{
"bug_status="
.
url_quote
(
$_
)
}
OpenStates
()
);
join
(
"&"
,
map
{
"bug_status="
.
url_quote
(
$_
)
}
BUG_STATE_OPEN
);
my
$sth_openbugs_series
=
$dbh
->
prepare
(
"SELECT series_id FROM series
WHERE query IN (?, ?)"
);
...
...
config.cgi
View file @
93ed3ae8
...
...
@@ -33,6 +33,7 @@ use lib qw(.);
require
"globals.pl"
;
use
Bugzilla
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Bug
;
# Suppress "used only once" warnings.
use
vars
...
...
@@ -80,7 +81,7 @@ $vars->{'products'} = $user->get_selectable_products;
my
@open_status
;
my
@closed_status
;
foreach
my
$status
(
@::legal_bug_status
)
{
IsOpenedS
tate
(
$status
)
?
push
(
@open_status
,
$status
)
is_open_s
tate
(
$status
)
?
push
(
@open_status
,
$status
)
:
push
(
@closed_status
,
$status
);
}
$vars
->
{
'open_status'
}
=
\
@open_status
;
...
...
editproducts.cgi
View file @
93ed3ae8
...
...
@@ -294,7 +294,7 @@ if ($action eq 'new') {
# For localisation reasons, we get the name of the "global" subcategory
# and the title of the "open" query from the submitted form.
my
@openedstatuses
=
OpenStates
()
;
my
@openedstatuses
=
BUG_STATE_OPEN
;
my
$query
=
join
(
"&"
,
map
{
"bug_status="
.
url_quote
(
$_
)
}
@openedstatuses
);
push
(
@series
,
[
$open_name
,
$query
]);
...
...
globals.pl
View file @
93ed3ae8
...
...
@@ -472,25 +472,6 @@ sub GroupIdToName {
return
$name
;
}
# Determines if the given bug_status string represents an "Opened" bug. This
# routine ought to be parameterizable somehow, as people tend to introduce
# new states into Bugzilla.
sub
IsOpenedState
{
my
(
$state
)
=
(
@_
);
if
(
grep
(
$_
eq
$state
,
OpenStates
()))
{
return
1
;
}
return
0
;
}
# This sub will return an array containing any status that
# is considered an open bug.
sub
OpenStates
{
return
(
'NEW'
,
'REOPENED'
,
'ASSIGNED'
,
'UNCONFIRMED'
);
}
############# Live code below here (that is, not subroutine defs) #############
use
Bugzilla
;
...
...
importxml.pl
View file @
93ed3ae8
...
...
@@ -896,7 +896,7 @@ sub process_bug {
my
$valid_status
=
check_field
(
'bug_status'
,
scalar
$bug_fields
{
'bug_status'
},
\
@::legal_bug_status
,
ERR_LEVEL
);
my
$is_open
=
IsOpenedS
tate
(
$bug_fields
{
'bug_status'
});
my
$is_open
=
is_open_s
tate
(
$bug_fields
{
'bug_status'
});
my
$status
=
$bug_fields
{
'bug_status'
}
||
undef
;
my
$resolution
=
$bug_fields
{
'resolution'
}
||
undef
;
...
...
process_bug.cgi
View file @
93ed3ae8
...
...
@@ -500,7 +500,7 @@ sub CheckCanChangeField {
if
(
$field
eq
"canconfirm"
||
(
$field
eq
"bug_status"
&&
$oldvalue
eq
'UNCONFIRMED'
&&
IsOpenedS
tate
(
$newvalue
)))
&&
is_open_s
tate
(
$newvalue
)))
{
$PrivilegesRequired
=
3
;
return
$UserInCanConfirmGroupSet
;
...
...
@@ -785,7 +785,7 @@ sub ChangeStatus {
# confirmed or not
$::query
.=
"bug_status = CASE WHEN everconfirmed = 1 THEN "
.
SqlQuote
(
$str
)
.
" ELSE 'UNCONFIRMED' END"
;
}
elsif
(
IsOpenedS
tate
(
$str
))
{
}
elsif
(
is_open_s
tate
(
$str
))
{
# Note that we cannot combine this with the above branch - here we
# need to check if bugs.bug_status is open, (since we don't want to
# reopen closed bugs when reassigning), while above the whole point
...
...
@@ -811,7 +811,7 @@ sub ChangeStatus {
# This also relies on the fact that confirming and accepting have
# already called DoConfirm before this is called
my
@open_state
=
map
(
SqlQuote
(
$_
),
OpenStates
()
);
my
@open_state
=
map
(
SqlQuote
(
$_
),
BUG_STATE_OPEN
);
my
$open_state
=
join
(
", "
,
@open_state
);
# If we are changing everconfirmed to 1, we have to take this change
...
...
@@ -2040,7 +2040,7 @@ foreach my $id (@idlist) {
}
if
(
$col
eq
'bug_status'
&&
IsOpenedState
(
$old
)
ne
IsOpenedS
tate
(
$new
))
&&
is_open_state
(
$old
)
ne
is_open_s
tate
(
$new
))
{
$check_dep_bugs
=
1
;
}
...
...
sanitycheck.cgi
View file @
93ed3ae8
...
...
@@ -737,7 +737,7 @@ BugCheck("bugs LEFT JOIN duplicates ON bugs.bug_id = duplicates.dupe WHERE " .
Status
(
"Checking statuses/resolutions"
);
my
@open_states
=
map
(
SqlQuote
(
$_
),
OpenStates
()
);
my
@open_states
=
map
(
SqlQuote
(
$_
),
BUG_STATE_OPEN
);
my
$open_states
=
join
(
', '
,
@open_states
);
BugCheck
(
"bugs WHERE bug_status IN ($open_states) AND resolution != ''"
,
...
...
showdependencygraph.cgi
View file @
93ed3ae8
...
...
@@ -188,7 +188,7 @@ foreach my $k (keys(%seen)) {
push
(
@params
,
"shape=box"
);
}
if
(
IsOpenedS
tate
(
$stat
))
{
if
(
is_open_s
tate
(
$stat
))
{
push
(
@params
,
"color=green"
);
}
...
...
showdependencytree.cgi
View file @
93ed3ae8
...
...
@@ -166,7 +166,7 @@ sub GetBug {
WHERE bugs.bug_id = ?"
,
undef
,
$id
);
}
$bug
->
{
'open'
}
=
$bug
->
{
'exists'
}
&&
IsOpenedS
tate
(
$bug
->
{
'status'
});
$bug
->
{
'open'
}
=
$bug
->
{
'exists'
}
&&
is_open_s
tate
(
$bug
->
{
'status'
});
$bug
->
{
'dependencies'
}
=
[]
;
return
$bug
;
...
...
votes.cgi
View file @
93ed3ae8
...
...
@@ -186,7 +186,7 @@ sub show_user {
push
(
@bugs
,
{
id
=>
$id
,
summary
=>
$summary
,
count
=>
$count
,
opened
=>
IsOpenedS
tate
(
$status
)
});
opened
=>
is_open_s
tate
(
$status
)
});
}
# In case we didn't populate this earlier (i.e. an error, or
...
...
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