summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authormark <mark>2011-10-25 01:14:34 +0000
committermark <mark>2011-10-25 01:14:34 +0000
commita4c7ef67a9ca3c473c48f7176865408e619933d0 (patch)
tree18420c02d57a8d3d289c3b7509dad435915d8574 /httemplate
parent6e930b7e992ad38cd700d5a365679904799ddb86 (diff)
custom_link interpolation, #14895
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/misc/custom_link_proxy.cgi9
1 files changed, 8 insertions, 1 deletions
diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi
index e5934e4a6..417fcebae 100644
--- a/httemplate/misc/custom_link_proxy.cgi
+++ b/httemplate/misc/custom_link_proxy.cgi
@@ -11,7 +11,14 @@ my $cust_main = qsearchs('cust_main', { custnum => $custnum } )
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;