From a4b8ce8cd1d309de00c64f38049a8dda38798046 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 9 Feb 2009 14:05:31 +0000 Subject: rest of per-agent config for company_name, company_address, logo, etc.. RT#3989 --- httemplate/view/REAL_logo.cgi | 14 ++++++++++++++ httemplate/view/cust_bill-logo.cgi | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100755 httemplate/view/REAL_logo.cgi (limited to 'httemplate/view') 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' ); + + 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 { -- cgit v1.2.1