service refactor!
[freeside.git] / httemplate / edit / elements / svc_Common.html
index da59cc9..1fd66c2 100644 (file)
@@ -1,19 +1,21 @@
 %
-%
 %  my %opt = @_;
 %
 %  #my( $svcnum, $pkgnum, $svcpart, $part_svc );
 %  my( $pkgnum, $svcpart, $part_svc );
 %
 %  #get & untaint pkgnum & svcpart
-%  my($query) = $cgi->keywords; #they're not proper cgi params
-%  if ( $query =~ /^pkgnum(\d+)-svcpart(\d+)$/ ) {
-%    $pkgnum  = $1;
-%    $svcpart = $2;
-%    $cgi->delete_all(); #so the standard edit.html treats this correctly as new
+%  if ( ! $cgi->param('error')
+%       && $cgi->param('pkgnum') && $cgi->param('svcpart')
+%     )
+%  {
+%    $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+%    $pkgnum = $1;
+%    $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+%    $svcpart = $1;
+%    $cgi->delete_all(); #so edit.html treats this correctly as new??
 %  }
 %
-%
 <% include( 'edit.html',
 
                  'menubar' => [],