add "are you sure?" javascript on view/svc_acct.cgi "cancel unaudited account"
authorivan <ivan>
Sat, 6 Jul 2002 08:50:48 +0000 (08:50 +0000)
committerivan <ivan>
Sat, 6 Jul 2002 08:50:48 +0000 (08:50 +0000)
(closes: Bug#432)

httemplate/view/svc_acct.cgi

index fd2a325..f6c1b02 100755 (executable)
@@ -39,16 +39,27 @@ if ( $svc_acct->domsvc ) {
   $domain = $mydomain;
 }
 
-print header('Account View', menubar(
+%>
+
+<SCRIPT>
+function areyousure(href) {
+    if (confirm("Permanently delete this account?") == true)
+        window.location.href = href;
+}
+</SCRIPT>
+
+<%= header('Account View', menubar(
   ( ( $pkgnum || $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" =>
-          "${p}misc/cancel-unaudited.cgi?$svcnum" )
+          "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" )
   ),
   "Main menu" => $p,
-));
+)) %>
+
+<%
 
 #print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;