summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl
blob: 8b2fd63da61969333b8844edb08e9e5710d24c0f (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
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

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

[% inline_style = BLOCK %]
  #bug_form input[type=text], #bug_form input[type=file], #bug_form textarea {
    width: 100%;
  }
[% END %]

[% inline_js = BLOCK %]
  var compdesc = new Array();
  [% FOREACH comp = product.components %]
    compdesc['[% comp.name FILTER js %]'] = '[% comp.description FILTER js %]';
  [% END %]
  function showCompDesc(component) {
    var value = component.value;
    document.getElementById('comp_description').innerHTML = compdesc[value];
  }

  function onSubmit() {
    var alert_text = '';
    if (!isFilledOut('component'))
      alert_text += "Please select a value for request type.\n";
    if (!isFilledOut('short_desc'))
      alert_text += "Please enter a value for the summary.\n";
    if (!isFilledOut('team_priority'))
      alert_text += "Please select a value for team priority.\n";
    if (!isFilledOut('signature_time'))
      alert_text += "Please enter a value for signture timeframe.\n";
    if (!isFilledOut('other_party'))
      alert_text += "Please enter a value for the name of other party.\n";
    if (!isFilledOut('business_obj'))
      alert_text += "Please enter a value for business objective.\n";
    if (!isFilledOut('what_purchase'))
      alert_text += "Please enter a value for what you are purchasing.\n";
    if (!isFilledOut('why_purchase'))
      alert_text += "Please enter a value for why the purchase is needed.\n";
    if (!isFilledOut('risk_purchase'))
      alert_text += "Please enter a value for the risk if not purchased.\n";
    if (!isFilledOut('alternative_purchase'))
      alert_text += "Please enter a value for the purchase alternative.\n";
    if (!isFilledOut('total_cost'))
      alert_text += "Please enter a value for total cost.\n";
    if (!isFilledOut('attachment'))
      alert_text += "Please enter an attachment.\n";

    if (alert_text != '') {
      alert(alert_text);
      return false;
    }

    return true;
  }
[% END %]

[% PROCESS global/header.html.tmpl
   title = "Finance"
   generate_api_token = 1
   style = inline_style
   style_urls = [ 'skins/standard/enter_bug.css' ]
   javascript = inline_js
   javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
                       'js/attachment.js', 'js/field.js', 'js/util.js' ]
   onload = "showCompDesc(document.getElementById('component'));"
%]

<h2>Finance</h2>

<p>All fields are mandatory</p>

<form method="post" action="post_bug.cgi" id="bug_form" class="enter_bug_form"
      enctype="multipart/form-data" onsubmit="return onSubmit();">
<input type="hidden" name="format" value="finance">
<input type="hidden" name="product" value="Finance">
<input type="hidden" name="rep_platform" value="All">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="priority" value="--">
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" id="bug_severity" value="normal">
<input type="hidden" name="comment" id="comment" value="">
<input type="hidden" name="groups" id="groups" value="finance">
<input type="hidden" name="token" value="[% token FILTER html %]">

<table>

<tr>
  <th>
    <label for="component">Request Type:</label>
  </th>
  <td>
    <select name="component" id="component" onchange="showCompDesc(this);">
      [%- FOREACH c = product.components %]
        [% NEXT IF NOT c.is_active %]
        <option value="[% c.name FILTER html %]"
                id="v[% c.id FILTER html %]_component"
          [% IF c.name == default.component_ %]
                selected="selected"
          [% END %]>
          [% c.name FILTER html -%]
        </option>
      [%- END %]
    </select
  </td>
</tr>

<tr>
  <td></td>
  <td id="comp_description" align="left" style="color: green; padding-left: 1em"></td>
</tr>

<tr>
  <th>
    <label for="short_desc">Description:</label>
  </th>
  <td>
    <i>Short description of what is being asked to sign</i><br>
    <input name="short_desc" id="short_desc" size="60"
           value="[% short_desc FILTER html %]">
  </td>
</tr>

<tr>
  <th>
    <label for="team_priority">Priority to your Team:</label>
  </th>
  <td>
    <select id="team_priority" name="team_priority">
      <option value="Low">Low</option>
      <option value="Medium">Medium</option>
      <option value="High">High</option>
    </select>
  </td>
</tr>

<tr>
  <th>
    <label for="signature_time">Timeframe for Signature:</label>
  </th>
  <td>
    <select id="signature_time" name="signature_time">
      <option value="24 hours">Within 24 hours</option>
      <option value="2 days">2 days</option>
      <option value="A week">A week</option>
      <option value="2 - 4 weeks" selected>2 -4 weeks</option>
    </select>
  </td>
</tr>

<tr>
  <th>
    <label for="other_party">Name of Other Party:</label>
  </th>
  <td>
    <i>Include full legal entity name and any other relevant contact information</i><br>
    <textarea id="other_party" name="other_party"
              rows="5" cols="40"></textarea>
  </td>
<tr>

<tr>
  <th>
    <label for="business_obj">Business Objective:</label>
  </th>
  <td>
    <i>
      Which Initiative or Overall goal this purchase is for. i.e. B2G, Data Center, Network, etc.</i><br>
    <textarea id="business_obj" name="business_obj" rows="5" cols="40"></textarea>
  </td>
<tr>

<tr>
  <th>
    <label for="what_purchase">If this is a purchase order,<br>what are we purchasing?</label>
  </th>
  <td>
    <i>
      Describe your request, what items are we purchasing, including number of 
      units if available.<br>Also provide context and background. Enter No if not
      a purchase order.</i><br>
    <textarea name="what_purchase" id="what_purchase" rows="5" cols="40"></textarea>
  </td>
</tr>

<tr>
  <th>
    <label for="why_purchase">Why is this purchase needed?</label>
  </th>
  <td>
    <i>
      Why do we need this? What is the work around if this is not approved?</i><br>
    <textarea name="why_purchase" id="why_purchase" rows="5" cols="40"></textarea>
  </td>
</tr>

<tr>
  <th>
    <label for="risk_purchase">What is the risk if<br>this is not purchased?</label>
  </th>
  <td>
    <i>
      What will happen if this is not purchased?</i><br>
    <textarea name="risk_purchase" id="risk_purchase" rows="5" cols="40"></textarea>
  </td>
</tr>

<tr>
  <th>
    <label for="alternative_purchase">What is the alternative?</label>
  </th>
  <td>
    <i>
      How did the team come to this recommendation? Did we get other bids, if so, how many?</i><br>
    <textarea name="alternative_purchase" id="alternative_purchase" rows="5" cols="40"></textarea>
  </td>
</tr>

<tr>
  <th>
    <label for="total_cost">Total Cost</label>
  </th>
  <td>
    <input type="text" name="total_cost" id="total_cost" value="" size="60">
  </td>
</tr>

<tr>
  <th>
    <label for="attachment">Attachment:</label>
  </th>
  <td>
    <i>Upload document that needs to be signed. If this is a Purchase Request form,<br> 
      also upload any supporting document such as draft SOW, quote, order form, etc.</i>
    <div>
      <input type="file" id="attachment" name="data" size="50">
      <input type="hidden" name="contenttypemethod" value="autodetect">
      <input type="hidden" name="description" value="Finance Document">
    </div>
  </td>
</tr>

<tr>
  <td>&nbsp;</td>
  <td>
    <input type="submit" id="commit" value="Submit Request">
  </td>
</tr>
</table>

</form>

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