blob: e22cbb2014bfa1dd546fe52c3c846a378cf52757 (
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
|
%if ( $error ) {
% errorpage($error);
%} else {
% my $svcdb = $new->part_svc->svcdb;
<% $cgi->redirect(popurl(3). "view/$svcdb.cgi?$svcnum") %>
%}
<%init>
die 'access deined'
unless $FS::CurrentUser::CurrentUser->access_right('Change customer service');
my $svcnum = $cgi->param('svcnum');
my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}) if $svcnum;
my $new = new FS::cust_svc ( {
map {
$_, scalar($cgi->param($_));
} fields('cust_svc')
} );
my $error;
if ( $svcnum ) {
$error=$new->replace($old);
} else {
$error=$new->insert;
$svcnum=$new->getfield('svcnum');
}
</%init>
|