bind export, editing zones, deleting unaudited domains, mmm
[freeside.git] / httemplate / view / svc_domain.cgi
index 61194a2..28214f0 100755 (executable)
@@ -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",
       )
     ? ( "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,
           "${p}misc/cancel-unaudited.cgi?$svcnum" )
   ),
   "Main menu" => $p,
@@ -46,17 +46,36 @@ print header('Domain View', menubar(
       qq!<BR>Catch all email <A HREF="${p}misc/catchall.cgi?$svcnum">(change)</A>:!,
       $email ? "<B>$email</B>." : "<I>(none)<I>",
       qq!<BR><BR><A HREF="http://www.geektools.com/cgi-bin/proxy.cgi?query=$domain;targetnic=auto">View whois information.</A>!,
       qq!<BR>Catch all email <A HREF="${p}misc/catchall.cgi?$svcnum">(change)</A>:!,
       $email ? "<B>$email</B>." : "<I>(none)<I>",
       qq!<BR><BR><A HREF="http://www.geektools.com/cgi-bin/proxy.cgi?query=$domain;targetnic=auto">View whois information.</A>!,
-      '<BR><BR>', ntable("",2),
+      '<BR><BR>',
+      '<SCRIPT>function areyousure(href) {
+        if ( confirm("Remove this record?") == true )
+          window.location.href = href;
+        }
+        </SCRIPT>',
+      ntable("",2),
       '<tr><th>Zone</th><th>Type</th><th>Data</th></tr>',
 ;
 
       '<tr><th>Zone</th><th>Type</th><th>Data</th></tr>',
 ;
 
-foreach my $domain_record ( qsearch('domain_record', { svcnum => $svcnum } ) ) {
+
+foreach my $domain_record ( $svc_domain->domain_record ) {
   print '<tr><td>'. $domain_record->reczone. '</td>'.
         '<td>'. $domain_record->recaf. ' '. $domain_record->rectype. '</td>'.
   print '<tr><td>'. $domain_record->reczone. '</td>'.
         '<td>'. $domain_record->recaf. ' '. $domain_record->rectype. '</td>'.
-        '<td>'. $domain_record->recdata. '</td></tr>';
+        '<td>'. $domain_record->recdata;
+  print qq! (<A HREF="javascript:areyousure('${p}misc/delete-domain_record.cgi?!
+        .$domain_record->recnum. qq!')">delete</A>)!
+    unless $domain_record->rectype eq 'SOA';
+  print '</td></tr>';
 }
 }
-print '</table>'.
-      '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
+print '</table><BR>'.
+      qq!<FORM METHOD="POST" ACTION="${p}edit/process/domain_record.cgi">!.
+      qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!.
+      '<INPUT TYPE="text" NAME="reczone"> '.
+      '<INPUT TYPE="hidden" NAME="recaf" VALUE="IN">IN '.
+      '<SELECT NAME="rectype">'.
+        join('', map qq!<OPTION VALUE="$_">$_</OPTION>!, qw(A NS CNAME MX) ).
+        '</SELECT>'.
+      ' <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Add">'.
+      '<BR><BR>'. joblisting({'svcnum'=>$svcnum}, 1).
       '</BODY></HTML>';
 
 %>
       '</BODY></HTML>';
 
 %>