diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-03-07 23:04:11 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-03-07 23:04:11 +0100 |
commit | 136d427d43ec2536ab2b23291ff6ee7614a93c49 (patch) | |
tree | 198f0a01f45556147279b2a47037273d04d7e608 /extensions/MozProjectReview/Extension.pm | |
parent | d22f87824f5f201453482ae74ceaabb2b8f70ecb (diff) | |
download | bugzilla-136d427d43ec2536ab2b23291ff6ee7614a93c49.tar.gz bugzilla-136d427d43ec2536ab2b23291ff6ee7614a93c49.tar.xz |
Bug 841202 - Refactor code in current MozProjectReview extension to be less complex and more maintainable
Diffstat (limited to 'extensions/MozProjectReview/Extension.pm')
-rw-r--r-- | extensions/MozProjectReview/Extension.pm | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/extensions/MozProjectReview/Extension.pm b/extensions/MozProjectReview/Extension.pm index 0f5c2b735..a7c632f46 100644 --- a/extensions/MozProjectReview/Extension.pm +++ b/extensions/MozProjectReview/Extension.pm @@ -41,6 +41,13 @@ sub post_bug_after_creation { my ($do_sec_review, $do_legal, $do_finance, $do_privacy_vendor, $do_data_safety, $do_privacy_tech, $do_privacy_policy); + # Logic section which dictates which bugs are created. This should be + # similar to the logic used in extensions/MozProjectReview/web/js/moz_project_review.js + + if ($params->{new_or_change} eq 'New') { + $do_legal = 1; + } + if ($params->{mozilla_data} eq 'Yes') { $do_legal = 1; $do_privacy_policy = 1; @@ -54,15 +61,15 @@ sub post_bug_after_creation { $do_data_safety = 1; } - if ($params->{new_or_change} eq 'New') { - $do_legal = 1; - } - if ($params->{separate_party} eq 'Yes') { if ($params->{relationship_type} ne 'Hardware Purchase') { $do_legal = 1; } + if ($params->{relationship_type} eq 'Hardware Purchase') { + $do_finance = 1; + } + if ($params->{data_access} eq 'Yes') { $do_privacy_policy = 1; $do_legal = 1; @@ -106,11 +113,8 @@ sub post_bug_after_creation { } if ($do_legal) { - my $component; - if ($params->{new_or_change} eq 'New') { - $component = 'General'; - } - elsif ($params->{new_or_change} eq 'Existing') { + my $component = 'General'; + if ($params->{new_or_change} eq 'Existing') { $component = $params->{mozilla_project}; } |