summaryrefslogtreecommitdiff
path: root/rt/html/Ticket/Elements/ShowMessageHeaders
diff options
context:
space:
mode:
authorivan <ivan>2008-03-02 04:06:06 +0000
committerivan <ivan>2008-03-02 04:06:06 +0000
commit9c68254528b6f2c7d8c1921b452fa56064783782 (patch)
tree09623ba39355e74f1cff2f3c35b7347bd309f306 /rt/html/Ticket/Elements/ShowMessageHeaders
parentef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 (diff)
import rt 3.4.6
Diffstat (limited to 'rt/html/Ticket/Elements/ShowMessageHeaders')
-rw-r--r--rt/html/Ticket/Elements/ShowMessageHeaders42
1 files changed, 19 insertions, 23 deletions
diff --git a/rt/html/Ticket/Elements/ShowMessageHeaders b/rt/html/Ticket/Elements/ShowMessageHeaders
index 81c5637..8dc76ba 100644
--- a/rt/html/Ticket/Elements/ShowMessageHeaders
+++ b/rt/html/Ticket/Elements/ShowMessageHeaders
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -22,9 +22,7 @@
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/copyleft/gpl.html.
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@ -45,15 +43,14 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
+% use Data::Dumper;
<table>
% foreach my $header (@headers) {
-% next unless $display_headers{_all}
-% or ($display_headers{ lc $header->{Tag} }
-% and length $header->{Value});
- <tr>
- <td align="right" class="message-header-key"><%$header->{'Tag'}%>:</td>
- <td class="message-header-value"><%$header->{'Value'} | n%></td>
- </tr>
+% next unless ($display_headers{'_all'} || $display_headers{lc($header->{'Tag'})});
+<tr>
+<td align="right" class="message-header-key"><%$header->{'Tag'}%>:</td>
+<td class="message-header-value"><%$header->{'Value'} | n%></td>
+</tr>
% }
</table>
<%INIT>
@@ -64,24 +61,23 @@ $m->comp('/Elements/Callback', content => \$content, %ARGS);
# we'll display the value without escaping later (for MakeClicky et al.)
$content = $m->interp->apply_escapes($content, 'h');
-my @lines = split /\n/, $content;
+my @lines = split (/\n/,$content);
my $in_header = 0;
-my @headers;
-
-for (@lines) {
+my @headers =();
+foreach (@lines) {
if (/^(\S+):\s+(.*)$/) {
- push @headers, { Tag => $1, Value => $2 };
- }
- elsif (/^\s+/) {
+ push (@headers, { Tag => $1, Value => $2} );
+ } elsif ($headers[-1]) {
$headers[-1]->{'Value'} .= $_;
- }
- else {
- s/:$//;
- push @headers, { Tag => $_, Value => '' };
+ } else {
+
+ push (@headers, { Tag => $_, Value => ''} );
}
}
-my %display_headers = map { lc($_) => 1 } @$DisplayHeaders;
+my %display_headers;
+
+map { $display_headers{lc($_)} = 1 } @$DisplayHeaders;
$m->comp('/Elements/Callback', _CallbackName => 'Headers', content => \$content, headers => \@headers, display_headers => \%display_headers, %ARGS);