X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fcust_bill-logo.cgi;h=253f853f87b45a78ce5d0902d372b2af937ae39d;hp=bf82a87e88a1b0083d45cd3bc509267f201cfbb9;hb=HEAD;hpb=b58e61ac7df612f606c3e68371265e790e0be585 diff --git a/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi b/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi old mode 100644 new mode 100755 index bf82a87e8..253f853f8 --- a/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi +++ b/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi @@ -1,18 +1,25 @@ +#!/usr/bin/perl -T #!/usr/bin/perl -Tw use strict; use CGI; use FS::SelfService qw( invoice_logo ); -$cgi = new CGI; +my $cgi = new CGI; -my($query) = $cgi->keywords; -$query =~ /^([^\.\/]*)$/ or '' =~ /^()$/; -my $templatename = $1; -invoice_logo($templatename); +my %hash = (); +if ( $cgi->param('invnum') ) { + $hash{$_} = scalar($cgi->param($_)) foreach qw( invnum template ); +} else { + my($query) = $cgi->keywords; + $query =~ /^([^\.\/]*)$/ or '' =~ /^()$/; + $hash{'template'} = $1; +} -print $cgi->header( '-type' => $content_type, +my $hashref = invoice_logo(%hash); + +print $cgi->header( '-type' => $hashref->{'content_type'}, '-expires' => 'now', ). - $logo; + $hashref->{'logo'};