[freeside-commits]
freeside/httemplate/edit svc_broadband.cgi, 1.11, 1.12
Ivan,,,
ivan at wavetail.420.am
Fri Dec 29 00:39:48 PST 2006
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv3446
Modified Files:
svc_broadband.cgi
Log Message:
svc broadband new arg parsing
Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_broadband.cgi,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- svc_broadband.cgi 23 Dec 2006 05:37:47 -0000 1.11
+++ svc_broadband.cgi 29 Dec 2006 08:39:46 -0000 1.12
@@ -10,6 +10,7 @@
%
%my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_broadband );
%if ( $cgi->param('error') ) {
+%
% $svc_broadband = new FS::svc_broadband ( {
% map { $_, scalar($cgi->param($_)) } fields('svc_broadband'), qw(svcpart)
% } );
@@ -18,38 +19,40 @@
% $svcpart = $svc_broadband->svcpart;
% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
% die "No part_svc entry!" unless $part_svc;
-%} else {
-% my($query) = $cgi->keywords;
-% if ( $query =~ /^(\d+)$/ ) { #editing
-% $svcnum=$1;
-% $svc_broadband=qsearchs('svc_broadband',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_broadband) svcnum!";
%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
+%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
+% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+% $pkgnum = $1;
+% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+% $svcpart = $1;
%
-% } else { #adding
+% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+% die "No part_svc entry!" unless $part_svc;
%
-% foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
-% $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_broadband = new FS::svc_broadband({ svcpart => $svcpart });
%
-% $svc_broadband = new FS::svc_broadband({ svcpart => $svcpart });
+% $svcnum='';
%
-% $svcnum='';
+% $svc_broadband->set_default_and_fixed;
%
-% $svc_broadband->set_default_and_fixed;
+%} else { #editing
+%
+% my($query) = $cgi->keywords;
+% $query =~ /^(\d+)$/ or die "unparsable svcnum";
+% $svcnum=$1;
+% $svc_broadband=qsearchs('svc_broadband',{'svcnum'=>$svcnum})
+% or die "Unknown (svc_broadband) 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 = $svc_broadband->svcnum ? 'Edit' : 'Add';
%
More information about the freeside-commits
mailing list