blob: 94d29c40e9c9c6528857d983d5b9c93ca23eefa7 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#!/usr/bin/perl -Tw
#
# $Id: part_referral.cgi,v 1.2 1998-12-17 08:40:25 ivan Exp $
#
# ivan@sisd.com 98-feb-23
#
# Changes to allow page to work at a relative position in server
# bmccane@maxbaud.net 98-apr-3
#
# lose background, FS::CGI ivan@sisd.com 98-sep-2
#
# $Log: part_referral.cgi,v $
# Revision 1.2 1998-12-17 08:40:25 ivan
# s/CGI::Request/CGI.pm/; etc
#
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use FS::UID qw(cgisuidsetup);
use FS::Record qw(qsearchs);
use FS::part_referral qw(fields);
use FS::CGI qw(popurl eidiot);
my($cgi)=new CGI; # create form object
&cgisuidsetup($cgi);
my($refnum)=$cgi->param('refnum');
my($new)=create FS::part_referral ( {
map {
$_, scalar($cgi->param($_));
} fields('part_referral')
} );
if ( $refnum ) {
my($old)=qsearchs('part_referral',{'refnum'=>$refnum});
eidiot("(Old) Record not found!") unless $old;
my($error)=$new->replace($old);
eidiot($error) if $error;
} else {
my($error)=$new->insert;
eidiot($error) if $error;
}
$refnum=$new->getfield('refnum');
print $cgi->redirect(popurl(3). "browse/part_referral.cgi");
|