blob: 5128d7ae8ce4f370a13cc8bca4a67e070f7bddc5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
%
%
%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");
%}
%
%
|