From 23186f0338ec248d930c85db08cc997bca42525b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 22 May 2002 18:44:01 +0000 Subject: bind export, editing zones, deleting unaudited domains, mmm --- httemplate/edit/process/domain_record.cgi | 31 +++++++++++++++++++++++++++++++ httemplate/misc/cancel-unaudited.cgi | 11 +++++++---- httemplate/misc/delete-domain_record.cgi | 15 +++++++++++++++ httemplate/misc/delete-part_export.cgi | 2 +- httemplate/view/svc_domain.cgi | 31 +++++++++++++++++++++++++------ 5 files changed, 79 insertions(+), 11 deletions(-) create mode 100755 httemplate/edit/process/domain_record.cgi create mode 100755 httemplate/misc/delete-domain_record.cgi (limited to 'httemplate') diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi new file mode 100755 index 000000000..8fb0368f6 --- /dev/null +++ b/httemplate/edit/process/domain_record.cgi @@ -0,0 +1,31 @@ +<% + +my $recnum = $cgi->param('recnum'); + +my $old = qsearchs('agent',{'recnum'=>$recnum}) if $recnum; + +my $new = new FS::domain_record ( { + map { + $_, scalar($cgi->param($_)); + } fields('domain_record') +} ); + +my $error; +if ( $recnum ) { + $error=$new->replace($old); +} else { + $error=$new->insert; + $recnum=$new->getfield('recnum'); +} + +if ( $error ) { +# $cgi->param('error', $error); +# print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); + #no edit screen to send them back to + eidiot($error); +} else { + my $svcnum = $new->svcnum; + print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); +} + +%> diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi index ecfaef29f..f1fb15341 100755 --- a/httemplate/misc/cancel-unaudited.cgi +++ b/httemplate/misc/cancel-unaudited.cgi @@ -7,15 +7,18 @@ my($query) = $cgi->keywords; $query =~ /^(\d+)$/; my $svcnum = $1; -my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -die "Unknown svcnum!" unless $svc_acct; +#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); +#die "Unknown svcnum!" unless $svc_acct; my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); +die "Unknown svcnum!" unless $cust_svc; &eidiot(qq!This account has already been audited. Cancel the package instead.!) if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0'; +my $svc_x = $cust_svc->svc_x; + local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; local $SIG{QUIT} = 'IGNORE'; @@ -24,8 +27,8 @@ local $SIG{TSTP} = 'IGNORE'; local $FS::UID::AutoCommit = 0; -my $error = $svc_acct->cancel; -$error ||= $svc_acct->delete; +my $error = $svc_x->cancel; +$error ||= $svc_x->delete; $error ||= $cust_svc->delete; if ( $error ) { diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi new file mode 100755 index 000000000..dcc2d5022 --- /dev/null +++ b/httemplate/misc/delete-domain_record.cgi @@ -0,0 +1,15 @@ +<% + +#untaint recnum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal recnum"; +my $recnum = $1; + +my $domain_record = qsearchs('domain_record',{'recnum'=>$recnum}); + +my $error = $domain_record->delete; +eidiot($error) if $error; + +print $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum); + +%> diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi index 34ef06b96..7c4ab8b9d 100755 --- a/httemplate/misc/delete-part_export.cgi +++ b/httemplate/misc/delete-part_export.cgi @@ -1,6 +1,6 @@ <% -#untaint paynum +#untaint exportnum my($query) = $cgi->keywords; $query =~ /^(\d+)$/ || die "Illegal exportnum"; my $exportnum = $1; diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index 61194a26d..28214f04e 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -35,7 +35,7 @@ print header('Domain View', menubar( ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) - : ( "Cancel this (unaudited) account" => + : ( "Cancel this (unaudited) domain" => "${p}misc/cancel-unaudited.cgi?$svcnum" ) ), "Main menu" => $p, @@ -46,17 +46,36 @@ print header('Domain View', menubar( qq!
Catch all email (change):!, $email ? "$email." : "(none)", qq!

View whois information.!, - '

', ntable("",2), + '

', + '', + ntable("",2), 'ZoneTypeData', ; -foreach my $domain_record ( qsearch('domain_record', { svcnum => $svcnum } ) ) { + +foreach my $domain_record ( $svc_domain->domain_record ) { print ''. $domain_record->reczone. ''. ''. $domain_record->recaf. ' '. $domain_record->rectype. ''. - ''. $domain_record->recdata. ''; + ''. $domain_record->recdata; + print qq! (delete)! + unless $domain_record->rectype eq 'SOA'; + print ''; } -print ''. - '
'. joblisting({'svcnum'=>$svcnum}, 1). +print '
'. + qq!
!. + qq!!. + ' '. + 'IN '. + ''. + ' '. + '

'. joblisting({'svcnum'=>$svcnum}, 1). ''; %> -- cgit v1.2.1