[freeside-commits] freeside/httemplate/misc custom_link_proxy.cgi, 1.1, 1.1.6.1

Mark Wells mark at wavetail.420.am
Mon Oct 24 18:15:16 PDT 2011


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

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	custom_link_proxy.cgi 
Log Message:
custom_link interpolation, #14895

Index: custom_link_proxy.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/custom_link_proxy.cgi,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- custom_link_proxy.cgi	3 Aug 2010 03:30:20 -0000	1.1
+++ custom_link_proxy.cgi	25 Oct 2011 01:15:14 -0000	1.1.6.1
@@ -11,7 +11,14 @@
   or die "custnum '$custnum' not found"; # just check for existence
 
 my $conf = new FS::Conf;
-my $url = $conf->config('cust_main-custom_link') . $cust_main->custnum;
+my $url = $conf->config('cust_main-custom_link');
+
+my $agentnum = $cust_main->agentnum;
+# like eval(qq("$url")) but with fewer things that can go wrong
+# and if $custnum isn't mentioned, assume it goes at the end
+$url =~ s/\$custnum/$custnum/ or $url .= $custnum;
+$url =~ s/\$agentnum/$agentnum/;
+
 #warn $url;
 
 my $curuser = $FS::CurrentUser::CurrentUser;



More information about the freeside-commits mailing list