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

SF.net SVN: ledger-smb:[6391] trunk/LedgerSMB



Revision: 6391
          http://sourceforge.net/p/ledger-smb/code/6391
Author:   einhverfr
Date:     2014-01-05 14:04:29 +0000 (Sun, 05 Jan 2014)
Log Message:
-----------
Printing from db templates not throwing errors but not producing output.

Modified Paths:
--------------
    trunk/LedgerSMB/Template/CSV.pm
    trunk/LedgerSMB/Template/HTML.pm
    trunk/LedgerSMB/Template/LaTeX.pm
    trunk/LedgerSMB/Template/ODS.pm
    trunk/LedgerSMB/Template/TXT.pm
    trunk/LedgerSMB/Template.pm
    trunk/LedgerSMB/User.pm

Modified: trunk/LedgerSMB/Template/CSV.pm
===================================================================
--- trunk/LedgerSMB/Template/CSV.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/Template/CSV.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -48,6 +48,7 @@
 use Error qw(:try);
 use Template;
 use LedgerSMB::Template::TTI18N;
+use LedgerSMB::Template::DB;
 
 my $binmode = ':utf8';
 binmode STDOUT, $binmode;

Modified: trunk/LedgerSMB/Template/HTML.pm
===================================================================
--- trunk/LedgerSMB/Template/HTML.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/Template/HTML.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -54,6 +54,7 @@
 use LedgerSMB::Company_Config;
 use LedgerSMB::App_State;
 use LedgerSMB::Company_Config;
+use LedgerSMB::Template::DB;
 
 my $binmode = ':utf8';
 binmode STDOUT, $binmode;

Modified: trunk/LedgerSMB/Template/LaTeX.pm
===================================================================
--- trunk/LedgerSMB/Template/LaTeX.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/Template/LaTeX.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -58,6 +58,7 @@
 use Template::Latex;
 use LedgerSMB::Template::TTI18N;
 use Log::Log4perl;
+use LedgerSMB::Template::DB;
 
 #my $binmode = ':utf8';
 my $binmode = ':raw';

Modified: trunk/LedgerSMB/Template/ODS.pm
===================================================================
--- trunk/LedgerSMB/Template/ODS.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/Template/ODS.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -56,6 +56,7 @@
 use OpenOffice::OODoc::Styles;
 use LedgerSMB::Template::TTI18N;
 use LedgerSMB::Sysconfig;
+use LedgerSMB::Template::DB;
 
 $OpenOffice::OODoc::File::WORKING_DIRECTORY = $LedgerSMB::Sysconfig::tempdir;
 

Modified: trunk/LedgerSMB/Template/TXT.pm
===================================================================
--- trunk/LedgerSMB/Template/TXT.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/Template/TXT.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -48,6 +48,7 @@
 use Template;
 use LedgerSMB::Template::TTI18N;
 use DateTime;
+use LedgerSMB::Template::DB;
 
 # The following are for EDI only
 my $dt = DateTime->now;

Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/Template.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -361,8 +361,7 @@
 		$self->output(%$vars);
                 $logger->debug("after self output,but does not seem to return here!");
 		if ($self->{rendered}) {
-			unlink($self->{rendered}) or
-				throw Error::Simple 'Unable to delete output file';
+			unlink($self->{rendered}); 
 		}
 	}
 	return $post;

Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm	2014-01-05 13:55:27 UTC (rev 6390)
+++ trunk/LedgerSMB/User.pm	2014-01-05 14:04:29 UTC (rev 6391)
@@ -188,9 +188,7 @@
     my $sth = $dbh->prepare($query);
     $sth->execute($lsmb->{login});
     $myconfig = $sth->fetchrow_hashref(NAME_lc);
-    $sth = $dbh->prepare("SELECT value FROM defaults WHERE setting_key = 'templates'");
-    $sth->execute();
-    ($templates) = $sth->fetchrow_array() || 'demo';
+    my ($templates) = 'DB';
     my %date_query = (
         'mm/dd/yy' => 'set DateStyle to \'SQL, US\'',
         'mm-dd-yy' => 'set DateStyle to \'POSTGRES, US\'',
@@ -200,7 +198,8 @@
     );
     $dbh->do( $date_query{ $myconfig{dateformat} } );
 
-    $myconfig->{templates} = "$LedgerSMB::Sysconfig::templates/$templates";
+    my ($templates) = 'DB';
+    $myconfig->{templates} = "DB";
     bless $myconfig, __PACKAGE__;
     return $myconfig;
 }

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits