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[% title = "作業時間概要 " %]
10[% IF do_depends %]
11    [% title = "の" _ title %]
12    [% header = "$terms.Bug $ids.0" FILTER bug_link(ids.0) FILTER none %]
13    [% header = title _ header _ " (および $terms.bugs を妨害するもの)" %]
14    [% title = title _ "$terms.Bug $ids.0" %]
15[% ELSE %]
16    [% title = title _ "($ids.size $terms.bugs が選択中)" %]
17    [% header = title %]
18[% END %]
19
20[% PROCESS global/header.html.tmpl
21    title = title
22    header = header
23    style_urls = ['skins/standard/buglist.css']
24    doc_section = "using/editing.html#time-tracking"
25    yui = ['calendar']
26    javascript_urls = [ "js/util.js", "js/field.js" ]
27    %]
28
29[% INCLUDE query_form %]
30
31[% IF do_report %]
32
33  [% global.grand_total = 0 global.estimated = 0 global.remaining = 0 %]
34
35  [% FOREACH workdata = part_list %]
36    [%# parts contains date ranges (from, to). %]
37    [% part = parts.shift %]
38      <h4>
39        [% IF part.0 or part.1 %]
40          [% part.0 OR "最初" FILTER html %] から [% part.1 OR "現在まで" FILTER html %]
41        [% ELSE %]
42          完全な概要 (期間指定なし)
43        [% END %]
44      </h4>
45    [% IF group_by == "number" %]
46      [% INCLUDE number_report %]
47    [% ELSE %]
48      [% INCLUDE owner_report %]
49    [% END %]
50  [% END %]
51
52  [% IF detailed %]
53    <h4>
54      Total of [% global.remaining FILTER format("%.2f") %]h remains from
55      original estimate of [% global.estimated FILTER format("%.2f") %]h
56      [% IF global.deadline %]
57        (deadline [% global.deadline FILTER html %])
58      [% END %]
59    </h4>
60  [% END %]
61
62  [% IF monthly %]
63    <h4>全 [% global.grand_total FILTER format("%.2f") %] 時間作業済</h4>
64    <hr>
65  [% END %]
66
67  [% IF null.size > 0 %]
68    [% INCLUDE inactive_report %]
69    <h4>[% null.size %] 個の活動のない [% terms.bugs %]</h4>
70  [% END %]
71
72[% END %]
73
74[% PROCESS global/footer.html.tmpl %]
75
76[%#
77  #
78  # Developer reporting
79  #
80  #%]
81
82[% BLOCK owner_report %]
83    [% global.total = 0 global.bug_count = {} global.owner_count = {} %]
84    <table class="realitems owner">
85        [% FOREACH owner = workdata.keys.sort %]
86            [% INCLUDE do_one_owner owner=owner ownerdata=workdata.$owner
87                                    detailed=detailed %]
88        [% END %]
89
90    [% additional = "$global.owner_count.size 人の開発者 @
91                     $global.bug_count.size $terms.bugs" %]
92    [% INCLUDE section_total colspan=3 additional=additional %]
93    </table>
94[% END %]
95
96[% BLOCK do_one_owner %]
97    [% global.owner_count.$owner = 1 %]
98    <tr><td colspan="5" class="owner_header">
99        <b>[% owner FILTER html %]</b>
100    </td></tr>
101    [% col = 0 subtotal = 0%]
102    [% FOREACH bugdata=ownerdata.nsort("bug_id") %]
103        [% bug_id = bugdata.bug_id %]
104        [% INCLUDE calc_bug_total id=bug_id %]
105        [% global.bug_count.$bug_id = 1 %]
106        [% IF detailed %]
107            [% INCLUDE bug_header cid=col id=bug_id bugdata=bugdata extra=1 %]
108            [% col = col + 1 %]
109        [% END %]
110        [% subtotal = subtotal + bugdata.total_time %]
111    [% END %]
112    <tr>
113      <th colspan="4" class="right">合計:</th>
114      <td class="subtotal">[% subtotal FILTER format("%.2f") %]</td>
115    </tr>
116    [% global.total = global.total + subtotal %]
117[% END %]
118
119[%#
120  #
121  # Bug Number reporting
122  #
123  #%]
124
125[% BLOCK number_report %]
126    [% global.total = 0 global.owner_count = {} global.bug_count = {} %]
127
128    <table class="realitems number">
129    [% FOREACH bug = workdata.keys.nsort %]
130        [% INCLUDE do_one_bug id=bug bugdata=workdata.$bug
131                              detailed=detailed %]
132    [% END %]
133
134    [% additional = "$global.bug_count.size $terms.bugs135                     $global.owner_count.size 人の開発者" %]
136    [% INCLUDE section_total additional=additional colspan=2 %]
137    </table>
138[% END %]
139
140[% BLOCK do_one_bug %]
141    [% subtotal = 0.00 cid = 0 %]
142    [% INCLUDE calc_bug_total id=id %]
143    [% global.bug_count.$id = 1 %]
144    [% INCLUDE bug_header id=id %]
145
146    [% FOREACH owner = bugdata.sort("login_name") %]
147        [% work_time = owner.total_time %]
148        [% subtotal = subtotal + work_time %]
149        [% login_name = owner.login_name %]
150        [% global.owner_count.$login_name = 1 %]
151        [% IF detailed %]
152            [% cid = cid + 1 %]
153            <tr class="owner_header[% 2 FILTER none IF cid % 2 %]">
154                <td>&nbsp;</td>
155                <td colspan="2"><b>[% login_name FILTER html %]</b></td>
156                <td class="right">
157                [% work_time FILTER format("%.2f") %]</td>
158            </tr>
159        [% END %]
160    [% END %]
161    <tr>
162      <th colspan="3" class="right">合計:</th>
163      <td class="subtotal">[% subtotal FILTER format("%.2f") %]</td>
164    </tr>
165    [% global.total = global.total + subtotal %]
166[% END %]
167
168[% BLOCK bug_header %]
169    <tr class="bug_header[% '2' IF cid % 2 %]">
170        <th class="bug_id">[% "$terms.Bug $id" FILTER bug_link(id) FILTER none %]</th>
171        <th class="bug_status">
172          [% display_value("bug_status", bugs.$id.bug_status) FILTER html %]
173        </th>
174        <td colspan="2">[% bugs.$id.short_desc FILTER html %]</td>
175        [% IF extra %]
176          <td class="right">[% bugdata.total_time FILTER html %]</td>
177        [% END %]
178    </tr>
179    [% IF detailed %]
180      <tr class="bug_header[% '2' IF cid % 2 %]">
181        <td>&nbsp;</td>
182        <td colspan="3">
183          <table width="100%" cellpadding="0" cellspacing="0">
184          <span class="time_info">
185                Estimated: [% bugs.$id.estimated_time FILTER format("%.2f") %]h
186          </span>
187          <span class="time_info">
188                Remaining: [% bugs.$id.remaining_time FILTER format("%.2f") %]h
189          </span>
190          <span class="time_info">
191                Deadline: [% bugs.$id.deadline || "<b>Not set</b>" %]
192          </span>
193        </td>
194        [% IF extra %]
195          <td>&nbsp;</td>
196        [% END %]
197      </tr>
198   [% END %]
199[% END %]
200
201[% BLOCK calc_bug_total %]
202  [% IF !global.bug_count.$id %]
203    [% global.estimated = global.estimated + bugs.$id.estimated_time %]
204    [% global.remaining = global.remaining + bugs.$id.remaining_time %]
205    [% IF !global.deadline || bugs.$id.deadline &&
206          global.deadline.replace("-", "") < bugs.$id.deadline.replace("-", "") %]
207      [% SET global.deadline = bugs.$id.deadline %]
208    [% END %]
209  [% END %]
210[% END %]
211
212[% BLOCK inactive_report %]
213    <h3>活動のない [% terms.bugs %]</h3>
214    <table class="zeroitems">
215    [% cid = 0 %]
216    [% FOREACH bug_id = null.nsort %]
217        [% INCLUDE bug_header id=bug_id cid=cid %]
218        [% cid = cid + 1 %]
219    [% END %]
220    </table>
221[% END %]
222
223
224[% BLOCK section_total %]
225  [% IF global.total > 0 %]
226    <tr class="section_total">
227      <td><b>合計</b></td>
228      <th colspan="[% colspan FILTER html %]" class="right">[% additional FILTER html %]</th>
229      <th class="right">[% global.total FILTER format("%.2f") %]</th>
230    </tr>
231  [% ELSE %]
232    <tr>
233      <td>指定された期間に割り当てられた時間はありません。</td>
234    </tr>
235  [% END %]
236  [% global.grand_total = global.grand_total + global.total %]
237[% END %]
238
239[%#
240  #
241  # The query form
242  #
243  #%]
244
245[% BLOCK query_form %]
246<hr>
247<form method="post" name="summary" action="summarize_time.cgi">
248<input type="hidden" name="do_depends" value="[% do_depends FILTER html %]">
249<input type="hidden" name="id" value="[% ids.join(",") FILTER html %]">
250<input type="hidden" name="do_report" value="1">
251
252[% IF warn_swap_dates %]
253  <p class="warning_swapped_data">
254    指定された終了日が開始より前です。これは意味を成さないため、
255    指定された日付を逆転させています。</p>
256[% END %]
257
258<table>
259  <tr>
260    <th>
261      <label accesskey="s" for="start_date">期間の開始 (<u>s</u>)</label>:
262    </th>
263    <td>
264      <input id="start_date" name="start_date" size="10" autofocus
265             value="[% start_date FILTER html %]" maxlength="10"
266             onchange="updateCalendarFromField(this)">
267      <button type="button" class="calendar_button" id="button_calendar_start_date"
268              onclick="showCalendar('start_date')"><span>カレンダー</span>
269      </button>
270      <div id="con_calendar_start_date"></div>
271      <span class="label">
272        と <label accesskey="e" for="end_date">終了 (<u>e</u>)</label>:
273      </span>
274      <input type="text" name="end_date" size="10" id="end_date"
275             value ="[% end_date FILTER html %]" maxlength="10"
276             onchange="updateCalendarFromField(this)">
277      <button type="button" class="calendar_button" id="button_calendar_end_date"
278              onclick="showCalendar('end_date')"><span>カレンダー</span>
279      </button>
280      <div id="con_calendar_end_date"></div>
281      <br>
282      <span class="bz_info">(日付は任意です。YYYY-MM-DD の形式を利用できます。)</span>
283    </td>
284    <th><input type="submit" id="summarize" value="概要表示"></th>
285  </tr>
286
287  <tr>
288    <th>グループ化:</th>
289    <td>
290      <input type="radio" name="group_by" id="number" value="number"
291             [% 'checked="checked"' IF group_by == "number" %]>
292      <label for="number" accesskey="n">[% terms.Bug %] 番号 (<u>N</u>)</label>
293      <input type="radio" name="group_by" id="owner" value="owner"
294             [% 'checked="checked"' IF group_by == "owner" %]>
295      <label for="owner" accesskey="d">開発者 (<u>D</u>)</label>
296    </td>
297    <th>
298      <label for="ctype">形式</label>:
299      <select name="ctype" id="ctype">
300        <option value="html">HTML 形式</option>
301      </select>
302    </th>
303  </tr>
304
305  <tr>
306    <th>&nbsp;</th>
307    <td colspan="2">
308      <input type="checkbox" name="monthly" id="monthly"
309             [% 'checked="checked"' IF monthly %]>
310      <label for="monthly" accesskey="m">月ごとに分割 (<u>m</u>)</label>
311      [%# XXX: allow splitting by other intervals %]
312      <input type="checkbox" name="detailed" id="detailed"
313             [% 'checked="checked"' IF detailed %]>
314      <label for="detailed" accesskey="t">詳細な概要 (<u>t</u>)</label>
315      <input type="checkbox" name="inactive" id="inactive"
316             [% 'checked="checked"' IF inactive %]>
317      <label for="inactive" accesskey="i">全ての活動のない
318        [%+ terms.bugs %] を表示する (<u>i</u>)</label>
319    </td>
320  </tr>
321</table>
322
323</form>
324<script type="text/javascript">
325  <!--
326    [%+ PROCESS "global/calendar.js.tmpl" id = 'start_date' %]
327    [% PROCESS "global/calendar.js.tmpl" id = 'end_date' %]
328  //-->
329</script>
330<hr>
331[% END %]
332