Bug 176461 - Move descs strings from change-columns.html.tmpl to

field-descs.html.tmpl Patch by burnus@gmx.de (Tobias Burnus), r=gerv, bbaetz, a=justdave
parent a34d8f57
...@@ -216,7 +216,7 @@ sub GetGroupsByUserId { ...@@ -216,7 +216,7 @@ sub GetGroupsByUserId {
while (MoreSQLData()) { while (MoreSQLData()) {
my $group = {}; my $group = {};
($group->{'id'}, $group->{'name'}, ($group->{'bug_id'}, $group->{'name'},
$group->{'description'}, $group->{'isactive'}) = FetchSQLData(); $group->{'description'}, $group->{'isactive'}) = FetchSQLData();
push(@groups, $group); push(@groups, $group);
} }
...@@ -363,7 +363,7 @@ elsif ($::FORM{'cmdtype'} eq "doit" && $::FORM{'remember'}) { ...@@ -363,7 +363,7 @@ elsif ($::FORM{'cmdtype'} eq "doit" && $::FORM{'remember'}) {
# Note: There are a few hacks in the code that deviate from these definitions. # Note: There are a few hacks in the code that deviate from these definitions.
# In particular, when the list is sorted by the "votes" field the word # In particular, when the list is sorted by the "votes" field the word
# "DESC" is added to the end of the field to sort in descending order, # "DESC" is added to the end of the field to sort in descending order,
# and the redundant summaryfull column is removed when the client # and the redundant short_desc column is removed when the client
# requests "all" columns. # requests "all" columns.
my $columns = {}; my $columns = {};
...@@ -373,33 +373,33 @@ sub DefineColumn { ...@@ -373,33 +373,33 @@ sub DefineColumn {
} }
# Column: ID Name Title # Column: ID Name Title
DefineColumn("id" , "bugs.bug_id" , "ID" ); DefineColumn("bug_id" , "bugs.bug_id" , "ID" );
DefineColumn("opendate" , "bugs.creation_ts" , "Opened" ); DefineColumn("opendate" , "bugs.creation_ts" , "Opened" );
DefineColumn("changeddate" , "bugs.delta_ts" , "Changed" ); DefineColumn("changeddate" , "bugs.delta_ts" , "Changed" );
DefineColumn("severity" , "bugs.bug_severity" , "Severity" ); DefineColumn("bug_severity" , "bugs.bug_severity" , "Severity" );
DefineColumn("priority" , "bugs.priority" , "Priority" ); DefineColumn("priority" , "bugs.priority" , "Priority" );
DefineColumn("platform" , "bugs.rep_platform" , "Platform" ); DefineColumn("rep_platform" , "bugs.rep_platform" , "Hardware" );
DefineColumn("owner" , "map_assigned_to.login_name" , "Owner" ); DefineColumn("assigned_to" , "map_assigned_to.login_name" , "Assignee" );
DefineColumn("owner_realname" , "map_assigned_to.realname" , "Owner" ); DefineColumn("assigned_to_realname", "map_assigned_to.realname" , "Assignee" );
DefineColumn("reporter" , "map_reporter.login_name" , "Reporter" ); DefineColumn("reporter" , "map_reporter.login_name" , "Reporter" );
DefineColumn("reporter_realname" , "map_reporter.realname" , "Reporter" ); DefineColumn("reporter_realname" , "map_reporter.realname" , "Reporter" );
DefineColumn("qa_contact" , "map_qa_contact.login_name" , "QA Contact" ); DefineColumn("qa_contact" , "map_qa_contact.login_name" , "QA Contact" );
DefineColumn("qa_contact_realname", "map_qa_contact.realname" , "QA Contact" ); DefineColumn("qa_contact_realname", "map_qa_contact.realname" , "QA Contact" );
DefineColumn("status" , "bugs.bug_status" , "State" ); DefineColumn("bug_status" , "bugs.bug_status" , "Status" );
DefineColumn("resolution" , "bugs.resolution" , "Result" ); DefineColumn("resolution" , "bugs.resolution" , "Result" );
DefineColumn("summary" , "bugs.short_desc" , "Summary" ); DefineColumn("short_short_desc" , "bugs.short_desc" , "Summary" );
DefineColumn("summaryfull" , "bugs.short_desc" , "Summary" ); DefineColumn("short_desc" , "bugs.short_desc" , "Summary" );
DefineColumn("status_whiteboard" , "bugs.status_whiteboard" , "Status Summary" ); DefineColumn("status_whiteboard" , "bugs.status_whiteboard" , "Status Summary" );
DefineColumn("component" , "map_components.name" , "Component" ); DefineColumn("component" , "map_components.name" , "Component" );
DefineColumn("product" , "map_products.name" , "Product" ); DefineColumn("product" , "map_products.name" , "Product" );
DefineColumn("version" , "bugs.version" , "Version" ); DefineColumn("version" , "bugs.version" , "Version" );
DefineColumn("os" , "bugs.op_sys" , "OS" ); DefineColumn("op_sys" , "bugs.op_sys" , "OS" );
DefineColumn("target_milestone" , "bugs.target_milestone" , "Target Milestone" ); DefineColumn("target_milestone" , "bugs.target_milestone" , "Target Milestone" );
DefineColumn("votes" , "bugs.votes" , "Votes" ); DefineColumn("votes" , "bugs.votes" , "Votes" );
DefineColumn("keywords" , "bugs.keywords" , "Keywords" ); DefineColumn("keywords" , "bugs.keywords" , "Keywords" );
DefineColumn("estimated_time" , "bugs.estimated_time" , "Estimated Hours" ); DefineColumn("estimated_time" , "bugs.estimated_time" , "Estimated Hours" );
DefineColumn("remaining_time" , "bugs.remaining_time" , "Remaining Hours" ); DefineColumn("remaining_time" , "bugs.remaining_time" , "Remaining Hours" );
DefineColumn("actual_time" , "(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time", "Actual Hours"); DefineColumn("actual_time" , "(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time", "Actual Hours");
DefineColumn("percentage_complete","(100*((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))/((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS percentage_complete", "% Complete"); DefineColumn("percentage_complete","(100*((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))/((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS percentage_complete", "% Complete");
################################################################################ ################################################################################
# Display Column Determination # Display Column Determination
...@@ -411,16 +411,26 @@ my @displaycolumns = (); ...@@ -411,16 +411,26 @@ my @displaycolumns = ();
if (defined $params->param('columnlist')) { if (defined $params->param('columnlist')) {
if ($params->param('columnlist') eq "all") { if ($params->param('columnlist') eq "all") {
# If the value of the CGI parameter is "all", display all columns, # If the value of the CGI parameter is "all", display all columns,
# but remove the redundant "summaryfull" column. # but remove the redundant "short_desc" column.
@displaycolumns = grep($_ ne 'summaryfull', keys(%$columns)); @displaycolumns = grep($_ ne 'short_desc', keys(%$columns));
} }
else { else {
@displaycolumns = split(/[ ,]+/, $params->param('columnlist')); @displaycolumns = split(/[ ,]+/, $params->param('columnlist'));
} }
} }
elsif (defined $::COOKIE{'COLUMNLIST'}) { elsif (defined $::COOKIE{'COLUMNLIST'}) {
# 2002-10-31 Rename column names (see bug 176461)
my $columnlist = $::COOKIE{'COLUMNLIST'};
$columnlist =~ s/owner/assigned_to/;
$columnlist =~ s/owner_realname/assigned_to_realname/;
$columnlist =~ s/[^_]platform/rep_platform/;
$columnlist =~ s/[^_]severity/bug_severity/;
$columnlist =~ s/[^_]status/bug_status/;
$columnlist =~ s/summaryfull/short_desc/;
$columnlist =~ s/summary/short_short_desc/;
# Use the columns listed in the user's preferences. # Use the columns listed in the user's preferences.
@displaycolumns = split(/ /, $::COOKIE{'COLUMNLIST'}); @displaycolumns = split(/ /, $columnlist);
} }
else { else {
# Use the default list of columns. # Use the default list of columns.
...@@ -434,7 +444,7 @@ else { ...@@ -434,7 +444,7 @@ else {
# Remove the "ID" column from the list because bug IDs are always displayed # Remove the "ID" column from the list because bug IDs are always displayed
# and are hard-coded into the display templates. # and are hard-coded into the display templates.
@displaycolumns = grep($_ ne 'id', @displaycolumns); @displaycolumns = grep($_ ne 'bug_id', @displaycolumns);
# Add the votes column to the list of columns to be displayed # Add the votes column to the list of columns to be displayed
# in the bug list if the user is searching for bugs with a certain # in the bug list if the user is searching for bugs with a certain
...@@ -464,7 +474,7 @@ if (!UserInGroup(Param("timetrackinggroup"))) { ...@@ -464,7 +474,7 @@ if (!UserInGroup(Param("timetrackinggroup"))) {
# Generate the list of columns that will be selected in the SQL query. # Generate the list of columns that will be selected in the SQL query.
# The bug ID is always selected because bug IDs are always displayed # The bug ID is always selected because bug IDs are always displayed
my @selectcolumns = ("id"); my @selectcolumns = ("bug_id");
# remaining and actual_time are required for precentage_complete calculation: # remaining and actual_time are required for precentage_complete calculation:
if (lsearch(\@displaycolumns, "percentage_complete") >= 0) { if (lsearch(\@displaycolumns, "percentage_complete") >= 0) {
...@@ -480,7 +490,7 @@ push (@selectcolumns, @displaycolumns); ...@@ -480,7 +490,7 @@ push (@selectcolumns, @displaycolumns);
# has for modifying the bugs. # has for modifying the bugs.
if ($dotweak) { if ($dotweak) {
push(@selectcolumns, "product") if !grep($_ eq 'product', @selectcolumns); push(@selectcolumns, "product") if !grep($_ eq 'product', @selectcolumns);
push(@selectcolumns, "status") if !grep($_ eq 'status', @selectcolumns); push(@selectcolumns, "bug_status") if !grep($_ eq 'bug_status', @selectcolumns);
} }
...@@ -662,9 +672,9 @@ while (my @row = FetchSQLData()) { ...@@ -662,9 +672,9 @@ while (my @row = FetchSQLData()) {
($bug->{'opendate'} = DiffDate($bug->{'opendate'})) if $bug->{'opendate'}; ($bug->{'opendate'} = DiffDate($bug->{'opendate'})) if $bug->{'opendate'};
# Record the owner, product, and status in the big hashes of those things. # Record the owner, product, and status in the big hashes of those things.
$bugowners->{$bug->{'owner'}} = 1 if $bug->{'owner'}; $bugowners->{$bug->{'assigned_to'}} = 1 if $bug->{'assigned_to'};
$bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'}; $bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'};
$bugstatuses->{$bug->{'status'}} = 1 if $bug->{'status'}; $bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'};
$bug->{isingroups} = 0; $bug->{isingroups} = 0;
...@@ -672,7 +682,7 @@ while (my @row = FetchSQLData()) { ...@@ -672,7 +682,7 @@ while (my @row = FetchSQLData()) {
push(@bugs, $bug); push(@bugs, $bug);
# Add id to list for checking for bug privacy later # Add id to list for checking for bug privacy later
push(@bugidlist, $bug->{id}); push(@bugidlist, $bug->{'bug_id'});
} }
# Switch back from the shadow database to the regular database so PutFooter() # Switch back from the shadow database to the regular database so PutFooter()
...@@ -688,11 +698,11 @@ if (@bugidlist) { ...@@ -688,11 +698,11 @@ if (@bugidlist) {
"WHERE bugs.bug_id = bug_group_map.bug_id " . "WHERE bugs.bug_id = bug_group_map.bug_id " .
"AND bugs.bug_id IN (" . join(',',@bugidlist) . ")"); "AND bugs.bug_id IN (" . join(',',@bugidlist) . ")");
while (MoreSQLData()) { while (MoreSQLData()) {
my ($id) = FetchSQLData(); my ($bug_id) = FetchSQLData();
$privatebugs{$id} = 1; $privatebugs{$bug_id} = 1;
} }
foreach my $bug (@bugs) { foreach my $bug (@bugs) {
if ($privatebugs{$bug->{id}}) { if ($privatebugs{$bug->{'bug_id'}}) {
$bug->{isingroups} = 1; $bug->{isingroups} = 1;
} }
} }
......
...@@ -41,10 +41,11 @@ GetVersionTable(); ...@@ -41,10 +41,11 @@ GetVersionTable();
# The master list not only says what fields are possible, but what order # The master list not only says what fields are possible, but what order
# they get displayed in. # they get displayed in.
my @masterlist = ("opendate", "changeddate", "severity", "priority", my @masterlist = ("opendate", "changeddate", "bug_severity", "priority",
"platform", "owner", "owner_realname", "reporter", "rep_platform", "assigned_to", "assigned_to_realname",
"reporter_realname", "status", "resolution", "reporter", "reporter_realname", "bug_status",
"product", "component", "version", "os", "votes"); "resolution", "product", "component", "version", "op_sys",
"votes");
if (Param("usetargetmilestone")) { if (Param("usetargetmilestone")) {
push(@masterlist, "target_milestone"); push(@masterlist, "target_milestone");
...@@ -65,7 +66,7 @@ if (UserInGroup(Param("timetrackinggroup"))) { ...@@ -65,7 +66,7 @@ if (UserInGroup(Param("timetrackinggroup"))) {
"percentage_complete")); "percentage_complete"));
} }
push(@masterlist, ("summary", "summaryfull")); push(@masterlist, ("short_desc", "short_short_desc"));
$vars->{'masterlist'} = \@masterlist; $vars->{'masterlist'} = \@masterlist;
......
...@@ -334,8 +334,9 @@ sub FetchOneColumn { ...@@ -334,8 +334,9 @@ sub FetchOneColumn {
@::default_column_list = ("severity", "priority", "platform", "owner", @::default_column_list = ("bug_severity", "priority", "rep_platform",
"status", "resolution", "summary"); "assigned_to", "bug_status", "resolution",
"short_short_desc");
sub AppendComment { sub AppendComment {
my ($bugid, $who, $comment, $isprivate, $timestamp, $work_time) = @_; my ($bugid, $who, $comment, $isprivate, $timestamp, $work_time) = @_;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"bug_id" => "Bug ID", "bug_id" => "Bug ID",
"bug_severity" => "Severity", "bug_severity" => "Severity",
"bug_status" => "Status", "bug_status" => "Status",
"changeddate" => "Last Changed Date",
"cc" => "CC", "cc" => "CC",
"cclist_accessible" => "CC list accessible?", "cclist_accessible" => "CC list accessible?",
"component_id" => "Component ID", "component_id" => "Component ID",
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"keywords" => "Keywords", "keywords" => "Keywords",
"newcc" => "CC", "newcc" => "CC",
"op_sys" => "OS", "op_sys" => "OS",
"opendate" => "Open Date",
"percentage_complete" => "%Complete", "percentage_complete" => "%Complete",
"priority" => "Priority", "priority" => "Priority",
"product_id" => "Product ID", "product_id" => "Product ID",
......
...@@ -28,36 +28,19 @@ ...@@ -28,36 +28,19 @@
this feature requires cookies to work. this feature requires cookies to work.
</p> </p>
[% desc = { "opendate" => "Open Date", [% PROCESS "global/field-descs.html.tmpl" %]
"changeddate" => "Last Changed Date", [% field_descs.short_short_desc = "Summary (first 60 characters)" %]
"severity" => "Severity", [% field_descs.short_desc = "Full Summary" %]
"priority" => "Priority", [% field_descs.assigned_to_realname = "Assignee Realname" %]
"platform" => "Hardware", [% field_descs.reporter_realname = "Reporter Realname" %]
"owner" => "Owner", [% field_descs.qa_contact_realname = "QA Contact Realname" %]
"owner_realname" => "Owner Realname",
"reporter" => "Reporter",
"reporter_realname" => "Reporter Realname",
"status" => "Status",
"resolution" => "Resolution",
"product" => "Product",
"component" => "Component",
"version" => "Version",
"os" => "OS",
"votes" => "Votes",
"keywords" => "Keywords",
"target_milestone" => "Target",
"qa_contact" => "QA Contact",
"qa_contact_realname" => "QA Contact Realname",
"status_whiteboard" => "Whiteboard",
"summary" => "Summary (first 60 characters)",
"summaryfull" => "Full Summary" } %]
<form action="colchange.cgi"> <form action="colchange.cgi">
<input type="hidden" name="rememberedquery" value="[% buffer %]"> <input type="hidden" name="rememberedquery" value="[% buffer %]">
[% FOREACH column = masterlist %] [% FOREACH column = masterlist %]
<input type="checkbox" id="[% column %]" name="column_[% column %]" <input type="checkbox" id="[% column %]" name="column_[% column %]"
[% "checked='checked'" IF lsearch(collist, column) != -1 %]> [% "checked='checked'" IF lsearch(collist, column) != -1 %]>
<label for="[% column %]">[% desc.${column} || column %]</label> <label for="[% column %]">[% field_descs.${column} || column %]</label>
<br> <br>
[% END %] [% END %]
......
...@@ -31,26 +31,33 @@ ...@@ -31,26 +31,33 @@
# wrap is set if a column's contents should be allowed to be word-wrapped # wrap is set if a column's contents should be allowed to be word-wrapped
# by the browser. # by the browser.
#%] #%]
[% PROCESS "global/field-descs.html.tmpl" %]
[% field_descs.short_short_desc = field_descs.short_desc %]
[% field_descs.assigned_to_realname = field_descs.assigned_to %]
[% field_descs.reporter_realname = field_descs.reporter %]
[% field_descs.qa_contact_realname = field_descs.qa_contact %]
[% abbrev = [% abbrev =
{ {
"severity" => { maxlength => 3 , title => "Sev" } , "bug_severity" => { maxlength => 3 , title => "Sev" } ,
"priority" => { maxlength => 3 , title => "Pri" } , "priority" => { maxlength => 3 , title => "Pri" } ,
"platform" => { maxlength => 3 , title => "Plt" } , "rep_platform" => { maxlength => 3 , title => "Plt" } ,
"status" => { maxlength => 4 } , "bug_status" => { maxlength => 4 } ,
"reporter" => { maxlength => 30 , ellipsis => "..." } , "assigned_to" => { maxlength => 30 , ellipsis => "..." } ,
"reporter_realname" => { maxlength => 20 , ellipsis => "..." } , "assigned_to_realname" => { maxlength => 20 , ellipsis => "..." } ,
"owner" => { maxlength => 30 , ellipsis => "..." } , "reporter" => { maxlength => 30 , ellipsis => "..." } ,
"owner_realname" => { maxlength => 20 , ellipsis => "..." } , "reporter_realname" => { maxlength => 20 , ellipsis => "..." } ,
"qa_contact" => { maxlength => 30 , ellipsis => "..." , title => "QAContact" } , "qa_contact" => { maxlength => 30 , ellipsis => "..." , title => "QAContact" } ,
"qa_contact_realname" => { maxlength => 20 , ellipsis => "..." , title => "QAContact" } , "qa_contact_realname" => { maxlength => 20 , ellipsis => "..." , title => "QAContact" } ,
"resolution" => { maxlength => 4 } , "resolution" => { maxlength => 4 } ,
"summary" => { maxlength => 60 , ellipsis => "..." , wrap => 1 } , "short_desc" => { wrap => 1 } ,
"summaryfull" => { wrap => 1 } , "short_short_desc" => { maxlength => 60 , ellipsis => "..." , wrap => 1 } ,
"status_whiteboard" => { title => "StatusSummary" , wrap => 1 } , "status_whiteboard" => { title => "StatusSummary" , wrap => 1 } ,
"component" => { maxlength => 8 , title => "Comp" } , "component" => { maxlength => 8 , title => "Comp" } ,
"product" => { maxlength => 8 } , "product" => { maxlength => 8 } ,
"version" => { maxlength => 5 , title => "Vers" } , "version" => { maxlength => 5 , title => "Vers" } ,
"os" => { maxlength => 4 } , "op_sys" => { maxlength => 4 } ,
"target_milestone" => { title => "TargetM" } , "target_milestone" => { title => "TargetM" } ,
"percentage_complete" => { format_value => "%d %%" } , "percentage_complete" => { format_value => "%d %%" } ,
} }
...@@ -111,7 +118,7 @@ ...@@ -111,7 +118,7 @@
<a href="buglist.cgi?[% urlquerypart %]&amp;order= <a href="buglist.cgi?[% urlquerypart %]&amp;order=
[% column.name FILTER url_quote FILTER html %] [% column.name FILTER url_quote FILTER html %]
[% ",$qorder" FILTER html IF order %]"> [% ",$qorder" FILTER html IF order %]">
[%- abbrev.$id.title || column.title -%]</a> [%- abbrev.$id.title || field_descs.$id || column.title -%]</a>
</th> </th>
[% END %] [% END %]
...@@ -128,11 +135,11 @@ ...@@ -128,11 +135,11 @@
[% tableheader %] [% tableheader %]
[% END %] [% END %]
<tr class="bz_[% bug.severity %] bz_[% bug.priority %] [%+ "bz_secure" IF bug.isingroups %]"> <tr class="bz_[% bug.bug_severity %] bz_[% bug.priority %] [%+ "bz_secure" IF bug.isingroups %]">
<td> <td>
[% IF dotweak %]<input type="checkbox" name="id_[% bug.id %]">[% END %] [% IF dotweak %]<input type="checkbox" name="id_[% bug.bug_id %]">[% END %]
<a href="show_bug.cgi?id=[% bug.id %]">[% bug.id %]</a> <a href="show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a>
</td> </td>
[% FOREACH column = displaycolumns %] [% FOREACH column = displaycolumns %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment