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/.
4  #
5  # This Source Code Form is "Incompatible With Secondary Licenses", as
6  # defined by the Mozilla Public License, v. 2.0.
7  #%]
8
9[%# INTERFACE:
10  # operations: array of hashes. May be empty. Each has has three members:
11  #   who: string. who performed the operation
12  #   when: string. when they performed it
13  #   changes: hash. Details of what they changed. This hash has three
14  #            compulsory and one optional member:
15  #     field: string. The name of the field
16  #     removed: string. What was removed from the field
17  #     added: string. What was added to the field
18  #     attach_id: integer. If the change was adding an attachment, its id.
19  # incomplete_data: boolean. True if some of the data is incomplete (because
20  #                  it was affected by an old Bugzilla bug.)
21  #%]
22
23[% PROCESS bug/time.html.tmpl %]
24
25[% IF incomplete_data %]
26  <p>
27    There used to be an issue in <a href="http://www.bugzilla.org/">Bugzilla</a>
28    which caused activity data to be lost if there were a large number of cc's
29    or dependencies.  That has been fixed, but some data was already lost in
30    your activity table that could not be regenerated.  The changes that the
31    script could not reliably determine are prefixed by '?'.
32  </p>
33[% END %]
34
35[% IF operations.size > 0 %]
36  <table id="bug_activity">
37    <tr class="column_header">
38      <th>Who</th>
39      <th>When</th>
40      <th>What</th>
41      <th>Removed</th>
42      <th>Added</th>
43    </tr>
44
45    [% FOREACH operation = operations %]
46      <tr>
47        <td rowspan="[% operation.changes.size %]">
48          [% operation.who FILTER email FILTER html %]
49        </td>
50        <td rowspan="[% operation.changes.size %]">
51          [% operation.when FILTER time %]
52        </td>
53        [% FOREACH change = operation.changes %]
54          [% "</tr><tr>" IF loop.index > 0 %]
55            <td>
56              [% IF change.attachid %]
57                <a href="attachment.cgi?id=[% change.attachid %]">
58                Attachment #[% change.attachid %]</a>
59              [% END %]
60              [% IF change.comment.defined %]
61                 [% comment_desc = field_descs.${change.fieldname} %]
62                 [% comment_num = "Comment $change.comment.count" FILTER bug_link(bug.bug_id, comment_num => change.comment.count) %]
63                 [% comment_desc.replace('^(Comment )?', "$comment_num ") FILTER none %]
64              [% ELSE %]
65                [%+ field_descs.${change.fieldname} FILTER html %]
66              [% END %]
67            </td>
68            [% PROCESS change_column change_type = change.removed %]
69            [% PROCESS change_column change_type = change.added %]
70        [% END %]
71      </tr>
72    [% END %]
73  </table>
74[% ELSE %]
75  <p>
76    No changes have been made to this [% terms.bug %] yet.
77  </p>
78[% END %]
79
80[% BLOCK change_column %]
81  <td>
82    [% IF change_type.defined %]
83      [% IF change.fieldname == 'estimated_time' ||
84            change.fieldname == 'remaining_time' ||
85            change.fieldname == 'work_time' %]
86        [% PROCESS formattimeunit time_unit=change_type %]
87      [% ELSIF change.fieldname == 'blocked' ||
88               change.fieldname == 'dependson' %]
89        [% change_type FILTER bug_list_link FILTER none %]
90      [% ELSIF change.fieldname == 'assigned_to' ||
91               change.fieldname == 'reporter' ||
92               change.fieldname == 'qa_contact' ||
93               change.fieldname == 'cc' ||
94               change.fieldname == 'flagtypes.name' %]
95        [% display_value(change.fieldname, change_type) FILTER email FILTER html %]
96      [% ELSE %]
97        [% display_value(change.fieldname, change_type) FILTER html FILTER html_line_break %]
98      [% END %]
99    [% ELSE %]
100      &nbsp;
101    [% END %]
102  </td>
103[% END %]
104