1 <% include("/elements/header.html","$action Agent Type", menubar(
2 'View all agent types' => "${p}browse/agent_type.cgi",
6 <% include('/elements/error.html') %>
8 <FORM ACTION="<% popurl(1) %>process/agent_type.cgi" METHOD=POST>
9 <INPUT TYPE="hidden" NAME="typenum" VALUE="<% $agent_type->typenum %>">
10 Agent Type #<% $agent_type->typenum || "(NEW)" %>
14 <INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="<% $agent_type->atype %>">
17 Select which packages agents of this type may sell to customers<BR>
18 <% ntable("#cccccc", 2) %><TR><TD>
19 <% include('/elements/checkboxes-table.html',
20 'source_obj' => $agent_type,
21 'link_table' => 'type_pkgs',
22 'target_table' => 'part_pkg',
23 'name_callback' => sub { $_[0]->pkg_comment(nopkgpart => 1); },
24 'target_link' => $p.'edit/part_pkg.cgi?',
32 <INPUT TYPE="submit" VALUE="<% $agent_type->typenum ? "Apply changes" : "Add agent type" %>">
36 <% include('/elements/footer.html') %>
41 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
44 if ( $cgi->param('error') ) {
45 $agent_type = new FS::agent_type ( {
46 map { $_, scalar($cgi->param($_)) } fields('agent')
48 } elsif ( $cgi->keywords ) { #editing
49 my( $query ) = $cgi->keywords;
51 $agent_type=qsearchs('agent_type',{'typenum'=>$1});
53 $agent_type = new FS::agent_type {};
55 my $action = $agent_type->typenum ? 'Edit' : 'Add';