From af4793c884c6f3eb9dff8a79865f6cfa690aa9ec Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 19 Sep 2007 02:37:11 +0000 Subject: Bug 389313: summarize_time.cgi needs some cleanup - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/en/default/bug/summarize-time.html.tmpl | 161 ++++++++++------------- template/en/default/global/user-error.html.tmpl | 7 +- 2 files changed, 72 insertions(+), 96 deletions(-) (limited to 'template') diff --git a/template/en/default/bug/summarize-time.html.tmpl b/template/en/default/bug/summarize-time.html.tmpl index da1159763..a7f90d0a7 100644 --- a/template/en/default/bug/summarize-time.html.tmpl +++ b/template/en/default/bug/summarize-time.html.tmpl @@ -11,18 +11,19 @@ # The Original Code is the Bugzilla Bug Tracking System. # # Contributor(s): Christian Reis + # Frédéric Buclin #%] [% USE date %] -[% PROCESS global/variables.none.tmpl %] +[% PROCESS "global/field-descs.none.tmpl" %] [% title = "Time Summary " %] [% IF do_depends %] [% title = title _ "for " %] - [% header = title _ "$terms.Bug $ids.0" FILTER bug_link(ids.0) FILTER none %] - [% title = title _ "$terms.Bug $ids.0: " %] - [% header = (header _ " (and $terms.bugs blocking it)") IF do_depends %] + [% header = "$terms.Bug $ids.0" FILTER bug_link(ids.0) FILTER none %] + [% header = title _ header _ " (and $terms.bugs blocking it)" %] + [% title = title _ "$terms.Bug $ids.0" %] [% ELSE %] [% title = title _ "($ids.size $terms.bugs selected)" %] [% header = title %] @@ -34,48 +35,40 @@ style_urls = ["skins/standard/summarize-time.css"] %] -[% IF ids.size == 0 %] +[% INCLUDE query_form %] -

No [% terms.bugs %] specified or visible.

+[% IF do_report %] -[% ELSE %] - - [% INCLUDE query_form %] - - [% IF do_report %] - - [% global.grand_total = 0 %] - - [% FOREACH workdata = part_list %] - [% part = parts.shift %] -
-

- [% IF part.0 or part.1 %] - [% part.0 OR "Up" FILTER html %] to [% part.1 OR "now" FILTER html %] - [% ELSE %] - Full summary (no period specified) - [% END %] -

-
- [% IF group_by == "number" %] - [% INCLUDE number_report %] - [% ELSE %] - [% INCLUDE owner_report %] - [% END %] - [% END %] + [% global.grand_total = 0 %] - [% IF monthly %] -

Total of [% global.grand_total FILTER format("%.2f") %] hours worked

-
+ [% FOREACH workdata = part_list %] + [%# parts contains date ranges (from, to). %] + [% part = parts.shift %] +
+

+ [% IF part.0 or part.1 %] + [% part.0 OR "Up" FILTER html %] to [% part.1 OR "now" FILTER html %] + [% ELSE %] + Full summary (no period specified) [% END %] +

+
+ [% IF group_by == "number" %] + [% INCLUDE number_report %] + [% ELSE %] + [% INCLUDE owner_report %] + [% END %] + [% END %] - [% IF null.keys.size > 0 %] - [% INCLUDE inactive_report %] -

Total of [% null.keys.size %] - inactive [% terms.bugs %]

- [% END %] + [% IF monthly %] +

Total of [% global.grand_total FILTER format("%.2f") %] hours worked

+
+ [% END %] - [% END %] + [% IF null.size > 0 %] + [% INCLUDE inactive_report %] +

Total of [% null.size %] inactive [% terms.bugs %]

+ [% END %] [% END %] @@ -88,7 +81,7 @@ #%] [% BLOCK owner_report %] - [% global.total = 0 global.bug_count = {} global.owner_count = {}%] + [% global.total = 0 global.bug_count = {} global.owner_count = {} %] [% FOREACH owner = workdata.keys.sort %] [% INCLUDE do_one_owner owner=owner ownerdata=workdata.$owner @@ -111,19 +104,13 @@ [% bug_id = bugdata.bug_id %] [% global.bug_count.$bug_id = 1 %] [% IF detailed %] - [%# XXX oy what a hack %] - [% timerow = '' %] - [% INCLUDE bug_header cid=col id=bug_id bug_status=bugdata.bug_status - short_desc=bugdata.short_desc extra=timerow %] - [% col = col + 1 %] + [% INCLUDE bug_header cid=col id=bug_id bugdata=bugdata extra=1 %] + [% col = col + 1 %] [% END %] [% subtotal = subtotal + bugdata.total_time %] [% END %] - - + [% global.total = global.total + subtotal %] @@ -140,13 +127,12 @@ [% global.total = 0 global.owner_count = {} global.bug_count = {} %]
' _ bugdata.total_time _ '
  - Total: - Total: [% subtotal FILTER format("%.2f") %]
- [% keys = sort_bug_keys(workdata.keys) %] - [% FOREACH bug = keys %] - [% INCLUDE do_one_bug bug=bug bugdata=workdata.$bug + [% FOREACH bug = workdata.keys.nsort %] + [% INCLUDE do_one_bug id=bug bugdata=workdata.$bug detailed=detailed %] [% END %] - [% additional = "$global.bug_count.size $terms.bugs & + [% additional = "$global.bug_count.size $terms.bugs & $global.owner_count.size developers" %] [% INCLUDE section_total additional=additional colspan=2 %]
@@ -154,13 +140,8 @@ [% BLOCK do_one_bug %] [% subtotal = 0.00 cid = 0 %] - - [%# hack apart the ID and summary. Sad. %] - [% items = bug.split(";") %] - [% id = items.shift %] - [% status = items.shift %] [% global.bug_count.$id = 1 %] - [% INCLUDE bug_header id=id bug_status=status short_desc=items.join(";") %] + [% INCLUDE bug_header id=id %] [% FOREACH owner = bugdata.sort("login_name") %] [% work_time = owner.total_time %] @@ -184,17 +165,21 @@ [% subtotal FILTER format("%.2f") %] - - [% global.total = global.total + subtotal %] + + + [% global.total = global.total + subtotal %] [% END %] [% BLOCK bug_header %] - - [% INCLUDE buglink id=id %] - [% bug_status FILTER html %] - [% short_desc FILTER html %] - [% extra FILTER none %] + + [% "$terms.Bug $id" FILTER bug_link(id) FILTER none %] + + [% get_status(bugs.$id.bug_status) FILTER html %] + [% bugs.$id.short_desc FILTER html %] + [% IF extra %] + [% bugdata.total_time FILTER html %] + [% END %] [% END %] @@ -203,9 +188,8 @@

Inactive [% terms.bugs %]

[% cid = 0 %] - [% FOREACH bug_id = null.keys.nsort %] - [% INCLUDE bug_header id=bug_id bug_status=null.$bug_id.1 - short_desc=null.$bug_id.0 cid=cid %] + [% FOREACH bug_id = null.nsort %] + [% INCLUDE bug_header id=bug_id cid=cid %] [% cid = cid + 1 %] [% END %]
@@ -213,20 +197,18 @@ [% BLOCK section_total %] - [% IF global.total > 0 %] + [% IF global.total > 0 %] - - Totals - [% additional FILTER none %] -    - [% global.total FILTER format("%.2f") %] - - [% ELSE %] - - No time allocated during the specified period. - - [% END %] - [% global.grand_total = global.grand_total + global.total %] + Totals + [% additional FILTER html %] + [% global.total FILTER format("%.2f") %] + + [% ELSE %] + + No time allocated during the specified period. + + [% END %] + [% global.grand_total = global.grand_total + global.total %] [% END %] [%# @@ -301,20 +283,9 @@ -
[% END %] - -[%# - # - # Utility - # - #%] - -[% BLOCK buglink %] - [% terms.Bug %] [% id FILTER html %] -[% END %] - diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index ff9c17497..241433313 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1043,7 +1043,12 @@ [% ELSIF error == "no_bugs_chosen" %] [% title = BLOCK %]No [% terms.Bugs %] Selected[% END %] - You apparently didn't choose any [% terms.bugs %] to modify. + You apparently didn't choose any [% terms.bugs %] + [% IF action == "modify" %] + to modify. + [% ELSIF action == "view" %] + to view. + [% END %] [% ELSIF error == "no_bug_ids" %] [% title = BLOCK %]No [% terms.Bugs %] Selected[% END %] -- cgit v1.2.3-24-g4f1b