diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2011-12-21 18:42:51 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2011-12-21 18:42:51 +0100 |
commit | eca4822f0ad4733af64425c10b9edd1d7ca62772 (patch) | |
tree | 1f7684f00e053b80a6d0ffadf1aa147e4e9e2fc4 /extensions/BMO/Extension.pm | |
parent | 5cbb1c79abf94ffdd55f554c910da64cd9782503 (diff) | |
download | bugzilla-eca4822f0ad4733af64425c10b9edd1d7ca62772.tar.gz bugzilla-eca4822f0ad4733af64425c10b9edd1d7ca62772.tar.xz |
merged with bmo/4.0
Diffstat (limited to 'extensions/BMO/Extension.pm')
-rw-r--r-- | extensions/BMO/Extension.pm | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index e8e58db27..44a1a3e69 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -186,6 +186,26 @@ sub _get_field_values_sort_key { return \%field_values; } +sub active_custom_fields { + my ($self, $args) = @_; + my $fields = $args->{'fields'}; + my $params = $args->{'params'}; + my $product = $params->{'product'}; + my $component = $params->{'component'}; + + return if !$product; + + my $product_name = blessed $product ? $product->name : $product; + my $component_name = blessed $component ? $component->name : $component; + + my @tmp_fields; + foreach my $field (@$$fields) { + next if cf_hidden_in_product($field->name, $product_name, $component_name, $params->{'type'}); + push(@tmp_fields, $field); + } + $$fields = \@tmp_fields; +} + sub cf_hidden_in_product { my ($field_name, $product_name, $component_name, $custom_flag_mode) = @_; @@ -196,8 +216,11 @@ sub cf_hidden_in_product { # Also in buglist.cgi, we pass in a list of components instead # of a single compoent name everywhere else. - my $component_list = ref $component_name ? $component_name - : [ $component_name ]; + my $component_list = []; + if ($component_name) { + $component_list = ref $component_name ? $component_name + : [ $component_name ]; + } if ($custom_flag_mode) { if ($custom_flag_mode == 1) { |