Skip to content

Commit 7a70134

Browse files
committed
Bug 1037663: Make custom bug entry forms more discoverable
1 parent 9773ddf commit 7a70134

File tree

11 files changed

+311
-521
lines changed

11 files changed

+311
-521
lines changed
Lines changed: 7 additions & 284 deletions
Original file line numberDiff line numberDiff line change
@@ -1,288 +1,11 @@
1-
[%# The contents of this file are subject to the Mozilla Public
2-
# License Version 1.1 (the "License"); you may not use this file
3-
# except in compliance with the License. You may obtain a copy of
4-
# the License at http://www.mozilla.org/MPL/
1+
[%# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
54
#
6-
# Software distributed under the License is distributed on an "AS
7-
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8-
# implied. See the License for the specific language governing
9-
# rights and limitations under the License.
10-
#
11-
# The Original Code is the BMO Bugzilla Extension.
12-
#
13-
# The Initial Developer of the Original Code is the Mozilla Foundation
14-
# Portions created by the Initial Developers are Copyright (C) 2011 the
15-
# Initial Developer. All Rights Reserved.
16-
#
17-
# Contributor(s):
18-
# David Lawrence <dkl@mozilla.com>
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
197
#%]
208

21-
[% PROCESS global/variables.none.tmpl %]
22-
23-
[% PROCESS global/header.html.tmpl
24-
title = "Mozilla Corporation/Foundation Employee Incident"
9+
[% PROCESS global/redirect.html.tmpl
10+
url = "https://mozilla.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=4f9468ef184a30004a467ddd1a20df63"
2511
%]
26-
27-
[% USE Bugzilla %]
28-
29-
<script type="text/javascript">
30-
var type_desc = new Array();
31-
type_desc['safety'] = "If this is an emergency please immediately call your local police or emergency number.";
32-
type_desc['stolen'] = "Please report a lost Mozilla laptop or any mobile device that was used to access<br> " +
33-
"Mozilla email or contained passwords for Mozilla servers, devices, applications, etc.";
34-
35-
function validateAndSubmit() {
36-
var alert_text = '';
37-
var typeSelect = YAHOO.util.Dom.get('incident_type');
38-
var typeValue = typeSelect.options[typeSelect.selectedIndex].value;
39-
40-
if (typeValue != 'stolen' && !isFilledOut('short_desc')) {
41-
alert_text += "Please enter a summary.\n";
42-
}
43-
44-
var select = YAHOO.util.Dom.get('incident_type');
45-
var selectValue = select.options[select.selectedIndex].value;
46-
if (selectValue == 'stolen') {
47-
if (!isFilledOut('device')) {
48-
alert_text += "Please provide the type of device.\n";
49-
}
50-
if (!isFilledOut('encrypted')) {
51-
alert_text += "Please answer whether the device was encrypted.\n";
52-
}
53-
if (!isFilledOut('userdata')) {
54-
alert_text += "Please answer whether the device had user data.\n";
55-
}
56-
if (!isFilledOut('rememberpasswords')) {
57-
alert_text += "Please answer whether the browser was configured to remember passwords.\n";
58-
}
59-
}
60-
61-
if (alert_text) {
62-
alert(alert_text);
63-
return false;
64-
}
65-
66-
// Hard code summary if stolen type was chosen
67-
if (typeValue == 'stolen') {
68-
document.getElementById('short_desc').value = '[Lost Device] Change LDAP Password for [% user.name FILTER js %]';
69-
}
70-
71-
return true;
72-
}
73-
74-
function setType (select) {
75-
var selectValue = select.options[select.selectedIndex].value;
76-
77-
// Set the current description displayed.
78-
document.getElementById('type_desc').innerHTML = type_desc[selectValue];
79-
80-
// Display/hide some additional fields based on type selected
81-
if (selectValue == 'stolen') {
82-
YAHOO.util.Dom.removeClass('stolen', 'bz_default_hidden');
83-
YAHOO.util.Dom.addClass('safety', 'bz_default_hidden');
84-
}
85-
else {
86-
YAHOO.util.Dom.removeClass('safety', 'bz_default_hidden');
87-
YAHOO.util.Dom.addClass('stolen', 'bz_default_hidden');
88-
}
89-
90-
// Alter the product/component/group based on type selected
91-
if (selectValue == 'stolen') {
92-
document.getElementById('product').value = 'mozilla.org';
93-
document.getElementById('component').value = 'Server Operations: Desktop Issues';
94-
document.getElementById('groups').value = 'infra';
95-
document.getElementById('cc').value = 'jstevensen@mozilla.com, afowler@mozilla.com';
96-
document.getElementById('bug_severity').value = 'critical';
97-
document.getElementById('display_action').value = 'ldap';
98-
}
99-
else {
100-
document.getElementById('product').value = 'Mozilla Corporation';
101-
document.getElementById('component').value = 'Facilities Management';
102-
document.getElementById('groups').value = 'hr';
103-
document.getElementById('cc').value = 'dcohen@mozilla.com, jill@mozilla.com';
104-
document.getElementById('bug_severity').value = 'normal';
105-
document.getElementById('display_action').value = '';
106-
}
107-
}
108-
109-
function toggleEnabled (source, value, target) {
110-
var sourceElement = YAHOO.util.Dom.get(source);
111-
var targetElement = YAHOO.util.Dom.get(target);
112-
if (sourceElement[sourceElement.selectedIndex].value == value) {
113-
targetElement.disabled = false;
114-
targetElement.focus();
115-
}
116-
else {
117-
targetElement.disabled = true;
118-
}
119-
}
120-
121-
function isFilledOut(elem_id) {
122-
var str = document.getElementById(elem_id).value;
123-
return str.length > 0 && str != "noneselected";
124-
}
125-
126-
YAHOO.util.Event.onDOMReady(function () {
127-
setType(document.getElementById('incident_type'));
128-
toggleEnabled('userdata', 'Yes', 'sensitivedata');
129-
toggleEnabled('rememberpasswords', 'Yes', 'criticalsites');
130-
});
131-
</script>
132-
133-
<p><strong>Please use this form for employee incidents only!</strong></p>
134-
<p>If you have a [% terms.bug %] to file, go <a href="enter_bug.cgi">here</a>.</p>
135-
<p><span style="color: red;">*</span> Required Fields</p>
136-
<form method="post" action="post_bug.cgi" id="incidentForm" enctype="multipart/form-data"
137-
onSubmit="return validateAndSubmit();">
138-
<input type="hidden" id="product" name="product" value="">
139-
<input type="hidden" id="component" name="component" value="">
140-
<input type="hidden" id="rep_platform" name="rep_platform" value="All">
141-
<input type="hidden" id="op_sys" name="op_sys" value="All">
142-
<input type="hidden" id="priority" name="priority" value="--">
143-
<input type="hidden" id="version" name="version" value="other">
144-
<input type="hidden" id="cc" name="cc" value="">
145-
<input type="hidden" id="groups" name="groups" value="">
146-
<input type="hidden" id="format" name="format" value="employee-incident">
147-
<input type="hidden" id="bug_severity" name="bug_severity" value="">
148-
<input type="hidden" id="display_action" name="display_action" value="">
149-
<input type="hidden" id="token" name="token" value="[% token FILTER html %]">
150-
151-
<table>
152-
<tr>
153-
<td align="right" valign="top"><strong>Incident Type:</strong></td>
154-
<td>
155-
<select id="incident_type" name="incident_type" onchange="setType(this);">
156-
<option value="safety" selected>Report a Safety Concern</option>
157-
<option value="stolen">My laptop or phone was lost/stolen</option>
158-
</select>
159-
<div id="type_desc" style="color:red;"></div>
160-
</td>
161-
</tr>
162-
<tbody id="safety" class="bz_default_hidden">
163-
<tr class="safety">
164-
<td align="right">
165-
<strong><span style="color: red;">*</span> Summary:</strong>
166-
</td>
167-
<td>
168-
<input name="short_desc" id="short_desc" size="60"
169-
value="[% short_desc FILTER html %]">
170-
</td>
171-
</tr>
172-
</tbody>
173-
<tbody id="stolen" class="bz_default_hidden">
174-
<tr>
175-
<td align="right" valign="top"><strong>Stolen Details:</strong></td>
176-
<td>
177-
<table>
178-
<tr>
179-
<td>
180-
<label for="device">
181-
<strong><span style="color: red;">*</span></strong>
182-
Type of device lost:
183-
</label>
184-
</td>
185-
<td>
186-
<select name="device" id="device">
187-
<option value="">---</option>
188-
<option value="Mobile Phone">Mobile Phone</option>
189-
<option value="Tablet">Tablet</option>
190-
<option value="Laptop">Laptop</option>
191-
<option value="WorkStation">WorkStation</option>
192-
<option value="Portable Storage Device">Portable Storage Device</option>
193-
<option value="Other">Other (describe in 'Extra Notes')</option>
194-
</select>
195-
</td>
196-
</tr>
197-
<tr>
198-
<td>
199-
<label for="encrypted">
200-
<strong><span style="color: red;">*</span></strong>
201-
To your knowledge, was your device encrypted?
202-
</label>
203-
</td>
204-
<td>
205-
<select name="encrypted" id="encrypted">
206-
<option value="">---</option>
207-
<option value="No">No</option>
208-
<option value="Yes">Yes</option>
209-
</select>
210-
</td>
211-
</tr>
212-
<tr>
213-
<td>
214-
<label for="userdata">
215-
<strong><span style="color: red;">*</span></strong>
216-
Did you have any user data on your device?
217-
</label>
218-
</td>
219-
<td>
220-
<select name="userdata" id="userdata"
221-
onchange="toggleEnabled('userdata', 'Yes', 'sensitivedata');">
222-
<option value="">---</option>
223-
<option value="No">No</option>
224-
<option value="Yes">Yes</option>
225-
</select>
226-
</td>
227-
</tr>
228-
</table>
229-
</td>
230-
</tr>
231-
<tr>
232-
<td>&nbsp;</td>
233-
<td>If yes, what sensitive data was stored on your device?</td>
234-
</tr>
235-
<tr>
236-
<td>&nbsp;</td>
237-
<td>
238-
<textarea name="sensitivedata" id="sensitivedata" rows="10" cols="80"></textarea>
239-
</td>
240-
</tr>
241-
<tr>
242-
<td>&nbsp;</td>
243-
<td>
244-
<label for="rememberpasswords">
245-
<strong><span style="color: red;">*</span></strong>
246-
Was your browser configured to remember passwords
247-
(<a href="http://support.mozilla.com/en-US/kb/make-firefox-remember-usernames-and-passwords">more info</a>)?
248-
</label>
249-
<select name="rememberpasswords" id="rememberpasswords"
250-
onchange="toggleEnabled('rememberpasswords', 'Yes', 'criticalsites');">
251-
<option value="">---</option>
252-
<option value="No">No</option>
253-
<option value="Yes">Yes</option>
254-
</select>
255-
</td>
256-
</tr>
257-
<tr>
258-
<td>&nbsp;</td>
259-
<td>If yes, which critical sites were included?</td>
260-
</tr>
261-
<tr>
262-
<td>&nbsp;</td>
263-
<td>
264-
<textarea name="criticalsites" id="criticalsites" rows="10" cols="80"></textarea>
265-
</td>
266-
</tr>
267-
</tbody>
268-
<tr>
269-
<td align="right" valign="top"><strong>Extra Notes:</strong></td>
270-
<td>
271-
<textarea name="comment" rows="10" cols="80">
272-
[% comment FILTER html %]</textarea>
273-
</td>
274-
</tr>
275-
<tr>
276-
<td>&nbsp;</td>
277-
<td>
278-
<input type="submit" id="commit" value="Submit Request">
279-
</td>
280-
</tr>
281-
</table>
282-
</form>
283-
284-
<p>
285-
Thanks for contacting us. You will be notified by email of any progress made in resolving your request.
286-
</p>
287-
288-
[% PROCESS global/footer.html.tmpl %]

0 commit comments

Comments
 (0)