% include("/elements/header.html","$action Agent", menubar( 'View all agents' => $p. 'browse/agent.cgi', )) %> <% include('/elements/error.html') %>
<% include('/elements/footer.html') %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my $agent; if ( $cgi->param('error') ) { $agent = new FS::agent ( { map { $_, scalar($cgi->param($_)) } fields('agent') } ); } elsif ( $cgi->keywords ) { my($query) = $cgi->keywords; $query =~ /^(\d+)$/; $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); } else { #adding $agent = new FS::agent {}; } my $action = $agent->agentnum ? 'Edit' : 'Add'; my $conf = new FS::Conf; %init>