[wiaflos-devel] COMMIT - r225 - trunk/wiaflos/server

svn at linuxrulz.org svn at linuxrulz.org
Tue Aug 12 13:47:08 GMT 2008


Author: nkukard
Date: 2008-08-12 13:47:08 +0000 (Tue, 12 Aug 2008)
New Revision: 225

Modified:
   trunk/wiaflos/server/Invoicing.pm
   trunk/wiaflos/server/Receipting.pm
   trunk/wiaflos/server/Statements.pm
   trunk/wiaflos/server/SupplierReceipting.pm
   trunk/wiaflos/server/templating.pm
Log:
* Fixed templating


Modified: trunk/wiaflos/server/Invoicing.pm
===================================================================
--- trunk/wiaflos/server/Invoicing.pm	2008-08-10 17:20:42 UTC (rev 224)
+++ trunk/wiaflos/server/Invoicing.pm	2008-08-12 13:47:08 UTC (rev 225)
@@ -1252,8 +1252,8 @@
 				'InvoiceSignatureFilename' => $invSignFilename,
 			};
 			# Load template
-			$emailBody = loadTemplate($vars2,$message_template,$emailBody);
-			if (!$emailBody) {
+			my $res = loadTemplate($message_template,$vars2,\$emailBody);
+			if (!$res) {
 				setError("Failed to load template '$message_template': ".wiaflos::server::templating::Error());
 				return ERR_SRVTEMPLATE;	
 			}
@@ -1263,8 +1263,8 @@
 		
 		# Load template
 		my $invoiceData = "";
-		$invoiceData = loadTemplate($template,$vars,$invoiceData);
-		if (!$invoiceData) {
+		my $res = loadTemplate($template,$vars,\$invoiceData);
+		if (!$res) {
 			setError("Failed to load template '$template': ".wiaflos::server::templating::Error());
 			return ERR_SRVTEMPLATE;	
 		}

Modified: trunk/wiaflos/server/Receipting.pm
===================================================================
--- trunk/wiaflos/server/Receipting.pm	2008-08-10 17:20:42 UTC (rev 224)
+++ trunk/wiaflos/server/Receipting.pm	2008-08-12 13:47:08 UTC (rev 225)
@@ -1273,8 +1273,8 @@
 				'ReceiptSignatureFilename' => $rctSignFilename,
 			};
 			# Load template
-			$emailBody = loadTemplate($vars2,$message_template,$emailBody);
-			if (!$emailBody) {
+			my $res = loadTemplate($message_template,$vars2,\$emailBody);
+			if (!$res) {
 				setError("Failed to load template '$message_template': ".wiaflos::server::templating::Error());
 				return ERR_SRVTEMPLATE;	
 			}
@@ -1284,8 +1284,8 @@
 
 		# Load template
 		my $receiptData = "";
-		$receiptData = loadTemplate($template,$vars,$receiptData);
-		if (!$receiptData) {
+		my $res = loadTemplate($template,$vars,\$receiptData);
+		if (!$res) {
 			setError("Failed to load template '$template': ".wiaflos::server::templating::Error());
 			return ERR_SRVTEMPLATE;	
 		}
@@ -1348,7 +1348,8 @@
 
 		# Send email
 		my @SMTPParams;
-		if (!(my $res = $msg->send("smtp",$server))) {
+		$res = $msg->send("smtp",$server);
+		if (!$res) {
 			setError("Failed to send receipt via email server '$server'");
 			return ERR_SRVEXEC; 
 		}

Modified: trunk/wiaflos/server/Statements.pm
===================================================================
--- trunk/wiaflos/server/Statements.pm	2008-08-10 17:20:42 UTC (rev 224)
+++ trunk/wiaflos/server/Statements.pm	2008-08-12 13:47:08 UTC (rev 225)
@@ -318,8 +318,8 @@
 				'StatementSignatureFilename' => $stmtSignFilename,
 			};
 			# Load template
-			$emailBody = loadTemplate($vars2,$message_template,$emailBody);
-			if (!$emailBody) {
+			my $res = loadTemplate($message_template,$vars2,\$emailBody);
+			if (!$res) {
 				setError("Failed to load template '$message_template': ".wiaflos::server::templating::Error());
 				return ERR_SRVTEMPLATE;	
 			}
@@ -329,8 +329,8 @@
 
 		# This is our entire statement
 		my $statementData = "";
-		$statementData = loadTemplate($template,$vars,$statementData);
-		if (!$statementData) {
+		my $res = loadTemplate($template,$vars,\$statementData);
+		if (!$res) {
 			setError("Failed to load template '$template': ".wiaflos::server::templating::Error());
 			return ERR_SRVTEMPLATE;	
 		}

Modified: trunk/wiaflos/server/SupplierReceipting.pm
===================================================================
--- trunk/wiaflos/server/SupplierReceipting.pm	2008-08-10 17:20:42 UTC (rev 224)
+++ trunk/wiaflos/server/SupplierReceipting.pm	2008-08-12 13:47:08 UTC (rev 225)
@@ -1098,8 +1098,8 @@
 				'ReceiptSignatureFilename' => $rctSignFilename,
 			};
 			# Load template
-			$emailBody = loadTemplate($vars2,$message_template,$emailBody);
-			if (!$emailBody) {
+			my $res = loadTemplate($message_template,$vars2,\$emailBody);
+			if (!$res) {
 				setError("Failed to load template '$message_template': ".wiaflos::server::templating::Error());
 				return ERR_SRVTEMPLATE;	
 			}
@@ -1110,8 +1110,8 @@
 
 		# Load template
 		my $receiptData = "";
-		$receiptData = loadTemplate($template,$vars,$receiptData);
-		if (!$receiptData) {
+		my $res = loadTemplate($template,$vars,\$receiptData);
+		if (!$res) {
 			setError("Failed to load template '$template': ".wiaflos::server::templating::Error());
 			return ERR_SRVTEMPLATE;	
 		}

Modified: trunk/wiaflos/server/templating.pm
===================================================================
--- trunk/wiaflos/server/templating.pm	2008-08-10 17:20:42 UTC (rev 224)
+++ trunk/wiaflos/server/templating.pm	2008-08-12 13:47:08 UTC (rev 225)
@@ -107,6 +107,7 @@
 
 	# Process
 	my $res = $template->process($templateName,$params,$output);
+use Data::Dumper;		print(STDERR "($res) $templateName => ".Dumper($params)." => $output");
 	if (!$res) {
 		setError($template->error());
 		return undef;



More information about the wiaflos-devel mailing list