From fc293fbd39f14308fbccd0cf9b523664ae813761 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 29 Jan 2009 21:22:19 +0000 Subject: Bug 219021: Only display email addresses to logged-in users Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit --- template/en/default/attachment/list.html.tmpl | 5 +- template/en/default/bug/activity/table.html.tmpl | 6 +- template/en/default/bug/comments.html.tmpl | 9 +-- template/en/default/bug/dependency-tree.html.tmpl | 2 +- template/en/default/bug/edit.html.tmpl | 85 ++++++++-------------- template/en/default/bug/show-multiple.html.tmpl | 4 +- template/en/default/bug/show.xml.tmpl | 27 ++++--- .../en/default/bug/votes/list-for-bug.html.tmpl | 5 +- template/en/default/global/user.html.tmpl | 39 ++++++++++ template/en/default/list/list.html.tmpl | 2 +- template/en/default/reports/components.html.tmpl | 6 +- template/en/default/reports/report-table.csv.tmpl | 39 ++++++---- template/en/default/reports/report-table.html.tmpl | 34 +++++---- template/en/default/reports/report.html.tmpl | 2 +- template/en/default/request/queue.html.tmpl | 7 +- 15 files changed, 150 insertions(+), 122 deletions(-) create mode 100644 template/en/default/global/user.html.tmpl (limited to 'template') diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index 054b68455..c93ea5808 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -95,10 +95,7 @@ title="Go to the comment associated with the attachment"> [%- attachment.attached FILTER time %], - - [% attachment.attacher.name || attachment.attacher.login FILTER html %] - + [% INCLUDE global/user.html.tmpl who = attachment.attacher %] diff --git a/template/en/default/bug/activity/table.html.tmpl b/template/en/default/bug/activity/table.html.tmpl index b676eb1c9..8e44230ae 100644 --- a/template/en/default/bug/activity/table.html.tmpl +++ b/template/en/default/bug/activity/table.html.tmpl @@ -61,7 +61,7 @@ [% FOREACH operation = operations %] - [% operation.who FILTER html %] + [% operation.who FILTER email FILTER html %] [% operation.when FILTER time %] @@ -89,7 +89,7 @@ change.fieldname == 'dependson' %] [% change.removed FILTER bug_list_link FILTER none %] [% ELSE %] - [% change.removed FILTER html %] + [% change.removed FILTER email FILTER html %] [% END %] [% ELSE %]   @@ -109,7 +109,7 @@ change.fieldname == 'dependson' %] [% change.added FILTER bug_list_link FILTER none %] [% ELSE %] - [% change.added FILTER html %] + [% change.added FILTER email FILTER html %] [% END %] [% ELSE %]   diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 1e8ee8c54..3a30ca5b2 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -188,11 +188,7 @@ - - - + [% INCLUDE global/user.html.tmpl who = comment.author %] @@ -226,7 +222,8 @@ [% END %]
-  [%- wrapped_comment FILTER quoteUrls(bug.bug_id, comment.already_wrapped) -%]
+  [%- wrapped_comment FILTER email 
+                      FILTER quoteUrls(bug.bug_id, comment.already_wrapped) -%]
 
[% END %] diff --git a/template/en/default/bug/dependency-tree.html.tmpl b/template/en/default/bug/dependency-tree.html.tmpl index adabf8ea2..347478bfc 100644 --- a/template/en/default/bug/dependency-tree.html.tmpl +++ b/template/en/default/bug/dependency-tree.html.tmpl @@ -154,7 +154,7 @@ [% BLOCK buginfo %] [% get_status(bug.bug_status) FILTER html -%] [%+ get_resolution(bug.resolution) FILTER html %]; - [%-%] assigned to [% bug.assigned_to.login FILTER html %] + [%-%] assigned to [% bug.assigned_to.login FILTER email FILTER html %] [%-%][% "; Target: " _ bug.target_milestone IF bug.target_milestone %] [% END %] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 50c7ea9d5..bb80fc1ad 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -524,7 +524,7 @@ [% IF bug.check_can_change_field("assigned_to", 0, 1) %]
- [% INCLUDE user_identity user=> bug.assigned_to %] + [% INCLUDE global/user.html.tmpl who = bug.assigned_to %] (edit)
@@ -548,7 +548,7 @@ initDefaultCheckbox('assignee'); [% ELSE %] - [% INCLUDE user_identity user => bug.assigned_to %] + [% INCLUDE global/user.html.tmpl who = bug.assigned_to %] [% END %] @@ -559,13 +559,12 @@ : - [% IF bug.check_can_change_field("qa_contact", 0, 1) %] [% IF bug.qa_contact != "" %]
- [% INCLUDE user_identity user=> bug.qa_contact %] + [% INCLUDE global/user.html.tmpl who = bug.qa_contact %] (edit)
@@ -593,7 +592,7 @@ initDefaultCheckbox('qa_contact'); [% ELSE %] - [% INCLUDE user_identity user => bug.qa_contact %] + [% INCLUDE global/user.html.tmpl who = bug.qa_contact %] [% END %] @@ -813,7 +812,7 @@ Reported: - [% bug.creation_ts FILTER time %] by [% INCLUDE user_identity user => bug.reporter %] + [% bug.creation_ts FILTER time %] by [% INCLUDE global/user.html.tmpl who = bug.reporter %] @@ -833,11 +832,10 @@ [%# Block for CC LIST #%] [%############################################################################%] [% BLOCK section_cclist %] - [% IF user.id %] - - - + + + [% IF user.id %] [% IF NOT bug.cc || NOT bug.cc.contains(user.login) %] @@ -867,35 +865,35 @@ [% END %] [% END %] - (edit) + ([% IF user.id %]edit[% ELSE %]show[% END %])
-
+
+ [% IF user.id %]
- +
+ [% INCLUDE global/userselect.html.tmpl + id => "newcc" + name => "newcc" + size => 30 + multiple => 5 + %]
- [% INCLUDE global/userselect.html.tmpl - id => "newcc" - name => "newcc" - size => 30 - multiple => 5 - %] -
- [% IF bug.cc %] - - [% IF user.id %] -
- - [%%] -
+ [% IF bug.cc %] + + [% IF user.id %] +
+ + [%%] +
+ [% END %] [% END %] - [% END %]
- [% END %] [% END %] [%############################################################################%] @@ -1167,23 +1164,3 @@ [% value = undef %] [% spellcheck = undef %] [% END %] - -[%############################################################################%] -[%# Block for user identities. Wraps the information inside of an hCard. #%] -[%############################################################################%] - -[% BLOCK user_identity %] - - [% FILTER collapse %] - [% IF user.name %] - - [% ELSE %] - - [% END %] - [% END %] -[% END %] - diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index 173d98e92..f1a5cc466 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -336,12 +336,12 @@ [% field_descs.cc FILTER html %]: [% FOREACH c = bug.cc %] - [% c FILTER html %][% ", " IF not loop.last() %] + [% c FILTER email FILTER html %][% ", " IF not loop.last() %] [% END %] [% ELSIF name == "reporter" || name == "assigned_to" || name == "qa_contact" %] [% field_descs.${name} FILTER html %]: - [% bug.${name}.identity FILTER html %] + [% bug.${name}.identity FILTER email FILTER html %] [% ELSIF name == "flags" %] Flags: diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl index 23874d989..f6f3617a0 100644 --- a/template/en/default/bug/show.xml.tmpl +++ b/template/en/default/bug/show.xml.tmpl @@ -25,9 +25,13 @@ @@ -58,9 +62,9 @@ [% END %] @@ -69,12 +73,12 @@ [% FOREACH c = bug.longdescs %] [% NEXT IF c.isprivate && !user.in_group(Param("insidergroup")) %] - [% c.author.email FILTER xml %] + [% c.author.email FILTER email FILTER xml %] [% c.time FILTER time FILTER xml %] [% IF user.in_group(Param('timetrackinggroup')) && (c.work_time - 0 != 0) %] [% PROCESS formattimeunit time_unit = c.work_time FILTER xml %] [% END %] - [% c.body FILTER xml %] + [% c.body FILTER email FILTER xml %] [% END %] [% END %] @@ -93,7 +97,7 @@ [% a.filename FILTER xml %] [% a.contenttype FILTER xml %] [% a.datasize FILTER xml %] - [% a.attacher.email FILTER xml %] + [% a.attacher.email FILTER email FILTER xml %] [% IF displayfields.attachmentdata %] [% a.data FILTER base64 %] [% END %] @@ -102,9 +106,9 @@ [% END %] @@ -129,10 +133,13 @@ [% IF field == 'reporter' OR field == 'assigned_to' OR field == 'qa_contact' %] [% name = val.name %] - [% val = val.email %] + [% val = val.email FILTER email %] + [% ELSIF field == 'cc' %] + [% val = val FILTER email %] [% ELSIF field == 'creation_ts' OR field == 'delta_ts' %] [% val = val FILTER time %] [% END %] - <[% field %][% IF name != '' %] name="[% name FILTER xml %]"[% END -%]>[% val FILTER xml %] + <[% field %][% IF name != '' %] name="[% name FILTER xml %]"[% END -%]> + [%- val FILTER xml %] [% END %] [% END %] diff --git a/template/en/default/bug/votes/list-for-bug.html.tmpl b/template/en/default/bug/votes/list-for-bug.html.tmpl index b93d1f346..a599dc0fb 100644 --- a/template/en/default/bug/votes/list-for-bug.html.tmpl +++ b/template/en/default/bug/votes/list-for-bug.html.tmpl @@ -43,8 +43,9 @@ [% total = total + voter.vote_count %] - - [% voter.login_name FILTER html %] + + [% voter.login_name FILTER email FILTER html %] diff --git a/template/en/default/global/user.html.tmpl b/template/en/default/global/user.html.tmpl new file mode 100644 index 000000000..df902b451 --- /dev/null +++ b/template/en/default/global/user.html.tmpl @@ -0,0 +1,39 @@ +[%# 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 Daniel Brooks. + # Portions created by the Initial Developer are Copyright (C) 2007 + # the Initial Developer. All Rights Reserved. + # + # Contributor(s): + # Daniel Brooks + # Max Kanat-Alexander + #%] + +[%# INTERFACE: + # who: A Bugzilla::User object that we are going to represent. + #%] + + + [% FILTER collapse %] + [% IF user.id %] + ' IF user.id %] + [% END %] + diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index 467e4dfc7..4929c416d 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -206,7 +206,7 @@ | [% END %] - [% IF bugowners %] + [% IF bugowners && user.id %] Send Mail to [% terms.Bug %] Assignees | [% END %] diff --git a/template/en/default/reports/components.html.tmpl b/template/en/default/reports/components.html.tmpl index 351c7d01b..eb08a35ac 100644 --- a/template/en/default/reports/components.html.tmpl +++ b/template/en/default/reports/components.html.tmpl @@ -74,13 +74,11 @@ [% comp.name FILTER html %] - - [% comp.default_assignee.login FILTER html %] + [% INCLUDE global/user.html.tmpl who = comp.default_assignee %] [% IF Param("useqacontact") %] - - [% comp.default_qa_contact.login FILTER html %] + [% INCLUDE global/user.html.tmpl who = comp.default_qa_contact %] [% END %] diff --git a/template/en/default/reports/report-table.csv.tmpl b/template/en/default/reports/report-table.csv.tmpl index cf3774973..0f315cc02 100644 --- a/template/en/default/reports/report-table.csv.tmpl +++ b/template/en/default/reports/report-table.csv.tmpl @@ -30,7 +30,14 @@ [% row_field_disp = field_descs.$row_field || row_field %] [% IF tbl_field %] - [% tbl_field_disp FILTER csv %]: [% tbl FILTER csv %] + [% IF tbl_field == 'assigned_to' OR tbl_field == 'reporter' + OR tbl_field == 'qa_contact' + %] + [% tbl_disp = tbl FILTER email %] + [% ELSE %] + [% tbl_disp = tbl %] + [% END %] + [% tbl_field_disp FILTER csv %]: [% tbl_disp FILTER csv %] [% END %] [% IF row_field %] [% row_field_disp FILTER csv %] @@ -40,26 +47,14 @@ [% IF col_field -%] [% FOREACH col = col_names -%] [% colsepchar %] - [% IF col_field == 'bug_status' %] - [% get_status(col) FILTER csv -%] - [% ELSIF col_field == 'resolution' %] - [% get_resolution(col) FILTER csv -%] - [% ELSE %] - [% col FILTER csv -%] - [% END %] + [% PROCESS value_display value = col field = col_field %] [% END -%] [% ELSE -%] [% colsepchar %][% num_bugs FILTER csv %] [% END %] [% FOREACH row = row_names %] - [% IF row_field == 'bug_status' %] - [% get_status(row) FILTER csv -%] - [% ELSIF row_field == 'resolution' %] - [% get_resolution(row) FILTER csv -%] - [% ELSE %] - [% row FILTER csv -%] - [% END %] + [% PROCESS value_display value = row field = row_field %] [% FOREACH col = col_names %] [% colsepchar %] [% IF data.$tbl AND data.$tbl.$col AND data.$tbl.$col.$row %] @@ -70,3 +65,17 @@ [% END %] [% END %] + +[% BLOCK value_display %] + [% SET disp_value = value %] + [% IF field == 'bug_status' %] + [% SET disp_value = get_status(value) %] + [% ELSIF field == 'resolution' %] + [% SET disp_value = get_resolution(value) %] + [% ELSIF field == 'assigned_to' OR field == 'reporter' + OR field == 'qa_contact' + %] + [% disp_value = value FILTER email %] + [% END %] + [% disp_value FILTER csv %] +[% END %] diff --git a/template/en/default/reports/report-table.html.tmpl b/template/en/default/reports/report-table.html.tmpl index 0ebe631d1..6c5d6ede2 100644 --- a/template/en/default/reports/report-table.html.tmpl +++ b/template/en/default/reports/report-table.html.tmpl @@ -44,7 +44,7 @@ [% END %] [% IF tbl_field %] -

[% tbl_disp FILTER html %]

+

[% tbl_disp FILTER email FILTER html %]

[% END %] @@ -79,13 +79,7 @@ [% col_idx = 1 - col_idx %] [% END %] [% FOREACH col = col_names %] [% row_total = row_total + data.$tbl.$col.$row %] @@ -163,4 +151,18 @@ -
- [% IF col_field == 'bug_status' %] - [% get_status(col) FILTER html FILTER replace('^ $',' ') %] - [% ELSIF col_field == 'resolution' %] - [% get_resolution(col) FILTER html FILTER replace('^ $',' ') %] - [% ELSE %] - [% col FILTER html FILTER replace('^ $',' ') %] - [% END %] + [% PROCESS value_display value = col field = col_field %] @@ -100,13 +94,7 @@ [% row_idx = 1 - row_idx %]
- [% IF row_field == 'bug_status' %] - [% get_status(row) FILTER html FILTER replace('^ $',' ') %] - [% ELSIF row_field == 'resolution' %] - [% get_resolution(row) FILTER html FILTER replace('^ $',' ') %] - [% ELSE %] - [% row FILTER html FILTER replace('^ $',' ') %] - [% END %] + [% PROCESS value_display value = row field = row_field %]
+ + +[% BLOCK value_display %] + [% SET disp_value = value %] + [% IF field == 'bug_status' %] + [% SET disp_value = get_status(value) %] + [% ELSIF field == 'resolution' %] + [% SET disp_value = get_resolution(value) %] + [% ELSIF field == 'assigned_to' OR field == 'reporter' + OR field == 'qa_contact' + %] + [% disp_value = value FILTER email %] + [% END %] + [% disp_value FILTER html FILTER replace('^ $',' ') %] +[% END %] diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl index 37af0b300..4f7ee49b6 100644 --- a/template/en/default/reports/report.html.tmpl +++ b/template/en/default/reports/report.html.tmpl @@ -96,7 +96,7 @@ [% PROCESS "reports/report-table.html.tmpl" %] [% ELSE %] [% IF tbl %] -

[% tbl_disp FILTER html %]

+

[% tbl_disp FILTER email FILTER html %]

[% END %] [% imageurl = BLOCK %]report.cgi?[% imagebase FILTER html %]&format= diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl index af911b2ef..8dd0f0400 100644 --- a/template/en/default/request/queue.html.tmpl +++ b/template/en/default/request/queue.html.tmpl @@ -157,7 +157,8 @@ to some group are shown by default. [% PROCESS global/footer.html.tmpl %] [% BLOCK start_new_table %] -

[% column_headers.$group_field %]: [% (request.$group_field || "None") FILTER html %]

+

[% column_headers.$group_field %]: + [%+ (request.$group_field || "None") FILTER email FILTER html %]

[% FOREACH column = display_columns %] @@ -190,11 +191,11 @@ to some group are shown by default. [% END %] [% BLOCK display_requestee %] - [% request.requestee FILTER html %] + [% request.requestee FILTER email FILTER html %] [% END %] [% BLOCK display_requester %] - [% request.requester FILTER html %] + [% request.requester FILTER email FILTER html %] [% END %] [% BLOCK display_created %] -- cgit v1.2.3-24-g4f1b