2 % $cgi->param('error', $error);
3 <% $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ) %>
5 <% $cgi->redirect(popurl(3). "browse/agent_type.cgi") %>
10 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
12 my $typenum = $cgi->param('typenum');
13 my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum;
15 my $new = new FS::agent_type ( {
17 $_, scalar($cgi->param($_));
18 } fields('agent_type')
23 $error = $new->replace($old);
25 $error = $new->insert;
26 $typenum = $new->getfield('typenum');
29 $error ||= $new->process_m2m(
30 'link_table' => 'type_pkgs',
31 'target_table' => 'part_pkg',
32 'params' => scalar($cgi->Vars)