X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fagent_type.cgi;h=ad5963b31365a656b4490f7f15ea4110012d3c11;hb=41d0660124cf3965a4a2b4706d02e382ac4cbf01;hp=fd8ca88334216ffc96e6f9ba4ec7af313cccea1d;hpb=2c757d7db4cb6a7b9655de13206fcc84fb7ce61f;p=freeside.git diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi index fd8ca8833..ad5963b31 100755 --- a/httemplate/edit/process/agent_type.cgi +++ b/httemplate/edit/process/agent_type.cgi @@ -1,4 +1,13 @@ -<% +%if ( $error ) { +% $cgi->param('error', $error); +<% $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ) %> +%} else { +<% $cgi->redirect(popurl(3). "browse/agent_type.cgi") %> +%} +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my $typenum = $cgi->param('typenum'); my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; @@ -16,21 +25,11 @@ if ( $typenum ) { $error = $new->insert; $typenum = $new->getfield('typenum'); } -#$error ||= $new->process_m2m( ); - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); -} else { - my $error = $new->process_m2m( + $error ||= $new->process_m2m( 'link_table' => 'type_pkgs', 'target_table' => 'part_pkg', 'params' => scalar($cgi->Vars) ); - die $error if $error; - - print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); -} -%> +