diff options
author | ivan <ivan> | 2006-12-29 08:51:34 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-12-29 08:51:34 +0000 |
commit | 633c48448d9468690b7ad77eb6ff7c660a286658 (patch) | |
tree | 4e08051f8d805e7e95c8dffe5e3e73b0c360f965 /httemplate/edit/svc_domain.cgi | |
parent | 6cb5c702b17b98be46adea4539e15d5f312e5be1 (diff) |
service refactor!
Diffstat (limited to 'httemplate/edit/svc_domain.cgi')
-rwxr-xr-x | httemplate/edit/svc_domain.cgi | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi index 19e0e1285..5ec074bda 100755 --- a/httemplate/edit/svc_domain.cgi +++ b/httemplate/edit/svc_domain.cgi @@ -1,8 +1,7 @@ -% -% %my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc, % $svc_domain); %if ( $cgi->param('error') ) { +% % $svc_domain = new FS::svc_domain ( { % map { $_, scalar($cgi->param($_)) } fields('svc_domain') % } ); @@ -13,40 +12,41 @@ % $purpose = $cgi->param('purpose'); % $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } ); % die "No part_svc entry!" unless $part_svc; -%} else { -% $kludge_action = ''; -% $purpose = ''; -% my($query) = $cgi->keywords; -% if ( $query =~ /^(\d+)$/ ) { #editing -% $svcnum=$1; -% $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) -% or die "Unknown (svc_domain) svcnum!"; % -% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) -% or die "Unknown (cust_svc) svcnum!"; +%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding +% +% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum'; +% $pkgnum = $1; +% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart'; +% $svcpart = $1; % -% $pkgnum=$cust_svc->pkgnum; -% $svcpart=$cust_svc->svcpart; +% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); +% die "No part_svc entry!" unless $part_svc; % -% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); -% die "No part_svc entry!" unless $part_svc; +% $svc_domain = new FS::svc_domain({}); % -% } else { #adding +% $svcnum=''; % -% $svc_domain = new FS::svc_domain({}); -% -% foreach $_ (split(/-/,$query)) { -% $pkgnum=$1 if /^pkgnum(\d+)$/; -% $svcpart=$1 if /^svcpart(\d+)$/; -% } -% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); -% die "No part_svc entry!" unless $part_svc; +% $svc_domain->set_default_and_fixed; % -% $svcnum=''; +%} else { #editing % -% $svc_domain->set_default_and_fixed; +% $kludge_action = ''; +% $purpose = ''; +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/ or die "unparsable svcnum"; +% $svcnum=$1; +% $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) +% or die "Unknown (svc_domain) svcnum!"; % -% } +% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) +% or die "Unknown (cust_svc) svcnum!"; +% +% $pkgnum=$cust_svc->pkgnum; +% $svcpart=$cust_svc->svcpart; +% +% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); +% die "No part_svc entry!" unless $part_svc; % %} %my $action = $svcnum ? 'Edit' : 'Add'; |