~ubuntu-branches/ubuntu/edgy/bugzilla/edgy

« back to all changes in this revision

Viewing changes to template/en/default/reports/create-chart.html.tmpl

  • Committer: Bazaar Package Importer
  • Author(s): Alexis Sukrieh
  • Date: 2005-10-03 16:51:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051003165101-38n0y5qofd68vole
Tags: 2.18.4-1
* New upstream minor release
  + Fixed a security issue: It was possible to bypass the "user
    visibility groups" restrictions if user-matching was turned on
    in "substring" mode.
  + Fixed a security issue: config.cgi exposed information to users who
    weren't logged in, even when "requirelogin" was turned on in Bugzilla.
  (closes: #331206)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
[%# 1.0@bugzilla.org %]
 
2
[%# The contents of this file are subject to the Mozilla Public
 
3
  # License Version 1.1 (the "License"); you may not use this file
 
4
  # except in compliance with the License. You may obtain a copy of
 
5
  # the License at http://www.mozilla.org/MPL/
 
6
  #
 
7
  # Software distributed under the License is distributed on an "AS
 
8
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
  # implied. See the License for the specific language governing
 
10
  # rights and limitations under the License.
 
11
  #
 
12
  # The Original Code is the Bugzilla Bug Tracking System.
 
13
  #
 
14
  # The Initial Developer of the Original Code is Netscape Communications
 
15
  # Corporation. Portions created by Netscape are
 
16
  # Copyright (C) 1998 Netscape Communications Corporation. All
 
17
  # Rights Reserved.
 
18
  #
 
19
  # Contributor(s): Gervase Markham <gerv@gerv.net>
 
20
  #%]
 
21
 
 
22
[%# INTERFACE:
 
23
  # chart: Chart object representing the currently assembled chart.
 
24
  # category: hash (keyed by category) of hashes (keyed by subcategory) of
 
25
  #           hashes (keyed by name), with value being the series_id of the
 
26
  #           series. Contains details of all series the user can see.
 
27
  #%]
 
28
 
 
29
[% PROCESS global/header.html.tmpl 
 
30
  title = "Create Chart"
 
31
%]
 
32
 
 
33
[% PROCESS "reports/series-common.html.tmpl" 
 
34
  donames = 1 
 
35
%]
 
36
 
 
37
<script language="JavaScript" type="text/javascript">
 
38
[%# This function takes necessary action on selection of a subcategory %]
 
39
function subcatSelected() {
 
40
  var cat = document.chartform.category.value;
 
41
  var subcat = document.chartform.subcategory.value;
 
42
  var names = series[cat][subcat];
 
43
  
 
44
  var namewidget = document.chartform.name;
 
45
 
 
46
  namewidget.options.length = 0;
 
47
  var i = 0;
 
48
 
 
49
  for (x in names) {
 
50
    namewidget.options[i] = new Option(x, names[x]);
 
51
    i++;
 
52
  }
 
53
 
 
54
  namewidget.options[0].selected = true;
 
55
  
 
56
  checkNewState();
 
57
}
 
58
</script>
 
59
  
 
60
[% gttext = "Grand Total" %]
 
61
 
 
62
<form method="get" action="chart.cgi" name="chartform">  
 
63
  
 
64
  <table cellpadding="2" cellspacing="2" border="0">
 
65
    [% IF NOT category OR category.size == 0 %]
 
66
      <tr>
 
67
        <td>
 
68
          <i>No data sets exist, or none are visible to you.</i>
 
69
        </td>
 
70
      </tr>
 
71
    [% ELSE %]
 
72
      <tr>
 
73
        <th>Category:</th>
 
74
        <th></th>
 
75
        <th>Sub-category:</th>
 
76
        <th></th>
 
77
        <th>Name:</th>
 
78
        <th><br>
 
79
        </th>
 
80
      </tr>
 
81
      <tr>
 
82
      
 
83
        [% PROCESS series_select sel = { name => 'category', 
 
84
                                         size => 5,
 
85
                                         onchange = "catSelected();
 
86
                                                     subcatSelected();" } %]
 
87
                                   
 
88
        <td>
 
89
          <noscript>
 
90
            <input type="submit" name="action-assemble" value="Update --&gt;">
 
91
          </noscript>
 
92
        </td>
 
93
        
 
94
        [% PROCESS series_select sel = { name => 'subcategory', 
 
95
                                         size => 5,
 
96
                                         onchange = "subcatSelected()" } %]
 
97
                                   
 
98
        <td>
 
99
          <noscript>
 
100
            <input type="submit" name="action-assemble" value="Update --&gt;">
 
101
          </noscript>
 
102
        </td>
 
103
        
 
104
        <td align="left">
 
105
          <label for="name" accesskey="N">
 
106
            <select name="name" id="name" style="width: 15em"
 
107
                    size="5" multiple="multiple"
 
108
                    [%+ "disabled=\"disabled\"" UNLESS name.keys.size %]>
 
109
              [% FOREACH x = name.keys.sort %]
 
110
                <option value="[% name.$x FILTER html %]">
 
111
                  [% x FILTER html %]</option>
 
112
              [% END %]
 
113
              [% UNLESS name.keys.size %]
 
114
                <option value="" disabled="disabled"></option>
 
115
              [% END %]
 
116
            </select>
 
117
          </label>
 
118
        </td>
 
119
 
 
120
        <td align="center" valign="middle"> 
 
121
          <input type="submit" name="action-add" value="Add To List"><br>
 
122
        </td>
 
123
      </tr>
 
124
    [% END %]
 
125
  </table>
 
126
 
 
127
  <script language="JavaScript" type="text/javascript">
 
128
    document.chartform.category[0].selected = true;
 
129
    document.chartform.subcategory.disabled = '';
 
130
    document.chartform.name.disabled = '';
 
131
    catSelected();
 
132
    subcatSelected();
 
133
  </script>
 
134
 
 
135
  <h3>List Of Data Sets To Plot</h3>
 
136
 
 
137
  [% IF chart.lines.size > 0 %]
 
138
    <table cellspacing="2" cellpadding="2">
 
139
      <tr>
 
140
        <th style="width: 5em;">Select</th>
 
141
        <th>Label</th>
 
142
        <th></th>
 
143
        <th>Data Set</th>
 
144
        <th></th>
 
145
      </tr>
 
146
      
 
147
      [%# The external loop has two counters; one which keeps track of where we
 
148
        #  are in the old labels array, and one which keeps track of the new
 
149
        #  indexes for the form elements. They are different if chart.lines has
 
150
        #  empty slots in it. 
 
151
        #%]
 
152
      [% labelidx = 0 %]
 
153
      [% newidx = 0 %]
 
154
      
 
155
      [% FOREACH line = chart.lines %]
 
156
        [% IF NOT line %]
 
157
          [%# chart.lines has an empty slot, so chart.labels will too. We
 
158
            # increment labelidx only to keep the labels in sync with the data.
 
159
            #%]
 
160
          [% labelidx = labelidx + 1 %]
 
161
          [% NEXT %]
 
162
        [% END %]
 
163
        
 
164
        [% FOREACH series = line %]
 
165
          <tr>
 
166
            [% IF loop.first %]
 
167
              <td align="center" rowspan="[% line.size %]">
 
168
                <input type="checkbox" value="1" name="select[% newidx %]">
 
169
              </td>
 
170
              <td rowspan="[% line.size %]">
 
171
                <input type="text" size="20" name="label[% newidx %]"
 
172
                       value="[% (chart.labels.$labelidx OR series.name) 
 
173
                                                               FILTER html %]">
 
174
              </td>
 
175
            [% END %]
 
176
 
 
177
            <td>
 
178
              [% "{" IF line.size > 1 %]
 
179
            </td>
 
180
 
 
181
            <td>
 
182
              [% series.category FILTER html %] / 
 
183
              [%+ series.subcategory FILTER html %] /
 
184
              [%+ series.name FILTER html %]
 
185
              <input type="hidden" name="line[% newidx %]" 
 
186
                     value="[% series.series_id %]">
 
187
            </td>
 
188
 
 
189
            <td align="center">
 
190
              [% IF user.id == series.creator OR UserInGroup("admin") %]
 
191
               <a href="chart.cgi?action=edit&series_id=
 
192
                       [% series.series_id %]">Edit</a> |
 
193
              [% END %]
 
194
              <a href="buglist.cgi?cmdtype=dorem&amp;namedcmd=
 
195
                [% series.category FILTER url_quote %]%20/%20
 
196
                [% series.subcategory FILTER url_quote %]%20/%20
 
197
                [% series.name FILTER url_quote -%]&amp;series_id=
 
198
                [% series.series_id %]&amp;remaction=runseries">Run Search</a>
 
199
            </td>        
 
200
          </tr>
 
201
        [% END %]
 
202
        [% labelidx = labelidx + 1 %]
 
203
        [% newidx = newidx + 1 %]
 
204
      [% END %]
 
205
 
 
206
      [% IF chart.gt %]
 
207
        <tr>
 
208
          <td align="center">
 
209
            <input type="checkbox" value="1" name="select65536">
 
210
            <input type="hidden" value="1" name="gt">
 
211
          </td>
 
212
          <td>
 
213
            <input type="text" size="20" name="labelgt"
 
214
                   value="[% (chart.labelgt OR gttext) FILTER html %]">
 
215
          </td>
 
216
          <td></td>
 
217
          <td>
 
218
            <i>[% gttext FILTER html %]</i>
 
219
          </td>
 
220
          <td></td>
 
221
        </tr>
 
222
      [% END %]
 
223
      <tr>
 
224
        <td colspan="6">&nbsp;</td>
 
225
      </tr>
 
226
 
 
227
      <tr>
 
228
        <td valign="bottom" style="text-align: center;">
 
229
          <input type="submit" name="action-sum" value="Sum" 
 
230
                 style="width: 5em;"><br>
 
231
          <input type="submit" name="action-remove" value="Remove"
 
232
                 style="width: 5em;">
 
233
        </td>
 
234
 
 
235
        <td style="text-align: right; vertical-align: bottom;">
 
236
          <b>Cumulate:</b> 
 
237
          <input type="checkbox" name="cumulate" value="1"
 
238
          [% " checked" IF chart.cumulate %]>
 
239
        </td>
 
240
 
 
241
        <td></td>
 
242
        <td valign="bottom"> 
 
243
          <b>Date Range:</b> 
 
244
          <input type="text" size="12" name="datefrom" 
 
245
            value="[% time2str("%Y-%m-%d", chart.datefrom) IF chart.datefrom%]">
 
246
          <b>to</b> 
 
247
          <input type="text" size="12" name="dateto" 
 
248
            value="[% time2str("%Y-%m-%d", chart.dateto) IF chart.dateto %]">
 
249
        </td>
 
250
 
 
251
        <td style="text-align: right" valign="bottom">
 
252
          <input type="submit" name="action-wrap" value="Chart This List">
 
253
        </td>
 
254
      </tr>
 
255
    </table>
 
256
  [% ELSE %]
 
257
  <p><i>None</i></p>
 
258
  [% END %]  
 
259
</form>
 
260
 
 
261
[% IF UserInGroup('editbugs') %]
 
262
  <h3><a href="query.cgi?format=create-series">Create New Data Set</a></h3>
 
263
[% END %]                 
 
264
 
 
265
[% PROCESS global/footer.html.tmpl %]
 
266