[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5511] trunk/LedgerSMB/Report.pm



Revision: 5511
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5511&view=rev
Author:   einhverfr
Date:     2013-01-07 15:03:38 +0000 (Mon, 07 Jan 2013)
Log Message:
-----------
Reports now have meaningful names when exported to pdf, csv, etc

Modified Paths:
--------------
    trunk/LedgerSMB/Report.pm

Modified: trunk/LedgerSMB/Report.pm
===================================================================
--- trunk/LedgerSMB/Report.pm	2013-01-07 14:42:23 UTC (rev 5510)
+++ trunk/LedgerSMB/Report.pm	2013-01-07 15:03:38 UTC (rev 5511)
@@ -231,11 +231,17 @@
     if (!defined $self->format){
         $self->format('html');
     }
+    my $name = $self->name;
+    $name =~ s/ /_/g;
+    $name = $name . '_' . $self->from_date->to_output if $self->{from_date};
+    $name = $name . '-' . $self->to_date->to_output if $self->{to_date};
+    $name = undef unless $request->{format};
     $template = LedgerSMB::Template->new(
         user => $LedgerSMB::App_State::User,
         locale => $LedgerSMB::App_State::Locale,
         path => 'UI',
         template => $template,
+        output_file => $name,
         format => uc($request->{format} || 'HTML'),
     );
     $template->render({report => $self, 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.