[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.53.2.22, 1.53.2.23

Ivan,,, ivan at wavetail.420.am
Mon Jul 13 02:19:05 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv2262/FS/FS/ClientAPI

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	MyAccount.pm 
Log Message:
fix self-service agent-specific logos

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.53.2.22
retrieving revision 1.53.2.23
diff -u -d -r1.53.2.22 -r1.53.2.23
--- MyAccount.pm	2 Jul 2009 01:30:08 -0000	1.53.2.22
+++ MyAccount.pm	13 Jul 2009 09:19:03 -0000	1.53.2.23
@@ -555,7 +555,14 @@
   #sessioning for this?  how do we get the session id to the backend invoice
   # template so it can add it to the link, blah
 
-  my $templatename = $p->{'templatename'};
+  my $agentnum = '';
+  if ( $p->{'invnum'} ) {
+    my $cust_bill = qsearchs('cust_bill', { 'invnum' => $p->{'invnum'} } )
+      or return { 'error' => 'unknown invnum' };
+    $agentnum = $cust_bill->cust_main->agentnum;
+  }
+
+  my $templatename = $p->{'template'} || $p->{'templatename'};
 
   #false laziness-ish w/view/cust_bill-logo.cgi
 
@@ -569,7 +576,7 @@
   my $filename = "logo$templatename.png";
 
   return { 'error'        => '',
-           'logo'         => $conf->config_binary($filename),
+           'logo'         => $conf->config_binary($filename, $agentnum),
            'content_type' => 'image/png', #should allow gif, jpg too
          };
 }



More information about the freeside-commits mailing list