diff options
author | ivan <ivan> | 1999-02-09 09:23:00 +0000 |
---|---|---|
committer | ivan <ivan> | 1999-02-09 09:23:00 +0000 |
commit | 2d5b6a99008439861b047739d1064fd828eccc7d (patch) | |
tree | f4d18f5afc942039e192f59ef6933e77f80c6d8d /htdocs | |
parent | 29ad6d23263f0f6af67e130f6f4f7da431fc5a15 (diff) |
visual and bugfixes
Diffstat (limited to 'htdocs')
-rwxr-xr-x | htdocs/search/cust_pkg.cgi | 18 | ||||
-rwxr-xr-x | htdocs/search/svc_acct_sm.cgi | 65 | ||||
-rwxr-xr-x | htdocs/search/svc_domain.cgi | 99 | ||||
-rwxr-xr-x | htdocs/view/svc_acct_sm.cgi | 13 |
4 files changed, 138 insertions, 57 deletions
diff --git a/htdocs/search/cust_pkg.cgi b/htdocs/search/cust_pkg.cgi index b7afc62a5..c48a3c703 100755 --- a/htdocs/search/cust_pkg.cgi +++ b/htdocs/search/cust_pkg.cgi @@ -1,11 +1,14 @@ #!/usr/bin/perl -Tw # -# $Id: cust_pkg.cgi,v 1.7 1999-02-07 09:59:37 ivan Exp $ +# $Id: cust_pkg.cgi,v 1.8 1999-02-09 09:22:57 ivan Exp $ # # based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 # # $Log: cust_pkg.cgi,v $ -# Revision 1.7 1999-02-07 09:59:37 ivan +# Revision 1.8 1999-02-09 09:22:57 ivan +# visual and bugfixes +# +# Revision 1.7 1999/02/07 09:59:37 ivan # more mod_perl fixes, and bugfixes Peter Wemm sent via email # # Revision 1.6 1999/01/19 05:14:13 ivan @@ -87,7 +90,7 @@ if ( scalar(@cust_pkg) == 1 ) { <TR> <TH>Package #</TH> <TH>Customer #</TH> - <TH>Name</TH> + <TH>Contact name</TH> <TH>Company</TH> </TR> END @@ -103,12 +106,13 @@ END $cust_main->last. ', '. $cust_main->first, $cust_main->company, ); + my $p = popurl(2); print <<END; <TR> - <TD><A HREF="../view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum</FONT></A></TD> - <TD><FONT SIZE=-1>$custnum</FONT></TD> - <TD><FONT SIZE=-1>$name</FONT></TD> - <TD><FONT SIZE=-1>$company</FONT></TD> + <TD><A HREF="${p}view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum</FONT></A></TD> + <TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$custnum</A></FONT></TD> + <TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$name</A></FONT></TD> + <TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$company</A></FONT></TD> </TR> END diff --git a/htdocs/search/svc_acct_sm.cgi b/htdocs/search/svc_acct_sm.cgi index ecdf0bc0c..60241bbdb 100755 --- a/htdocs/search/svc_acct_sm.cgi +++ b/htdocs/search/svc_acct_sm.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_acct_sm.cgi,v 1.5 1999-01-19 05:14:16 ivan Exp $ +# $Id: svc_acct_sm.cgi,v 1.6 1999-02-09 09:22:58 ivan Exp $ # # Usage: post form to: # http://server.name/path/svc_domain.cgi @@ -19,7 +19,10 @@ # bmccane@maxbaud.net 98-apr-3 # # $Log: svc_acct_sm.cgi,v $ -# Revision 1.5 1999-01-19 05:14:16 ivan +# Revision 1.6 1999-02-09 09:22:58 ivan +# visual and bugfixes +# +# Revision 1.5 1999/01/19 05:14:16 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -39,6 +42,9 @@ use FS::UID qw(cgisuidsetup); use FS::CGI qw(popurl idiot header table); use FS::Record qw(qsearch qsearchs); use FS::Conf; +use FS::svc_domain; +use FS::svc_acct_sm; +use FS::svc_acct; $cgi = new CGI; &cgisuidsetup($cgi); @@ -65,13 +71,14 @@ if ($domuser) { if ( scalar(@svc_acct_sm) == 1 ) { my($svcnum)=$svc_acct_sm[0]->svcnum; - print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum"); #redirect + print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum"); } elsif ( scalar(@svc_acct_sm) > 1 ) { - CGI::Base::SendHeaders(); - print $cgi->header( '-expires' => 'now' ), header('Mail Alias Search Results'), table, <<END; + print $cgi->header( '-expires' => 'now' ), + header('Mail Alias Search Results'), + table, <<END; <TR> - <TH>Mail to<BR><FONT SIZE=-2>(click here to view mail alias)</FONT></TH> - <TH>Forwards to<BR><FONT SIZE=-2>(click here to view account)</FONT></TH> + <TH>Mail to<BR><FONT SIZE=-1>(click to view mail alias)</FONT></TH> + <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH> </TR> END @@ -83,29 +90,39 @@ END $svc_acct_sm->domuid, $svc_acct_sm->domsvc, ); - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$domsvc}); - my($domain)=$svc_domain->domain; - my($svc_acct)=qsearchs('svc_acct',{'uid'=>$domuid}); - my($username)=$svc_acct->username; - my($svc_acct_svcnum)=$svc_acct->svcnum; - print qq!<TR>\n <TD> <A HREF="!. popurl(2). qq!view/svc_acct_sm.cgi?$svcnum">!; + my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } ); + if ( $svc_domain ) { + my $domain = $svc_domain->domain; - print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ); + print qq!<TR><TD><A HREF="!. popurl(2). qq!view/svc_acct_sm.cgi?$svcnum">!, + #print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ); + ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ), + qq!\@$domain</A> </TD>!, + ; + } else { + my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum"; + warn $warning; + print "<TR><TD>WARNING: $warning</TD>"; + } - print <<END; -\@$domain</A> </TD>\n -<TD> <A HREF="../view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A> </TD>\n </TR>\n -END + my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } ); + if ( $svc_acct ) { + my $username = $svc_acct->username; + my $svc_acct_svcnum =$svc_acct->svcnum; + print qq!<TD><A HREF="!, popurl(2), + qq!view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A>!, + qq!</TD></TR>! + ; + } else { + my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!"; + warn $warning; + print "<TD>WARNING: $warning</TD></TR>"; + } } - print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END + print '</TABLE></BODY></HTML>'; } else { #error idiot("Mail Alias not found"); diff --git a/htdocs/search/svc_domain.cgi b/htdocs/search/svc_domain.cgi index 732265210..778584d80 100755 --- a/htdocs/search/svc_domain.cgi +++ b/htdocs/search/svc_domain.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_domain.cgi,v 1.5 1999-02-07 09:59:39 ivan Exp $ +# $Id: svc_domain.cgi,v 1.6 1999-02-09 09:22:59 ivan Exp $ # # Usage: post form to: # http://server.name/path/svc_domain.cgi @@ -17,7 +17,10 @@ # display total, use FS::CGI now does browsing too ivan@sisd.com 98-jul-17 # # $Log: svc_domain.cgi,v $ -# Revision 1.5 1999-02-07 09:59:39 ivan +# Revision 1.6 1999-02-09 09:22:59 ivan +# visual and bugfixes +# +# Revision 1.5 1999/02/07 09:59:39 ivan # more mod_perl fixes, and bugfixes Peter Wemm sent via email # # Revision 1.4 1999/01/19 05:14:17 ivan @@ -32,7 +35,7 @@ # use strict; -use vars qw ( $cgi @svc_domain $sortby $query ); +use vars qw ( $cgi @svc_domain $sortby $query $conf ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); @@ -42,6 +45,9 @@ use FS::CGI qw(header eidiot popurl); $cgi = new CGI; &cgisuidsetup($cgi); +$conf = new FS::Conf; +$mydomain = $conf->config('domain'); + ($query)=$cgi->keywords; if ( $query eq 'svcnum' ) { $sortby=\*svcnum_sort; @@ -73,18 +79,17 @@ if ( scalar(@svc_domain) == 1 ) { } elsif ( scalar(@svc_domain) == 0 ) { eidiot "No matching domains found!\n"; } else { - CGI::Base::SendHeaders(); # one guess my($total)=scalar(@svc_domain); - CGI::Base::SendHeaders(); # one guess - print header("Domain Search Results",''), <<END; + print $cgi->header, header("Domain Search Results",''), <<END; $total matching domains found <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> <TR> <TH>Service #</TH> <TH>Domain</TH> - <TH></TH> + <TH>Mail to<BR><FONT SIZE=-1>(click to view mail alias)</FONT></TH> + <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH> </TR> END @@ -97,30 +102,76 @@ END $svc_domain->svcnum, $svc_domain->domain, ); - my($malias); - if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) { - $malias=( - qq|<FORM ACTION="svc_acct_sm.cgi" METHOD="post">|. - qq|<INPUT TYPE="hidden" NAME="domuser" VALUE="">|. - qq|<INPUT TYPE="hidden" NAME="domain" VALUE="$domain">|. - qq|<INPUT TYPE="submit" VALUE="(mail aliases)">|. - qq|</FORM>| - ); - } else { - $malias=''; - } + #my($malias); + #if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) { + # $malias=( + # qq|<FORM ACTION="svc_acct_sm.cgi" METHOD="post">|. + # qq|<INPUT TYPE="hidden" NAME="domuser" VALUE="">|. + # qq|<INPUT TYPE="hidden" NAME="domain" VALUE="$domain">|. + # qq|<INPUT TYPE="submit" VALUE="(mail aliases)">|. + # qq|</FORM>| + # ); + #} else { + # $malias=''; + #} + + my @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $svcnum}); + my $rowspan = scalar(@svc_acct_sm) || 1; + print <<END; <TR> - <TD><A HREF="${p}view/svc_domain.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD> - <TD><FONT SIZE=-1>$domain</FONT></TD> - <TD><FONT SIZE=-1>$malias</FONT></TD> - </TR> + <TD ROWSPAN=$rowspan><A HREF="${p}view/svc_domain.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD> + <TD ROWSPAN=$rowspan>$domain</TD> END + + my $n1 = ''; + # false laziness: this was stolen from search/svc_acct_sm.cgi. but the + # web interface in general needs to be rewritten in a mucho cleaner way + my($svc_acct_sm); + foreach $svc_acct_sm (@svc_acct_sm) { + my($svcnum,$domuser,$domuid,$domsvc)=( + $svc_acct_sm->svcnum, + $svc_acct_sm->domuser, + $svc_acct_sm->domuid, + $svc_acct_sm->domsvc, + ); + #my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } ); + #if ( $svc_domain ) { + # my $domain = $svc_domain->domain; + + print qq!$n1<TD><A HREF="!. popurl(2). qq!view/svc_acct_sm.cgi?$svcnum">!, + #print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ); + ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ), + qq!\@$domain</A> </TD>!, + ; + #} else { + # my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum"; + # warn $warning; + # print "$n1<TD>WARNING: $warning</TD>"; + #} + + my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } ); + if ( $svc_acct ) { + my $username = $svc_acct->username; + my $svc_acct_svcnum =$svc_acct->svcnum; + print qq!<TD><A HREF="!, popurl(2), + qq!view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A>!, + qq!</TD></TR>! + ; + } else { + my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!"; + warn $warning; + print "<TD>WARNING: $warning</TD>"; + } + $n1 = "</TR><TR>"; + } + #end of false laziness + print "</TR>"; + } print <<END; </TABLE> - </CENTER> </BODY> </HTML> END diff --git a/htdocs/view/svc_acct_sm.cgi b/htdocs/view/svc_acct_sm.cgi index 24c78ad18..4c86ffd32 100755 --- a/htdocs/view/svc_acct_sm.cgi +++ b/htdocs/view/svc_acct_sm.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_acct_sm.cgi,v 1.7 1999-02-07 09:59:42 ivan Exp $ +# $Id: svc_acct_sm.cgi,v 1.8 1999-02-09 09:23:00 ivan Exp $ # # Usage: svc_acct_sm.cgi svcnum # http://server.name/path/svc_acct_sm.cgi?svcnum @@ -22,7 +22,10 @@ # /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 # # $Log: svc_acct_sm.cgi,v $ -# Revision 1.7 1999-02-07 09:59:42 ivan +# Revision 1.8 1999-02-09 09:23:00 ivan +# visual and bugfixes +# +# Revision 1.7 1999/02/07 09:59:42 ivan # more mod_perl fixes, and bugfixes Peter Wemm sent via email # # Revision 1.6 1999/01/19 05:14:22 ivan @@ -52,6 +55,12 @@ use FS::UID qw(cgisuidsetup); use FS::CGI qw(header popurl); use FS::Record qw(qsearchs); use FS::Conf; +use FS::svc_acct_sm; +use FS::cust_svc; +use FS::cust_pkg; +use FS::part_svc; +use FS::svc_domain; +use FS::svc_acct; $cgi = new CGI; cgisuidsetup($cgi); |