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
e39a1db4
Commit
e39a1db4
authored
May 20, 2009
by
ghendricks%novell.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 493090 - Product disallownew should be converted to isactive
patch by ghendricks r=mkanat a=mkanat
parent
e82fe9ae
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
53 additions
and
45 deletions
+53
-45
Schema.pm
Bugzilla/DB/Schema.pm
+2
-2
DB.pm
Bugzilla/Install/DB.pm
+25
-4
Product.pm
Bugzilla/Product.pm
+6
-6
User.pm
Bugzilla/User.pm
+1
-1
gnats2bz.pl
contrib/gnats2bz.pl
+2
-2
gnatsparse.py
contrib/gnatsparse/gnatsparse.py
+2
-2
editproducts.cgi
editproducts.cgi
+2
-2
confirm-delete.html.tmpl
template/en/default/admin/products/confirm-delete.html.tmpl
+3
-3
create.html.tmpl
template/en/default/admin/products/create.html.tmpl
+1
-0
edit-common.html.tmpl
template/en/default/admin/products/edit-common.html.tmpl
+3
-4
list.html.tmpl
template/en/default/admin/products/list.html.tmpl
+2
-15
updated.html.tmpl
template/en/default/admin/products/updated.html.tmpl
+4
-4
No files found.
Bugzilla/DB/Schema.pm
View file @
e39a1db4
...
...
@@ -1176,8 +1176,8 @@ use constant ABSTRACT_SCHEMA => {
description
=>
{
TYPE
=>
'MEDIUMTEXT'
},
milestoneurl
=>
{
TYPE
=>
'TINYTEXT'
,
NOTNULL
=>
1
,
DEFAULT
=>
"''"
},
disallownew
=>
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
0
},
isactive
=>
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
1
},
votesperuser
=>
{
TYPE
=>
'INT2'
,
NOTNULL
=>
1
,
DEFAULT
=>
0
},
maxvotesperbug
=>
{
TYPE
=>
'INT2'
,
NOTNULL
=>
1
,
...
...
Bugzilla/Install/DB.pm
View file @
e39a1db4
...
...
@@ -459,8 +459,10 @@ sub update_table_definitions {
# The products table lacked sensible defaults.
$dbh
->
bz_alter_column
(
'products'
,
'milestoneurl'
,
{
TYPE
=>
'TINYTEXT'
,
NOTNULL
=>
1
,
DEFAULT
=>
"''"
});
$dbh
->
bz_alter_column
(
'products'
,
'disallownew'
,
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
0
});
if
(
$dbh
->
bz_column_info
(
'products'
,
'disallownew'
)){
$dbh
->
bz_alter_column
(
'products'
,
'disallownew'
,
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
0
});
}
$dbh
->
bz_alter_column
(
'products'
,
'votesperuser'
,
{
TYPE
=>
'INT2'
,
NOTNULL
=>
1
,
DEFAULT
=>
0
});
$dbh
->
bz_alter_column
(
'products'
,
'votestoconfirm'
,
...
...
@@ -567,6 +569,8 @@ sub update_table_definitions {
# 2009-01-16 oreomike@gmail.com - Bug 302420
$dbh
->
bz_add_column
(
'whine_events'
,
'mailifnobugs'
,
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
'FALSE'
});
_convert_disallownew_to_isactive
();
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
...
...
@@ -591,8 +595,11 @@ sub _update_pre_checksetup_bugzillas {
$dbh
->
bz_add_column
(
'bugs'
,
'qa_contact'
,
{
TYPE
=>
'INT3'
});
$dbh
->
bz_add_column
(
'bugs'
,
'status_whiteboard'
,
{
TYPE
=>
'MEDIUMTEXT'
,
NOTNULL
=>
1
,
DEFAULT
=>
"''"
});
$dbh
->
bz_add_column
(
'products'
,
'disallownew'
,
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
},
0
);
if
(
!
$dbh
->
bz_column_info
(
'products'
,
'isactive'
)){
$dbh
->
bz_add_column
(
'products'
,
'disallownew'
,
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
},
0
);
}
$dbh
->
bz_add_column
(
'products'
,
'milestoneurl'
,
{
TYPE
=>
'TINYTEXT'
,
NOTNULL
=>
1
},
''
);
$dbh
->
bz_add_column
(
'components'
,
'initialqacontact'
,
...
...
@@ -3149,6 +3156,20 @@ sub _add_visiblity_value_to_value_tables {
}
}
sub
_convert_disallownew_to_isactive
{
my
$dbh
=
Bugzilla
->
dbh
;
if
(
$dbh
->
bz_column_info
(
'products'
,
'disallownew'
)){
$dbh
->
bz_add_column
(
'products'
,
'isactive'
,
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
'TRUE'
});
# isactive is the boolean reverse of disallownew.
$dbh
->
do
(
'UPDATE products SET isactive = 0 WHERE disallownew = 1'
);
$dbh
->
do
(
'UPDATE products SET isactive = 1 WHERE disallownew = 0'
);
$dbh
->
bz_drop_column
(
'products'
,
'disallownew'
);
}
}
1
;
__END__
...
...
Bugzilla/Product.pm
View file @
e39a1db4
...
...
@@ -53,7 +53,7 @@ use constant DB_COLUMNS => qw(
classification_id
description
milestoneurl
disallownew
isactive
votesperuser
maxvotesperbug
votestoconfirm
...
...
@@ -71,7 +71,7 @@ use constant UPDATE_COLUMNS => qw(
description
defaultmilestone
milestoneurl
disallownew
isactive
votesperuser
maxvotesperbug
votestoconfirm
...
...
@@ -84,7 +84,7 @@ use constant VALIDATORS => {
version
=>
\&
_check_version
,
defaultmilestone
=>
\&
_check_default_milestone
,
milestoneurl
=>
\&
_check_milestone_url
,
disallownew
=>
\&
Bugzilla::Object::
check_boolean
,
isactive
=>
\&
Bugzilla::Object::
check_boolean
,
votesperuser
=>
\&
_check_votes_per_user
,
maxvotesperbug
=>
\&
_check_votes_per_bug
,
votestoconfirm
=>
\&
_check_votes_to_confirm
,
...
...
@@ -601,7 +601,7 @@ sub set_name { $_[0]->set('name', $_[1]); }
sub
set_description
{
$_
[
0
]
->
set
(
'description'
,
$_
[
1
]);
}
sub
set_default_milestone
{
$_
[
0
]
->
set
(
'defaultmilestone'
,
$_
[
1
]);
}
sub
set_milestone_url
{
$_
[
0
]
->
set
(
'milestoneurl'
,
$_
[
1
]);
}
sub
set_
disallow_new
{
$_
[
0
]
->
set
(
'disallownew
'
,
$_
[
1
]);
}
sub
set_
is_active
{
$_
[
0
]
->
set
(
'isactive
'
,
$_
[
1
]);
}
sub
set_votes_per_user
{
$_
[
0
]
->
set
(
'votesperuser'
,
$_
[
1
]);
}
sub
set_votes_per_bug
{
$_
[
0
]
->
set
(
'maxvotesperbug'
,
$_
[
1
]);
}
sub
set_votes_to_confirm
{
$_
[
0
]
->
set
(
'votestoconfirm'
,
$_
[
1
]);
}
...
...
@@ -858,7 +858,7 @@ sub flag_types {
sub
description
{
return
$_
[
0
]
->
{
'description'
};
}
sub
milestone_url
{
return
$_
[
0
]
->
{
'milestoneurl'
};
}
sub
disallow_new
{
return
$_
[
0
]
->
{
'disallownew
'
};
}
sub
is_active
{
return
$_
[
0
]
->
{
'isactive
'
};
}
sub
votes_per_user
{
return
$_
[
0
]
->
{
'votesperuser'
};
}
sub
max_votes_per_bug
{
return
$_
[
0
]
->
{
'maxvotesperbug'
};
}
sub
votes_to_confirm
{
return
$_
[
0
]
->
{
'votestoconfirm'
};
}
...
...
@@ -911,7 +911,7 @@ Bugzilla::Product - Bugzilla product class.
my $name = $product->name;
my $description = $product->description;
my $milestoneurl = $product->milestone_url;
my
disallownew = $product->disallow_new
;
my
isactive = $product->is_active
;
my votesperuser = $product->votes_per_user;
my maxvotesperbug = $product->max_votes_per_bug;
my votestoconfirm = $product->votes_to_confirm;
...
...
Bugzilla/User.pm
View file @
e39a1db4
...
...
@@ -759,7 +759,7 @@ sub get_enterable_products {
AND group_control_map.entry != 0
AND group_id NOT IN ('
.
$self
->
groups_as_string
.
')
WHERE group_id IS NULL
AND products.
disallownew = 0
'
)
||
[]
};
AND products.
isactive = 1
'
)
||
[]
};
if
(
@enterable_ids
)
{
# And all of these products must have at least one component
...
...
contrib/gnats2bz.pl
View file @
e39a1db4
...
...
@@ -780,10 +780,10 @@ sub write_non_bugs_tables {
print
DATA
"\ninsert into products (\n"
;
print
DATA
" product, description, milestoneurl,
disallownew
\n"
;
" product, description, milestoneurl,
isactive
\n"
;
print
DATA
") values (\n"
;
print
DATA
" $product, $description, '',
0
\n"
;
" $product, $description, '',
1
\n"
;
print
DATA
");\n"
;
print
DATA
"\ninsert into components (\n"
;
...
...
contrib/gnatsparse/gnatsparse.py
View file @
e39a1db4
...
...
@@ -144,9 +144,9 @@ def write_non_bug_tables():
# Insert the products
print
>>
outfile
,
"
\n
insert into products ("
print
>>
outfile
,
" product, description, milestoneurl,
disallownew
,"
print
>>
outfile
,
" product, description, milestoneurl,
isactive
,"
print
>>
outfile
,
" defaultmilestone, votestoconfirm) values ("
print
>>
outfile
,
" '
%
s', '
%
s', '
%
s',
0
, '
%
s', 1);"
%
(
product
,
print
>>
outfile
,
" '
%
s', '
%
s', '
%
s',
1
, '
%
s', 1);"
%
(
product
,
productdesc
,
milestoneurl
,
defaultmilestone
)
...
...
editproducts.cgi
View file @
e39a1db4
...
...
@@ -173,7 +173,7 @@ if ($action eq 'new') {
version
=>
scalar
$cgi
->
param
(
'version'
),
defaultmilestone
=>
scalar
$cgi
->
param
(
'defaultmilestone'
),
milestoneurl
=>
scalar
$cgi
->
param
(
'milestoneurl'
),
disallownew
=>
scalar
$cgi
->
param
(
'disallownew
'
),
isactive
=>
scalar
$cgi
->
param
(
'isactive
'
),
votesperuser
=>
scalar
$cgi
->
param
(
'votesperuser'
),
maxvotesperbug
=>
scalar
$cgi
->
param
(
'maxvotesperbug'
),
votestoconfirm
=>
scalar
$cgi
->
param
(
'votestoconfirm'
),
...
...
@@ -285,7 +285,7 @@ if ($action eq 'update') {
$product
->
set_description
(
scalar
$cgi
->
param
(
'description'
));
$product
->
set_default_milestone
(
scalar
$cgi
->
param
(
'defaultmilestone'
));
$product
->
set_milestone_url
(
scalar
$cgi
->
param
(
'milestoneurl'
));
$product
->
set_
disallow_new
(
scalar
$cgi
->
param
(
'disallownew
'
));
$product
->
set_
is_active
(
scalar
$cgi
->
param
(
'is_active
'
));
$product
->
set_votes_per_user
(
scalar
$cgi
->
param
(
'votesperuser'
));
$product
->
set_votes_per_bug
(
scalar
$cgi
->
param
(
'maxvotesperbug'
));
$product
->
set_votes_to_confirm
(
scalar
$cgi
->
param
(
'votestoconfirm'
));
...
...
template/en/default/admin/products/confirm-delete.html.tmpl
View file @
e39a1db4
...
...
@@ -93,10 +93,10 @@
<tr>
<td>Closed for [% terms.bugs %]:</td>
<td>
[% IF product.disallownew %]
closed
[% ELSE %]
[% IF product.is_active %]
open
[% ELSE %]
closed
[% END %]
</td>
</tr>
...
...
template/en/default/admin/products/create.html.tmpl
View file @
e39a1db4
...
...
@@ -31,6 +31,7 @@
product.votesperuser = "0",
product.maxvotesperbug = "10000",
product.votestoconfirm = "0",
product.is_active = 1,
version = "unspecified",
product.defaultmilestone = constants.DEFAULT_MILESTONE
%]
...
...
template/en/default/admin/products/edit-common.html.tmpl
View file @
e39a1db4
...
...
@@ -70,10 +70,9 @@
[% END %]
<tr>
<th align="right">Closed for [% terms.bug %] entry:</th>
<td><input type="checkbox" name="disallownew" value="1"
[% IF product.disallownew == "1" %]
checked="checked"[% END %]>
<th align="right">Open for [% terms.bug %] entry:</th>
<td><input type="checkbox" name="is_active" value="1"
[% ' checked="checked"' IF product.is_active %]>
</td>
</tr>
...
...
template/en/default/admin/products/list.html.tmpl
View file @
e39a1db4
...
...
@@ -60,8 +60,9 @@
allow_html_content => 1
},
{
name => "
disallow_new
"
name => "
is_active
"
heading => "Open For New $terms.Bugs"
yesno_field => 1
},
{
name => "votesperuser"
...
...
@@ -99,20 +100,6 @@
})
%]
[% overrides.disallow_new = [ {
match_value => "1"
match_field => 'disallow_new'
override_content => 1
content => "No"
},
{
match_value => 0
match_field => 'disallow_new'
override_content => 1
content => "Yes"
}]
%]
[% PROCESS admin/table.html.tmpl
columns = columns
data = products
...
...
template/en/default/admin/products/updated.html.tmpl
View file @
e39a1db4
...
...
@@ -55,13 +55,13 @@
<p style="margin: 1em 3em 1em 3em">[% product.description FILTER html_light %]</p>
[% END %]
[% IF changes.
disallownew
.defined %]
[% IF changes.
isactive
.defined %]
<p>
Product is now
[% IF product.
disallow_new
%]
closed to
[% IF product.
is_active
%]
open for
[% ELSE %]
open for
closed to
[% END %]
new [% terms.bugs %].
</p>
...
...
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