[freeside-commits] branch master updated. ea877a775f49883683a26c01da366993804e840d

Ivan ivan at 420.am
Tue Feb 12 02:12:59 PST 2013


The branch, master has been updated
       via  ea877a775f49883683a26c01da366993804e840d (commit)
      from  130b7fb03bc8fcc6c6a1b29b36f65d53333ec05a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ea877a775f49883683a26c01da366993804e840d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Feb 12 02:12:56 2013 -0800

    HATE #17349

diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index 011ce24..2f5e476 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -3,7 +3,7 @@ package FS::msg_template;
 use strict;
 use base qw( FS::Record );
 use Text::Template;
-use FS::Misc qw( generate_email send_email );
+use FS::Misc qw( generate_email send_email do_print );
 use FS::Conf;
 use FS::Record qw( qsearch qsearchs );
 use FS::UID qw( dbh );
@@ -457,24 +457,13 @@ sub render {
   my %hash = $self->prepare(%opt);
   my $html = $hash{'html_body'};
 
-  my $tmp = 'msg'.$self->msgnum.'-'.time2str('%Y%m%d', time).'-XXXXXXXX';
-  my $dir = "$FS::UID::cache_dir/cache.$FS::UID::datasrc";
-
   # Graphics/stylesheets should probably go in /var/www on the Freeside 
   # machine.
   my $kit = PDF::WebKit->new(\$html); #%options
   # hack to use our wrapper script
   $kit->configure(sub { shift->wkhtmltopdf('freeside-wkhtmltopdf') });
-  my $fh = File::Temp->new(
-    TEMPLATE  => $tmp,
-    DIR       => $dir,
-    UNLINK    => 0,
-    SUFFIX    => '.pdf'
-  );
 
-  print $fh $kit->to_pdf;
-  close $fh;
-  return $fh->filename;
+  $kit->to_pdf;
 }
 
 =item print OPTIONS
@@ -485,12 +474,7 @@ Render a PDF and send it to the printer.  OPTIONS are as for 'render'.
 
 sub print {
   my( $self, %opt ) = @_;
-  my $file = $self->render(%opt);
-
-  my $lpr = $conf->config('lpr', $opt{'cust_main'}->agentnum );
-
-  run ( $lpr, '<', $file)
-    or die "lpr error:\n$?\n";
+  do_print( [ $self->render(%opt) ], agentnum=>$opt{cust_main}->agentnum );
 }
 
 # helper sub for package dates
diff --git a/FS/bin/freeside-wkhtmltopdf b/FS/bin/freeside-wkhtmltopdf
index c6c5531..f0c53e6 100755
--- a/FS/bin/freeside-wkhtmltopdf
+++ b/FS/bin/freeside-wkhtmltopdf
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-if [ $DISPLAY ] ; then
-  wkhtmltopdf $@
-else
+#if [ $DISPLAY ] ; then
+#  wkhtmltopdf $@
+#else
   xvfb-run -- wkhtmltopdf $@
-fi
+#fi

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/msg_template.pm       |   22 +++-------------------
 FS/bin/freeside-wkhtmltopdf |    8 ++++----
 2 files changed, 7 insertions(+), 23 deletions(-)




More information about the freeside-commits mailing list