From df185d34f354c5788e8c4693182b7689a3333839 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 14 May 2005 17:04:55 +0000 Subject: [PATCH] html invoices: when displaying, use the actual logo from the conf dir - same as the emailed copy --- FS/FS/Conf.pm | 15 +++++++++++++++ conf/invoice_html | 2 +- httemplate/view/cust_bill-logo.cgi | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 httemplate/view/cust_bill-logo.cgi diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 15ac23d53..ea2785bdf 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -95,6 +95,21 @@ sub config { } } +=item config_binary KEY + +Returns the exact scalar value for key. + +=cut + +sub config_binary { + my($self,$file)=@_; + my($dir)=$self->dir; + my $fh = new IO::File "<$dir/$file" or return; + local $/; + my $content = <$fh>; + $content; +} + =item exists KEY Returns true if the specified key exists, even if the corresponding value diff --git a/conf/invoice_html b/conf/invoice_html index 7b8a85bcc..e4e145e41 100644 --- a/conf/invoice_html +++ b/conf/invoice_html @@ -14,7 +14,7 @@ - +
">"> <%= $returnaddress %> diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi new file mode 100755 index 000000000..3e9c67fcc --- /dev/null +++ b/httemplate/view/cust_bill-logo.cgi @@ -0,0 +1,15 @@ +<% + +##untaint invnum +#my($query) = $cgi->keywords; +#$query =~ /^((.+)-)?(\d+)$/; +#my $templatename = $2; +#my $invnum = $3; + +my $templatename = ''; + +my $conf = new FS::Conf; +http_header('Content-Type' => 'image/png' ); + +http_header('Content-Type' => 'image/png' ); +%><%= $conf->config_binary("logo$templatename.png") %> -- 2.11.0