diff options
author | Byron Jones <bjones@mozilla.com> | 2013-03-04 19:49:50 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-03-04 19:49:50 +0100 |
commit | 6919f41e51cacaa8f6b4ae7bcdbd010c8d6aefe5 (patch) | |
tree | b03bd17dc6dd680197d1ef44d350543e82096490 /extensions/GuidedBugEntry/web/js | |
parent | 1143f1d0a5162c60e8bc893f0c9c6f2c5aa559d0 (diff) | |
download | bugzilla-6919f41e51cacaa8f6b4ae7bcdbd010c8d6aefe5.tar.gz bugzilla-6919f41e51cacaa8f6b4ae7bcdbd010c8d6aefe5.tar.xz |
Bug 834119: add the ability to force users into using a custom bug format
Diffstat (limited to 'extensions/GuidedBugEntry/web/js')
-rw-r--r-- | extensions/GuidedBugEntry/web/js/guided.js | 15 |
1 files changed, 15 insertions, 0 deletions
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(); |