add "are you sure?" javascript on view/svc_acct.cgi "cancel unaudited account"
[freeside.git] / httemplate / view / svc_acct.cgi
index a4e3770..f6c1b02 100755 (executable)
@@ -1,4 +1,4 @@
-<!-- $Id: svc_acct.cgi,v 1.10 2002-01-30 14:18:09 ivan Exp $ -->
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
@@ -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>!;
 
@@ -79,6 +90,12 @@ if ( $conf->exists('showpasswords') ) {
 print "</TR></TD>";
 $password = '';
 
+if ( $conf->exists('security_phrase') ) {
+  my $sec_phrase = $svc_acct->sec_phrase;
+  print '<TR><TD ALIGN="right">Security phrase</TD><TD BGCOLOR="#ffffff">'.
+        $svc_acct->sec_phrase. '</TD></TR>';
+}
+
 my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
 print "<TR><TD ALIGN=\"right\">Access number</TD>".
       "<TD BGCOLOR=\"#ffffff\">". $svc_acct_pop->text. '</TD></TR>'
@@ -129,6 +146,11 @@ if ($svc_acct->slipip) {
   print "<TR><TH COLSPAN=2>(No SLIP/PPP account)</TH></TR>";
 }
 
-print "</TABLE></TD></TR></TABLE></BODY></HTML>";
+print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'.
+      join('<BR>', $svc_acct->radius_groups). '</TD></TR>';
+
+print "</TABLE></TD></TR></TABLE>".
+      '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
+      "</BODY></HTML>";
 
 %>