diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index db2653abc..d6873c360 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -91,26 +91,32 @@ sub new my $product; if (ref $param) { - $product = $param->{product}; - my $name = $param->{name}; - if (!defined $product) + if ($param->{id}) { - ThrowCodeError('bad_arg', { - argument => 'product', - function => "${class}::new", - }); + $param = { condition => 'id = ?', values => [ $param->{id} ] }; } - if (!defined $name) + else { - ThrowCodeError('bad_arg', { - argument => 'name', - function => "${class}::new", - }); + $product = $param->{product}; + my $name = $param->{name}; + if (!defined $product) + { + ThrowCodeError('bad_arg', { + argument => 'product', + function => "${class}::new", + }); + } + if (!defined $name) + { + ThrowCodeError('bad_arg', { + argument => 'name', + function => "${class}::new", + }); + } + my $condition = 'product_id = ? AND name = ?'; + my @values = ($product->id, $name); + $param = { condition => $condition, values => \@values }; } - - my $condition = 'product_id = ? AND name = ?'; - my @values = ($product->id, $name); - $param = { condition => $condition, values => \@values }; } unshift @_, $param; @@ -507,6 +513,7 @@ sub description { return $_[0]->{description}; } sub wiki_url { return $_[0]->{wiki_url}; } sub product_id { return $_[0]->{product_id}; } sub is_active { return $_[0]->{isactive}; } +sub full_name { return $_[0]->product->name.'/'.$_[0]->name; } ############################### #### Subroutines #### diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index 11e33f918..b47965f14 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -314,6 +314,7 @@ sub get_all_names sub is_active { return $_[0]->{isactive}; } sub sortkey { return $_[0]->{sortkey}; } +sub full_name { return $_[0]->name; } # FIXME Never use bug_count() on a copy from legal_values, as the result will be cached... sub bug_count diff --git a/template/en/default/admin/fieldvalues/control-list.html.tmpl b/template/en/default/admin/fieldvalues/control-list.html.tmpl index b8920da96..7f94d074d 100644 --- a/template/en/default/admin/fieldvalues/control-list.html.tmpl +++ b/template/en/default/admin/fieldvalues/control-list.html.tmpl @@ -3,7 +3,7 @@ # Authors: Vitaliy Filippov , Vladimir Koptev #%] -[% SET title = "Select Active " _ field.description _ " Objects For " _ field.value_field.description _ ' ' _ visibility_value.name | html %] +[% SET title = "Select Active " _ field.description _ " Objects For " _ field.value_field.description _ ' ' _ visibility_value.full_name | html %] [% PROCESS global/header.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/edit.html.tmpl b/template/en/default/admin/fieldvalues/edit.html.tmpl index 16ec70ad5..efd6ee652 100644 --- a/template/en/default/admin/fieldvalues/edit.html.tmpl +++ b/template/en/default/admin/fieldvalues/edit.html.tmpl @@ -114,7 +114,7 @@ [% FOREACH field_value = field.value_field.legal_values %] [% IF field.visibility_field_id != field.value_field_id || field.has_visibility_value(field_value.id) %] [% END %] [% END %]