diff options
Diffstat (limited to 'httemplate/view')
| -rwxr-xr-x | httemplate/view/REAL_logo.cgi | 14 | ||||
| -rwxr-xr-x | httemplate/view/cust_bill-logo.cgi | 18 |
2 files changed, 28 insertions, 4 deletions
diff --git a/httemplate/view/REAL_logo.cgi b/httemplate/view/REAL_logo.cgi new file mode 100755 index 000000000..c269c7d04 --- /dev/null +++ b/httemplate/view/REAL_logo.cgi @@ -0,0 +1,14 @@ +<% $conf->config_binary("logo.png", $agentnum) %> +<%init> + +my $conf = new FS::Conf; + +my $agentnum = ''; +my @agentnums = $FS::CurrentUser::CurrentUser->agentnums; +if ( scalar(@agentnums) == 1 ) { + $agentnum = $agentnums[0]; +} + +http_header('Content-Type' => 'image/png' ); + +</%init> diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi index 9c1c1d71d..09ac9a717 100755 --- a/httemplate/view/cust_bill-logo.cgi +++ b/httemplate/view/cust_bill-logo.cgi @@ -1,4 +1,4 @@ -<% $conf->config_binary("logo$templatename.png") %> +<% $conf->config_binary("logo$templatename.png", $agentnum) %> <%init> die "access denied" @@ -7,9 +7,19 @@ die "access denied" my $conf = new FS::Conf; -my($query) = $cgi->keywords; -$query =~ /^([^\.\/]*)$/; -my $templatename = $1; +my $templatename; +my $agentnum = ''; +if ( $cgi->param('invnum') ) { + $templatename = $cgi->param('templatename'); + my $cust_bill = qsearchs('cust_bill', { 'invnum' => $cgi->param('invnum') } ) + or die 'unknown invnum'; + $agentnum = $cust_bill->cust_main->agentnum; +} else { + my($query) = $cgi->keywords; + $query =~ /^([^\.\/]*)$/ or die 'illegal query'; + $templatename = $1; +} + if ( $templatename && $conf->exists("logo_$templatename.png") ) { $templatename = "_$templatename"; } else { |
