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 $agent_custid = $cust_main->agent_custid;
18 my $curuser = $FS::CurrentUser::CurrentUser;
19 my $usernum = $curuser->usernum;
20 # like eval(qq("$url")) but with fewer things that can go wrong
21 # and if $custnum isn't mentioned, assume it goes at the end
22 $url =~ s/\$custnum/$custnum/ or $url .= $custnum;
23 $url =~ s/\$agentnum/$agentnum/;
24 $url =~ s/\$agent_custid/$agent_custid/;
25 $url =~ s/\$usernum/$usernum/;
30 unless $curuser->access_right('View customer');
32 my $ua = new LWP::UserAgent;
33 my $response = $ua->get($url);