add usernum to cust_main-custom_link, RT#15475
authorivan <ivan>
Wed, 7 Dec 2011 04:49:20 +0000 (04:49 +0000)
committerivan <ivan>
Wed, 7 Dec 2011 04:49:20 +0000 (04:49 +0000)
FS/FS/Conf.pm
httemplate/misc/custom_link_proxy.cgi

index acaac75..3987fac 100644 (file)
@@ -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',
   },
 
index 417fceb..f3c6e37 100644 (file)
@@ -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');