diff options
Diffstat (limited to 'extensions/GuidedBugEntry')
-rw-r--r-- | extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl | 10 | ||||
-rw-r--r-- | extensions/GuidedBugEntry/web/js/guided.js | 15 |
2 files changed, 24 insertions, 1 deletions
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 231681085..268fe06f8 100644 --- a/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/pages/guided_products.js.tmpl @@ -8,9 +8,17 @@ [%# this file allows us to pull in data defined in the BMO ext %] +[% IF formats %] + [% FOREACH product = 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 (!products['[% product.key FILTER js %]']) + if (!products['[% product.key FILTER js %]']) [% ~%] products['[% product.key FILTER js %]'] = {}; products['[% product.key FILTER js %]'].secgroup = '[% product.value FILTER js %]'; [% END %] diff --git a/extensions/GuidedBugEntry/web/js/guided.js b/extensions/GuidedBugEntry/web/js/guided.js index 1883e4eb6..8eaf6b3b5 100644 --- a/extensions/GuidedBugEntry/web/js/guided.js +++ b/extensions/GuidedBugEntry/web/js/guided.js @@ -17,9 +17,11 @@ var guided = { detectedOpSys: '', currentUser: '', openStates: [], + updateStep: true, setStep: function(newStep, noSetHistory) { // initialise new step + this.updateStep = true; switch(newStep) { case 'product': product.onShow(); @@ -38,6 +40,9 @@ var guided = { return; } + if (!this.updateStep) + return; + // change visibility of _step div if (this._currentStep) Dom.addClass(this._currentStep + '_step', 'hidden'); @@ -586,6 +591,16 @@ var bugForm = { }, onShow: function() { + // check for a forced format + var productName = product.getName(); + if (products[productName] && products[productName].format) { + Dom.addClass('advanced', 'hidden'); + document.location.href = 'enter_bug.cgi?format=' + encodeURIComponent(products[productName].format) + + '&product=' + encodeURIComponent(productName) + + '&short_desc=' + encodeURIComponent(dupes.getSummary()); + guided.updateStep = false; + return; + } Dom.removeClass('advanced', 'hidden'); // default the summary to the dupes query Dom.get('short_desc').value = dupes.getSummary(); |