diff options
Diffstat (limited to 'extensions/GuidedBugEntry')
-rw-r--r-- | extensions/GuidedBugEntry/Extension.pm | 18 | ||||
-rw-r--r-- | extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl | 8 |
2 files changed, 14 insertions, 12 deletions
diff --git a/extensions/GuidedBugEntry/Extension.pm b/extensions/GuidedBugEntry/Extension.pm index 5665e18ae..127a93a8e 100644 --- a/extensions/GuidedBugEntry/Extension.pm +++ b/extensions/GuidedBugEntry/Extension.pm @@ -14,6 +14,7 @@ use Bugzilla::Error; use Bugzilla::Status; use Bugzilla::Util 'url_quote'; use Bugzilla::UserAgent; +use Bugzilla::Extension::BMO::Data; our $VERSION = '1'; @@ -92,9 +93,6 @@ sub _init_vars { $vars->{'platform'} = detect_platform(); $vars->{'op_sys'} = detect_op_sys(); - - eval 'use Bugzilla::Extension::BMO::Data'; - $vars->{'BMO'} = $@ ? 0 : 1; } sub page_before_template { @@ -104,13 +102,17 @@ sub page_before_template { return unless $page eq 'guided_products.js'; - # import product -> security group mappings from the BMO ext + # import data from the BMO ext - our %product_sec_groups; - eval q#use Bugzilla::Extension::BMO::Data '%product_sec_groups'#; - return if $@; + $vars->{'product_sec_groups'} = \%product_sec_groups; - $vars->{'products'} = \%product_sec_groups; + my %bug_formats; + foreach my $product (keys %create_bug_formats) { + if (my $format = Bugzilla::Extension::BMO::forced_format($product)) { + $bug_formats{$product} = $format; + } + } + $vars->{'create_bug_formats'} = \%bug_formats; } __PACKAGE__->NAME; diff --git a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl index 268fe06f8..b58df8298 100644 --- a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl @@ -8,16 +8,16 @@ [%# this file allows us to pull in data defined in the BMO ext %] -[% IF formats %] - [% FOREACH product = formats %] +[% IF create_bug_formats %] + [% FOREACH product = create_bug_formats %] if (!products['[% product.key FILTER js %]']) [% ~%] products['[% product.key FILTER js %]'] = {}; products['[% product.key FILTER js %]'].format = '[% product.value FILTER js %]'; [% END %] [% END %] -[% IF products %] - [% FOREACH product = products %] +[% IF product_sec_groups %] + [% FOREACH product = product_sec_groups %] if (!products['[% product.key FILTER js %]']) [% ~%] products['[% product.key FILTER js %]'] = {}; products['[% product.key FILTER js %]'].secgroup = '[% product.value FILTER js %]'; |