summaryrefslogtreecommitdiffstats
path: root/extensions/GuidedBugEntry/web/js/guided.js
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-03-04 19:49:50 +0100
committerByron Jones <bjones@mozilla.com>2013-03-04 19:49:50 +0100
commit6919f41e51cacaa8f6b4ae7bcdbd010c8d6aefe5 (patch)
treeb03bd17dc6dd680197d1ef44d350543e82096490 /extensions/GuidedBugEntry/web/js/guided.js
parent1143f1d0a5162c60e8bc893f0c9c6f2c5aa559d0 (diff)
downloadbugzilla-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/guided.js')
-rw-r--r--extensions/GuidedBugEntry/web/js/guided.js15
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();