[Rt-commit] rt branch, 4.2/stop-cf-localization-in-search, created. rt-4.2.1-36-gbb7652f
? sunnavy
sunnavy at bestpractical.com
Wed Dec 4 09:18:12 EST 2013
The branch, 4.2/stop-cf-localization-in-search has been created
at bb7652ff2d7f46fc3963c94d714b64ba86ddf889 (commit)
- Log -----------------------------------------------------------------
commit bb7652ff2d7f46fc3963c94d714b64ba86ddf889
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Nov 27 00:17:29 2013 +0800
stop localizing custom field names in search
diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
index ffb7441..e3da5d0 100644
--- a/share/html/Elements/CollectionAsTable/Header
+++ b/share/html/Elements/CollectionAsTable/Header
@@ -95,6 +95,7 @@ foreach my $col ( @Format ) {
if $span;
$m->out('>');
+ my $loc_title;
# if title is not defined then use defined attribute or last
# one we saw in the format
unless ( defined $col->{'title'} ) {
@@ -109,8 +110,9 @@ foreach my $col ( @Format ) {
# in case title is not defined in ColumnMap
# the following regex changes $attr like from "ReferredToBy" to "Referred To By"
$title = join ' ', split /(?<=[a-z])(?=[A-Z])/, $attr unless defined $title;
+ $loc_title = $attr =~ /^(?:CustomField|CF)\./ ? $title : loc($title);
} else {
- $title = $m->comp('/Elements/ScrubHTML', Content => $title);
+ $loc_title = loc($m->comp('/Elements/ScrubHTML', Content => $title));
}
if ( $AllowSorting and $col->{'attribute'}
@@ -134,11 +136,11 @@ foreach my $col ( @Format ) {
%$generic_query_args,
OrderBy => $attr, Order => $new_order
), 'h')
- . '">'. loc($title) .'</a>'
+ . '">'. $loc_title .'</a>'
);
}
else {
- $m->out( loc($title) );
+ $m->out( $loc_title );
}
$m->out('</th>');
}
diff --git a/share/html/Search/Elements/EditFormat b/share/html/Search/Elements/EditFormat
index c3491fc..4dfd6b2 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -59,7 +59,7 @@
<td valign="top"><select size="6" name="SelectDisplayColumns" multiple="multiple">
% my %seen;
% foreach my $field ( grep !$seen{lc $_}++, @$AvailableColumns) {
-<option value="<% $field %>"><% loc($field) %></option>
+<option value="<% $field %>"><% $field =~ /^(?:CustomField|CF)\./ ? $field : loc($field) %></option>
% }
</select></td>
<td>
@@ -106,7 +106,7 @@
<select size="4" name="CurrentDisplayColumns">
% my $i=0;
% foreach my $field ( @$CurrentFormat ) {
-<option value="<% $i++ %>><% $field->{Column} %>"><% loc( $field->{Column} ) %></option>
+<option value="<% $i++ %>><% $field->{Column} %>"><% $field->{Column} =~ /^(?:CustomField|CF)\./ ? $field->{Column} : loc( $field->{Column} ) %></option>
% }
</select>
<br />
diff --git a/share/html/Search/Elements/EditSort b/share/html/Search/Elements/EditSort
index ff1dc40..0d2d40d 100644
--- a/share/html/Search/Elements/EditSort
+++ b/share/html/Search/Elements/EditSort
@@ -68,7 +68,7 @@
% if (defined $OrderBy[$o] and $fieldval eq $OrderBy[$o]) {
selected="selected"
% }
-><% loc($field) %></option>
+><% $field =~ /^(?:CustomField|CF)\./ ? $field : loc($field) %></option>
% }
</select>
<select name="Order">
-----------------------------------------------------------------------
More information about the rt-commit
mailing list