From 9dafe1bcc38121281d62ffe2d48eba6b8fd748e7 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 7 Dec 2011 04:49:25 +0000 Subject: [PATCH] add usernum to cust_main-custom_link, RT#15475 --- FS/FS/Conf.pm | 2 +- httemplate/misc/custom_link_proxy.cgi | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index acaac7516..3987fac5a 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4490,7 +4490,7 @@ and customer address. Include units.', { 'key' => 'cust_main-custom_link', 'section' => 'UI', - 'description' => 'URL to use as source for the "Custom" tab in the View Customer page. The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere. "$agentnum" will be replaced with the agent number.', + 'description' => 'URL to use as source for the "Custom" tab in the View Customer page. The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere. "$agentnum" will be replaced with the agent number, and "$usernum" will be replaced with the employee number.', 'type' => 'textarea', }, diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi index 417fcebae..f3c6e376e 100644 --- a/httemplate/misc/custom_link_proxy.cgi +++ b/httemplate/misc/custom_link_proxy.cgi @@ -14,15 +14,16 @@ my $conf = new FS::Conf; my $url = $conf->config('cust_main-custom_link'); my $agentnum = $cust_main->agentnum; +my $curuser = $FS::CurrentUser::CurrentUser; +my $usernum = $curuser->usernum; # 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/; +$url =~ s/\$usernum/$usernum/; #warn $url; -my $curuser = $FS::CurrentUser::CurrentUser; - die "access denied" unless $curuser->access_right('View customer'); -- 2.11.0