summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/template/en/default/bug/create/create-employee-incident.html.tmpl
blob: 1c12745419c070179921e75ff7ce11a736d103c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the BMO Bugzilla Extension.
  #
  # The Initial Developer of the Original Code is the Mozilla Foundation
  # Portions created by the Initial Developers are Copyright (C) 2011 the
  # Initial Developer. All Rights Reserved.
  #
  # Contributor(s):
  #   David Lawrence <dkl@mozilla.com>
  #%]

[% PROCESS global/variables.none.tmpl %]

[% PROCESS global/header.html.tmpl
   title = "Mozilla Corporation/Foundation Employee Incident"
%]

[% USE Bugzilla %]

<script type="text/javascript">
    var type_desc = new Array();
    type_desc['safety'] = "If this is an emergency please immediately call your local police or emergency number.";
    type_desc['stolen'] = "Please report a lost Mozilla laptop or any mobile device that was used to access<br> " +
                          "Mozilla email or contained passwords for Mozilla servers, devices, applications, etc.";

    function validateAndSubmit() {
        var alert_text = '';
        var typeSelect = YAHOO.util.Dom.get('incident_type');
        var typeValue  = typeSelect.options[typeSelect.selectedIndex].value;

        if (typeValue != 'stolen' && !isFilledOut('short_desc')) {
            alert_text += "Please enter a summary.\n";
        }

        var select = YAHOO.util.Dom.get('incident_type');
        var selectValue = select.options[select.selectedIndex].value;
        if (selectValue == 'stolen') {
            if (!isFilledOut('device')) {
                alert_text += "Please provide the type of device.\n";
            }
            if (!isFilledOut('encrypted')) {
                alert_text += "Please answer whether the device was encrypted.\n";
            }
            if (!isFilledOut('userdata')) {
                alert_text += "Please answer whether the device had user data.\n";
            }
            if (!isFilledOut('rememberpasswords')) {
                alert_text += "Please answer whether the browser was configured to remember passwords.\n";
            }
        }

        if (alert_text) {
            alert(alert_text);
            return false;
        }

        // Hard code summary if stolen type was chosen
        if (typeValue == 'stolen') {
             document.getElementById('short_desc').value = '[Lost Device] Change LDAP Password for [% user.name FILTER js %]';
        }

        return true;
    }

    function setType (select) {
        var selectValue = select.options[select.selectedIndex].value;

        // Set the current description displayed.
        document.getElementById('type_desc').innerHTML = type_desc[selectValue];

        // Display/hide some additional fields based on type selected
        if (selectValue == 'stolen') {
            YAHOO.util.Dom.removeClass('stolen', 'bz_default_hidden');
            YAHOO.util.Dom.addClass('safety', 'bz_default_hidden');
        }
        else {
            YAHOO.util.Dom.removeClass('safety', 'bz_default_hidden');
            YAHOO.util.Dom.addClass('stolen', 'bz_default_hidden');
        }

        // Alter the product/component/group based on type selected
        if (selectValue == 'stolen') {
            document.getElementById('product').value        = 'mozilla.org';
            document.getElementById('component').value      = 'Server Operations: Desktop Issues';
            document.getElementById('groups').value         = 'infra';
            document.getElementById('cc').value             = 'jstevensen@mozilla.com, afowler@mozilla.com';
            document.getElementById('bug_severity').value   = 'critical';
            document.getElementById('display_action').value = 'ldap';
        }
        else {
            document.getElementById('product').value        = 'Mozilla Corporation';
            document.getElementById('component').value      = 'Facilities Management';
            document.getElementById('groups').value         = 'hr';
            document.getElementById('cc').value             = 'dcohen@mozilla.com, jill@mozilla.com';
            document.getElementById('bug_severity').value   = 'normal';
            document.getElementById('display_action').value = '';
        }
    }

    function toggleEnabled (source, value, target) {
        var sourceElement = YAHOO.util.Dom.get(source);
        var targetElement = YAHOO.util.Dom.get(target);
        if (sourceElement[sourceElement.selectedIndex].value == value) {
            targetElement.disabled = false;
            targetElement.focus();
        }
        else {
            targetElement.disabled = true;
        }
    }

    function isFilledOut(elem_id)  {
        var str = document.getElementById(elem_id).value;
        return str.length > 0 && str != "noneselected";
    }

    YAHOO.util.Event.onDOMReady(function () {
        setType(document.getElementById('incident_type'));
        toggleEnabled('userdata', 'Yes', 'sensitivedata');
        toggleEnabled('rememberpasswords', 'Yes', 'criticalsites');
    });
</script>

<p><strong>Please use this form for employee incidents only!</strong></p>
<p>If you have a [% terms.bug %] to file, go <a href="enter_bug.cgi">here</a>.</p>
<p><span style="color: red;">*</span> Required Fields</p>
<form method="post" action="post_bug.cgi" id="incidentForm" enctype="multipart/form-data"
      onSubmit="return validateAndSubmit();">
  <input type="hidden" id="product" name="product" value="">
  <input type="hidden" id="component" name="component" value="">
  <input type="hidden" id="rep_platform" name="rep_platform" value="All">
  <input type="hidden" id="op_sys" name="op_sys" value="All">
  <input type="hidden" id="priority" name="priority" value="--">
  <input type="hidden" id="version" name="version" value="other">
  <input type="hidden" id="cc" name="cc" value="">
  <input type="hidden" id="groups" name="groups" value="">
  <input type="hidden" id="format" name="format" value="employee-incident">
  <input type="hidden" id="bug_severity" name="bug_severity" value="">
  <input type="hidden" id="display_action" name="display_action" value="">
  <input type="hidden" id="token" name="token" value="[% token FILTER html %]">

  <table>
    <tr>
      <td align="right" valign="top"><strong>Incident Type:</strong></td>
      <td>
        <select id="incident_type" name="incident_type" onchange="setType(this);">
          <option value="safety" selected>Report a Safety Concern</option>
          <option value="stolen">My laptop or phone was lost/stolen</option>
        </select>
        <div id="type_desc" style="color:red;"></div>
      </td>
    </tr>
    <tbody id="safety" class="bz_default_hidden">
      <tr class="safety">
        <td align="right">
          <strong><span style="color: red;">*</span> Summary:</strong>
        </td>
        <td>
          <input name="short_desc" id="short_desc" size="60"
                 value="[% short_desc FILTER html %]">
        </td>
      </tr>
    </tbody>
    <tbody id="stolen" class="bz_default_hidden">
      <tr>
        <td align="right" valign="top"><strong>Stolen Details:</strong></td>
        <td>
          <table>
          <tr>
            <td>
              <label for="device">
                <strong><span style="color: red;">*</span></strong>
                Type of device lost:
              </label>
            </td>
            <td>
              <select name="device" id="device">
                <option value="">---</option>
                <option value="Mobile Phone">Mobile Phone</option>
                <option value="Tablet">Tablet</option>
                <option value="Laptop">Laptop</option>
                <option value="WorkStation">WorkStation</option>
                <option value="Portable Storage Device">Portable Storage Device</option>
                <option value="Other">Other (describe in 'Extra Notes')</option>
              </select>
            </td>
          </tr>
          <tr>
            <td>
              <label for="encrypted">
                <strong><span style="color: red;">*</span></strong>
                To your knowledge,  was your device encrypted?
              </label>
            </td>
            <td>
              <select name="encrypted" id="encrypted">
                <option value="">---</option>
                <option value="No">No</option>
                <option value="Yes">Yes</option>
              </select>
            </td>
          </tr>
          <tr>
            <td>
              <label for="userdata">
                <strong><span style="color: red;">*</span></strong>
                Did you have any user data on your device?
              </label>
            </td>
            <td>
              <select name="userdata" id="userdata"
                      onchange="toggleEnabled('userdata', 'Yes', 'sensitivedata');">
                <option value="">---</option>
                <option value="No">No</option>
                <option value="Yes">Yes</option>
              </select>
            </td>
           </tr>
           </table>
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>If yes, what sensitive data was stored on your device?</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <textarea name="sensitivedata" id="sensitivedata" rows="10" cols="80"></textarea>
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <label for="rememberpasswords">
            <strong><span style="color: red;">*</span></strong>
            Was your browser configured to remember passwords
            (<a href="http://support.mozilla.com/en-US/kb/make-firefox-remember-usernames-and-passwords">more info</a>)?
          </label>
          <select name="rememberpasswords" id="rememberpasswords"
                  onchange="toggleEnabled('rememberpasswords', 'Yes', 'criticalsites');">
            <option value="">---</option>
            <option value="No">No</option>
            <option value="Yes">Yes</option>
          </select>
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>If yes, which critical sites were included?</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <textarea name="criticalsites" id="criticalsites" rows="10" cols="80"></textarea>
        </td>
      </tr>
    </tbody>
    <tr>
      <td align="right" valign="top"><strong>Extra Notes:</strong></td>
      <td>
        <textarea name="comment" rows="10" cols="80">
          [% comment FILTER html %]</textarea>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>
        <input type="submit" id="commit" value="Submit Request">
      </td>
    </tr>
  </table>
</form>

<p>
  Thanks for contacting us. You will be notified by email of any progress made in resolving your request.
</p>

[% PROCESS global/footer.html.tmpl %]