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

Mark Wells mark at wavetail.420.am
Mon Oct 24 18:14:36 PDT 2011


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

Modified Files:
	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.2
diff -u -w -d -r1.1 -r1.2
--- custom_link_proxy.cgi	3 Aug 2010 03:30:20 -0000	1.1
+++ custom_link_proxy.cgi	25 Oct 2011 01:14:34 -0000	1.2
@@ -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