diff options
author | ivan <ivan> | 2009-02-09 14:05:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-02-09 14:05:31 +0000 |
commit | a4b8ce8cd1d309de00c64f38049a8dda38798046 (patch) | |
tree | 8c36c37a563900083468912ebeb373da39c59cca /httemplate/view/cust_bill-logo.cgi | |
parent | 9925a640ebd475bf260b4d9e065b3f01e929e20a (diff) |
rest of per-agent config for company_name, company_address, logo, etc.. RT#3989
Diffstat (limited to 'httemplate/view/cust_bill-logo.cgi')
-rwxr-xr-x | httemplate/view/cust_bill-logo.cgi | 18 |
1 files changed, 14 insertions, 4 deletions
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 { |