freeside/httemplate/misc email-invoice.cgi,1.3,1.4 fax-invoice.cgi,1.1,1.2 print-invoice.cgi,1.7,1.8

ivan ivan at pouncequick.420.am
Thu May 19 01:43:30 PDT 2005


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory pouncequick:/tmp/cvs-serv27849/httemplate/misc

Modified Files:
	email-invoice.cgi fax-invoice.cgi print-invoice.cgi 
Log Message:
re-email/fax/print links should respect template, also add direct re-send links like the view links and convert view/cust_bill.cgi to proper template

Index: print-invoice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/print-invoice.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- print-invoice.cgi	12 Feb 2004 06:31:37 -0000	1.7
+++ print-invoice.cgi	19 May 2005 08:43:27 -0000	1.8
@@ -5,17 +5,18 @@
 
 #untaint invnum
 my($query) = $cgi->keywords;
-$query =~ /^(\d*)$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)$/;
+my $template = $2;
+my $invnum = $3;
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Can't find invoice!\n" unless $cust_bill;
 
         open(LPR,"|$lpr") or die "Can't open $lpr: $!";
 
         if ( $conf->exists('invoice_latex') ) {
-          print LPR $cust_bill->print_ps; #( date )
+          print LPR $cust_bill->print_ps('', $template); #( date )
         } else {
-          print LPR $cust_bill->print_text; #( date )
+          print LPR $cust_bill->print_text('', $template); #( date )
         }
 
         close LPR

Index: email-invoice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/email-invoice.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- email-invoice.cgi	17 Mar 2005 21:41:36 -0000	1.3
+++ email-invoice.cgi	19 May 2005 08:43:27 -0000	1.4
@@ -4,14 +4,17 @@
 
 #untaint invnum
 my($query) = $cgi->keywords;
-$query =~ /^(\d*)$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)$/;
+my $template = $2;
+my $invnum = $3;
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Can't find invoice!\n" unless $cust_bill;
 
 my $error = send_email(
   $cust_bill->generate_email(
-    'from'  => $cust_bill->_agent_invoice_from || $conf->config('invoice_from'),
+    'from'     => 
+      ( $cust_bill->_agent_invoice_from || $conf->config('invoice_from') ),
+    'template' => $template,
   )
 );
 eidiot($error) if $error;

Index: fax-invoice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/fax-invoice.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fax-invoice.cgi	21 Mar 2005 22:13:39 -0000	1.1
+++ fax-invoice.cgi	19 May 2005 08:43:27 -0000	1.2
@@ -5,15 +5,15 @@
 
 #untaint invnum
 my($query) = $cgi->keywords;
-$query =~ /^(\d*)$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)$/;
+my $template = $2;
+my $invnum = $3;
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Can't find invoice!\n" unless $cust_bill;
 
-
 my $error = &FS::Misc::send_fax(
   dialstring => $cust_bill->cust_main->getfield('fax'),
-  docdata       => [ $cust_bill->print_ps ],
+  docdata       => [ $cust_bill->print_ps('', $template) ],
 );
 
 die $error if $error;




More information about the freeside-commits mailing list