html invoices: when displaying, use the actual logo from the conf dir - same as the...
authorivan <ivan>
Sat, 14 May 2005 17:04:55 +0000 (17:04 +0000)
committerivan <ivan>
Sat, 14 May 2005 17:04:55 +0000 (17:04 +0000)
FS/FS/Conf.pm
conf/invoice_html
httemplate/view/cust_bill-logo.cgi [new file with mode: 0755]

index 15ac23d..ea2785b 100644 (file)
@@ -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
 =item exists KEY
 
 Returns true if the specified key exists, even if the corresponding value
index 7b8a85b..e4e145e 100644 (file)
@@ -14,7 +14,7 @@
 
   <table class="invoice_header" width="100%">
     <tr>
 
   <table class="invoice_header" width="100%">
     <tr>
-     <td><img src="<%= $cid ? "cid:$cid" : '../images/small-logo.png' %>"></td>
+     <td><img src="<%= $cid ? "cid:$cid" : 'cust_bill-logo.cgi' %>"></td>
      <td align="left"><%= $returnaddress %></td>
       <td align="right">
         <table CLASS="invoice_headerright" cellspacing=0>
      <td align="left"><%= $returnaddress %></td>
       <td align="right">
         <table CLASS="invoice_headerright" cellspacing=0>
diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi
new file mode 100755 (executable)
index 0000000..3e9c67f
--- /dev/null
@@ -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") %>