[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6840] trunk/LedgerSMB/Template
- Subject: SF.net SVN: ledger-smb:[6840] trunk/LedgerSMB/Template
- From: ..hidden..
- Date: Tue, 11 Feb 2014 08:25:49 +0000
Revision: 6840
http://sourceforge.net/p/ledger-smb/code/6840
Author: einhverfr
Date: 2014-02-11 08:25:48 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
Fixes for db templates to allow a LETTERHEAD directive to pull in letterhead.ext from db
Modified Paths:
--------------
trunk/LedgerSMB/Template/CSV.pm
trunk/LedgerSMB/Template/DB.pm
trunk/LedgerSMB/Template/HTML.pm
trunk/LedgerSMB/Template/LaTeX.pm
trunk/LedgerSMB/Template/TXT.pm
Modified: trunk/LedgerSMB/Template/CSV.pm
===================================================================
--- trunk/LedgerSMB/Template/CSV.pm 2014-02-11 08:13:25 UTC (rev 6839)
+++ trunk/LedgerSMB/Template/CSV.pm 2014-02-11 08:25:48 UTC (rev 6840)
@@ -107,7 +107,11 @@
$parent->{binmode} = $binmode;
if ($parent->{outputfile}) {
+ if (ref $parent->{outputfile}){
+ $output = $parent->{outputfile};
+ } else {
$output = "$parent->{outputfile}.csv";
+ }
} else {
$output = \$parent->{output};
}
Modified: trunk/LedgerSMB/Template/DB.pm
===================================================================
--- trunk/LedgerSMB/Template/DB.pm 2014-02-11 08:13:25 UTC (rev 6839)
+++ trunk/LedgerSMB/Template/DB.pm 2014-02-11 08:25:48 UTC (rev 6840)
@@ -67,7 +67,7 @@
);
$temp = __PACKAGE__->new($temp);
my $text = $temp->template;
- die text('Could Not Load Template from DB');
+ die text('Could Not Load Template from DB') unless $text;
return \$text;
}
Modified: trunk/LedgerSMB/Template/HTML.pm
===================================================================
--- trunk/LedgerSMB/Template/HTML.pm 2014-02-11 08:13:25 UTC (rev 6839)
+++ trunk/LedgerSMB/Template/HTML.pm 2014-02-11 08:25:48 UTC (rev 6840)
@@ -124,7 +124,11 @@
$cleanvars->{UNESCAPE} = sub { return unescapeHTML(shift @_) };
if ($parent->{outputfile}) {
+ if (ref $parent->{outputfile}){
+ $output = $parent->{outputfile};
+ } else {
$output = "$parent->{outputfile}.html";
+ }
} else {
$output = \$parent->{output};
}
Modified: trunk/LedgerSMB/Template/LaTeX.pm
===================================================================
--- trunk/LedgerSMB/Template/LaTeX.pm 2014-02-11 08:13:25 UTC (rev 6839)
+++ trunk/LedgerSMB/Template/LaTeX.pm 2014-02-11 08:25:48 UTC (rev 6840)
@@ -163,11 +163,13 @@
DEBUG => ($parent->{debug})? 'dirs': undef,
DEBUG_FORMAT => '',
}) || die Template::Latex->error();
+ my $out = "$parent->{outputfile}.$format" unless ref $parent->{outputfile};
+ $out ||= $parent->{outputfile};
if (not $template->process(
$source,
{%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs,
'escape' => \&preprocess},
- "$parent->{outputfile}.$format", {binmode => 1})) {
+ $out, {binmode => 1})) {
die $template->error();
}
if (lc $format eq 'dvi') {
Modified: trunk/LedgerSMB/Template/TXT.pm
===================================================================
--- trunk/LedgerSMB/Template/TXT.pm 2014-02-11 08:13:25 UTC (rev 6839)
+++ trunk/LedgerSMB/Template/TXT.pm 2014-02-11 08:25:48 UTC (rev 6840)
@@ -116,8 +116,12 @@
my $output;
$parent->{binmode} = $binmode;
if ($parent->{outputfile}) {
+ if (ref $parent->{outputfile}){
+ $output = $parent->{outputfile};
+ } else {
$output = "$parent->{outputfile}.". get_extension($parent);
$parent->{outputfile} = $output;
+ }
}
if ($parent->{include_path} eq 'DB'){
$source = LedgerSMB::Template::DB->get_template(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits