diff options
Diffstat (limited to 'httemplate/edit/process/agent.cgi')
-rwxr-xr-x | httemplate/edit/process/agent.cgi | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi new file mode 100755 index 000000000..182eeab41 --- /dev/null +++ b/httemplate/edit/process/agent.cgi @@ -0,0 +1,28 @@ +<% + +my $agentnum = $cgi->param('agentnum'); + +my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; + +my $new = new FS::agent ( { + map { + $_, scalar($cgi->param($_)); + } fields('agent') +} ); + +my $error; +if ( $agentnum ) { + $error=$new->replace($old); +} else { + $error=$new->insert; + $agentnum=$new->getfield('agentnum'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/agent.cgi"); +} + +%> |