[Bps-public-commit] r14960 - in sd/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Sat Aug 9 17:06:37 EDT 2008


Author: sartak
Date: Sat Aug  9 17:06:37 2008
New Revision: 14960

Modified:
   sd/trunk/   (props changed)
   sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm

Log:
 r69035 at onn:  sartak | 2008-08-09 17:06:33 -0400
 Don't display empty comments and attachment headers


Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm	Sat Aug  9 17:06:37 2008
@@ -13,13 +13,19 @@
     print "\n=head1 METADATA\n\n";
     super();
 
-    print "\n=head1 ATTACHMENTS\n\n";
     my @attachments = sort by_creation_date @{$record->attachments};
-    print $_->format_summary . "\n" for @attachments;
+    if (@attachments) {
+        print "\n=head1 ATTACHMENTS\n\n";
+        print $_->format_summary . "\n"
+            for @attachments;
+    }
 
-    print "\n=head1 COMMENTS\n\n";
     my @comments = sort by_creation_date @{$record->comments};
-    print $_->prop('created') . "\n" . $_->prop('content') . "\n\n" for @comments;
+    if (@comments) {
+        print "\n=head1 COMMENTS\n\n";
+        print $_->prop('created') . "\n" . $_->prop('content') . "\n\n"
+            for @comments;
+    }
 
     print "\n=head1 HISTORY\n\n";
     print $record->history_as_string;



More information about the Bps-public-commit mailing list