[freeside-commits] freeside/httemplate/view cust_bill-logo.cgi, 1.8, 1.9 REAL_logo.cgi, NONE, 1.1

Ivan,,, ivan at wavetail.420.am
Mon Feb 9 06:05:33 PST 2009


Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv17630/httemplate/view

Modified Files:
	cust_bill-logo.cgi 
Added Files:
	REAL_logo.cgi 
Log Message:
rest of per-agent config for company_name, company_address, logo, etc.. RT#3989

Index: cust_bill-logo.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_bill-logo.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_bill-logo.cgi	1 Aug 2007 22:26:49 -0000	1.8
+++ cust_bill-logo.cgi	9 Feb 2009 14:05:31 -0000	1.9
@@ -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 @@
 
 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 {

--- NEW FILE: REAL_logo.cgi ---
<% $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>



More information about the freeside-commits mailing list