summaryrefslogtreecommitdiffstats
path: root/template/en/default/admin/flag-type/edit.html.tmpl
blob: 253a310ac9528940420b21817d08906f235e5cb7 (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
[%# 1.0@bugzilla.org %]
[%# 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 Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Myk Melez <myk@mozilla.org>
  #%]

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

[%# The javascript and header_html blocks get used in header.html.tmpl. %]
[% javascript = BLOCK %]
  var usetms = 0; // do we have target milestone?
  var first_load = 1; // is this the first time we load the page?
  var last_sel = []; // caches last selection
  var cpts = new Array();
  [% FOREACH p = products %]
    cpts['[% p FILTER js %]'] = [
      [%- FOREACH item = components_by_product.$p %]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
  [% END %]
[% END %]

[% header_html = BLOCK %]
  <script language="JavaScript" type="text/javascript" src="productmenu.js"></script>
[% END %]

[% IF type.target_type == "bug" %]
  [% title = BLOCK %]Create Flag Type for [% terms.Bugs %][% END %]
  [% typeLabelLowerPlural = BLOCK %][% terms.bugs %][% END %]
  [% typeLabelLowerSingular = BLOCK %][% terms.bug %][% END %]
[% ELSE %]
  [% title = "Create Flag Type for Attachments" %]
  [% typeLabelLowerPlural = BLOCK %]attachments[% END %]
  [% typeLabelLowerSingular = BLOCK %]attachment[% END %]
[% END %]

[% IF last_action == "copy" %]
  [% title = "Create Flag Type Based on $type.name" %]
[% ELSIF last_action == "edit" %]
  [% title = "Edit Flag Type $type.name" %]
[% END %]

[% PROCESS global/header.html.tmpl
  title = title
  style = "
    table#form th { text-align: right; vertical-align: baseline; white-space: nowrap; }
    table#form td { text-align: left; vertical-align: baseline; }
  "
  onload="selectProduct(forms[0], 'product', 'component', '__Any__');"
%]

<form method="post" action="editflagtypes.cgi">
  <input type="hidden" name="action" value="[% action %]">
  <input type="hidden" name="id" value="[% type.id %]">
  <input type="hidden" name="target_type" value="[% type.target_type %]">
  [% FOREACH category = type.inclusions %]
    <input type="hidden" name="inclusions" value="[% category FILTER html %]">
  [% END %]
  [% FOREACH category = type.exclusions %]
    <input type="hidden" name="exclusions" value="[% category FILTER html %]">
  [% END %]

  <table id="form" cellspacing="0" cellpadding="4" border="0">
    <tr>
      <th>Name:</th>
      <td>
        a short name identifying this type<br>
        <input type="text" name="name" value="[% type.name FILTER html %]"
               size="50" maxlength="50">
      </td>
    </tr>

    <tr>
      <th>Description:</th>
      <td>
        a comprehensive description of this type<br>
        <textarea name="description" rows="4" cols="80">[% type.description FILTER html %]</textarea>
      </td>
    </tr>

    <tr>
      <th>Category:</th>

      <td>
        the products/components to which [% typeLabelLowerPlural %] must
        (inclusions) or must not (exclusions) belong in order for users
        to be able to set flags of this type for them
        <table>
          <tr>
            <td style="vertical-align: top;">
              <b>Product/Component:</b><br>
              <select name="product" onchange="selectProduct(this.form, 'product', 'component', '__Any__');">
                <option value="">__Any__</option>
                [% FOREACH item = products %]
                  <option value="[% item FILTER html %]" 
                          [% "selected" IF type.product.name == item %]>
                          [% item FILTER html %]</option>
                [% END %]
              </select><br>
              <select name="component">
                <option value="">__Any__</option>
                [% FOREACH item = components %]
                  <option value="[% item FILTER html %]" 
                          [% "selected" IF type.component.name == item %]>
                          [% item FILTER html %]</option>
                [% END %]
              </select><br>
              <input type="submit" name="categoryAction-include" value="Include">
              <input type="submit" name="categoryAction-exclude" value="Exclude">
            </td>
            <td style="vertical-align: top;">
              <b>Inclusions:</b><br>
              [% PROCESS "global/select-menu.html.tmpl" name="inclusion_to_remove" multiple="1" size="4" options=type.inclusions %]<br>
              <input type="submit" name="categoryAction-removeInclusion" value="Remove Inclusion">
            </td>
            <td style="vertical-align: top;">
              <b>Exclusions:</b><br>
              [% PROCESS "global/select-menu.html.tmpl" name="exclusion_to_remove" multiple="1" size="4" options=type.exclusions %]<br>
              <input type="submit" name="categoryAction-removeExclusion" value="Remove Exclusion">
            </td>
          </tr>
        </table>
      </td>
    </tr>

    <tr>
      <th>Sort Key:</th>
      <td>
        a number between 1 and 32767 by which this type will be sorted
        when displayed to users in a list; ignore if you don't care
        what order the types appear in or if you want them to appear
        in alphabetical order<br>
        <input type="text" name="sortkey" value="[% type.sortkey || 1 %]" size="5" maxlength="5">
      </td>
    </tr>

    <tr>
      <th>&nbsp;</th>
      <td>
        <input type="checkbox" name="is_active" [% "checked" IF type.is_active || !type.is_active.defined %]>
        active (flags of this type appear in the UI and can be set)
      </td>
    </tr>

    <tr>
      <th>&nbsp;</th>
      <td>
        <input type="checkbox" name="is_requestable" [% "checked" IF type.is_requestable || !type.is_requestable.defined %]>
        requestable (users can ask for flags of this type to be set)
      </td>
    </tr>

    <tr>
      <th>CC List:</th>
      <td>
        if requestable, who should get carbon copied on email notification of requests<br>
        <input type="text" name="cc_list" value="[% type.cc_list FILTER html %]" size="80" maxlength="200">
      </td>
    </tr>

    <tr>
      <th>&nbsp;</th>
      <td>
        <input type="checkbox" name="is_requesteeble" [% "checked" IF type.is_requesteeble || !type.is_requesteeble.defined %]>
        specifically requestable (users can ask specific other users to set flags of this type as opposed to just asking the wind)
      </td>
    </tr>

    <tr>
      <th>&nbsp;</th>
      <td>
        <input type="checkbox" name="is_multiplicable" [% "checked" IF type.is_multiplicable || !type.is_multiplicable.defined %]>
        multiplicable (multiple flags of this type can be set on the same [% typeLabelLowerSingular %])
      </td>
    </tr>

    <tr>
      <th>Grant Group:</th>
      <td>
        the group allowed to grant/deny flags of this type
        (to allow all users to grant/deny these flags, leave this empty)<br>
        <input type="text" name="grant_gid" value="[% type.grant_gid FILTER html %]" size="50" maxlength="255">
      </td>
    </tr>

    <tr>
      <th>Request Group:</th>
      <td>
        if flags of this type are requestable, the group allowed to request them
        (to allow all users to request these flags, leave this empty)<br>
        Note that the request group alone has no effect if the grant group is not defined!<br>
        <input type="text" name="request_gid" value="[% type.request_gid FILTER html %]" size="50" maxlength="255">
      </td>
    </tr>

    <tr>
      <th></th>
      <td>
        <input type="submit" value="        
          [% IF (last_action == "enter" || last_action == "copy") %]Create 
          [% ELSE %]Save Changes 
          [% END %]">
      </td>
    </tr>

  </table>

</form>

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