1 % if( $response->is_success ) {
2 <% $response->decoded_content %>
5 <% $response->error_as_HTML %>
9 my( $custnum ) = $cgi->param('custnum');
10 my $cust_main = qsearchs('cust_main', { custnum => $custnum } )
11 or die "custnum '$custnum' not found"; # just check for existence
13 my $conf = new FS::Conf;
14 my $url = $conf->config('cust_main-custom_link');
16 my $agentnum = $cust_main->agentnum;
17 my $curuser = $FS::CurrentUser::CurrentUser;
18 my $usernum = $curuser->usernum;
19 # like eval(qq("$url")) but with fewer things that can go wrong
20 # and if $custnum isn't mentioned, assume it goes at the end
21 $url =~ s/\$custnum/$custnum/ or $url .= $custnum;
22 $url =~ s/\$agentnum/$agentnum/;
23 $url =~ s/\$usernum/$usernum/;
28 unless $curuser->access_right('View customer');
30 my $ua = new LWP::UserAgent;
31 my $response = $ua->get($url);