diff options
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_bill-logo.cgi | 15 | ||||
-rwxr-xr-x | httemplate/view/cust_bill-pdf.cgi | 3 | ||||
-rwxr-xr-x | httemplate/view/cust_bill-ps.cgi | 3 | ||||
-rwxr-xr-x | httemplate/view/cust_bill.cgi | 179 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 43 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 93 | ||||
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 280 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 89 | ||||
-rw-r--r-- | httemplate/view/cust_main/quick-charge.html | 28 | ||||
-rw-r--r-- | httemplate/view/cust_main/tickets.html | 2 | ||||
-rwxr-xr-x | httemplate/view/cust_pkg.cgi | 5 | ||||
-rwxr-xr-x | httemplate/view/svc_acct.cgi | 310 | ||||
-rwxr-xr-x | httemplate/view/svc_domain.cgi | 12 | ||||
-rw-r--r-- | httemplate/view/svc_www.cgi | 20 |
14 files changed, 350 insertions, 732 deletions
diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi deleted file mode 100755 index 235485f6b..000000000 --- a/httemplate/view/cust_bill-logo.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -my $conf = new FS::Conf; - -my($query) = $cgi->keywords; -$query =~ /^([^\.\/]*)$/; -my $templatename = $1; -if ( $templatename && $conf->exists("logo_$templatename.png") ) { - $templatename = "_$templatename"; -} else { - $templatename = ''; -} - -http_header('Content-Type' => 'image/png' ); -%><%= $conf->config_binary("logo$templatename.png") %> diff --git a/httemplate/view/cust_bill-pdf.cgi b/httemplate/view/cust_bill-pdf.cgi index ce7ab0c5c..a72a60551 100755 --- a/httemplate/view/cust_bill-pdf.cgi +++ b/httemplate/view/cust_bill-pdf.cgi @@ -14,4 +14,5 @@ my $pdf = $cust_bill->print_pdf( '', $templatename); http_header('Content-Type' => 'application/pdf' ); http_header('Content-Length' => length($pdf) ); http_header('Cache-control' => 'max-age=60' ); -%><%= $pdf %> +%> +<%= $pdf %> diff --git a/httemplate/view/cust_bill-ps.cgi b/httemplate/view/cust_bill-ps.cgi index e730a822a..8485a150f 100755 --- a/httemplate/view/cust_bill-ps.cgi +++ b/httemplate/view/cust_bill-ps.cgi @@ -10,4 +10,5 @@ my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Invoice #$invnum not found!" unless $cust_bill; http_header('Content-Type' => 'application/postscript' ); -%><%= $cust_bill->print_ps( '', $templatename) %> +%> +<%= $cust_bill->print_ps( '', $templatename) %> diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 56c0c1736..ca0612d09 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -1,3 +1,4 @@ +<!-- mason kludge --> <% #untaint invnum @@ -6,146 +7,76 @@ $query =~ /^((.+)-)?(\d+)$/; my $templatename = $2; my $invnum = $3; -my $conf = new FS::Conf; - -my @payby = grep /\w/, $conf->config('payby'); -#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) -@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; -my %payby = map { $_=>1 } @payby; - my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Invoice #$invnum not found!" unless $cust_bill; my $custnum = $cust_bill->getfield('custnum'); #my $printed = $cust_bill->printed; -my $link = $templatename ? "$templatename-$invnum" : $invnum; - -%> -<%= header('Invoice View', menubar( +print header('Invoice View', menubar( "Main Menu" => $p, "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", -)) %> +)); -<% if ( $cust_bill->owed > 0 - && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} || $payby{'MCRD'} ) - ) - { - my $s = 0; -%> +print qq!<A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A> | ! + if $cust_bill->owed > 0; - Post +print qq!<A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>!; +if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { + print qq! | <A HREF="${p}misc/email-invoice.cgi?$invnum">!. + qq!Re-email this invoice</A>!; +} - <% if ( $payby{'BILL'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=BILL;invnum=<%= $invnum %>">check</A> - - <% } %> - - <% if ( $payby{'CASH'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=CASH;invnum=<%= $invnum %>">cash</A> - - <% } %> - - <% if ( $payby{'WEST'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;invnum=<%= $invnum %>">Western Union</A> - - <% } %> - - <% if ( $payby{'MCRD'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=MCRD;invnum=<%= $invnum %>">manual credit card</A> - - <% } %> - - payment against this invoice<BR> - -<% } %> - -<A HREF="<%= $p %>misc/print-invoice.cgi?<%= $link %>">Re-print this invoice</A> - -<% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { %> - | <A HREF="<%= $p %>misc/email-invoice.cgi?<%= $link %>">Re-email - this invoice</A> -<% } %> - -<% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { %> - | <A HREF="<%= $p %>misc/fax-invoice.cgi?<%= $link %>">Re-fax - this invoice</A> -<% } %> - -<BR><BR> - -<% if ( $conf->exists('invoice_latex') ) { %> - <A HREF="<%= $p %>view/cust_bill-pdf.cgi?<%= $link %>.pdf">View typeset invoice</A> - <BR><BR> -<% } %> - -<% #false laziness with search/cust_bill_event.cgi - unless ( $templatename ) { %> - - <%= table() %> - <TR> - <TH>Event</TH> - <TH>Date</TH> - <TH>Status</TH> - </TR> - - <% foreach my $cust_bill_event ( - sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event - ) { +print '<BR><BR>'; +my $conf = new FS::Conf; +if ( $conf->exists('invoice_latex') ) { + my $link = "${p}view/cust_bill-pdf.cgi?"; + $link .= "$templatename-" if $templatename; + $link .= "$invnum.pdf"; + print menubar( + 'View typeset invoice' => $link, + ), '<BR><BR>'; +} + +#false laziness with search/cust_bill_event.cgi + +unless ( $templatename ) { + print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>'; + foreach my $cust_bill_event ( + sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event + ) { my $status = $cust_bill_event->status; $status .= ': '. encode_entities($cust_bill_event->statustext) if $cust_bill_event->statustext; my $part_bill_event = $cust_bill_event->part_bill_event; - %> - <TR> - <TD><%= $part_bill_event->event %> + print '<TR><TD>'. $part_bill_event->event; - <% if ( $part_bill_event->templatename ) { - my $alt_templatename = $part_bill_event->templatename; - my $alt_link = "$alt_templatename-$invnum"; - %> - ( <A HREF="<%= $p %>view/cust_bill.cgi?<%= $alt_link %>">view</A> - | <A HREF="<%= $p %>view/cust_bill-pdf.cgi?<%= $alt_link %>.pdf">view - typeset</A> - | <A HREF="<%= $p %>misc/print-invoice.cgi?<%= $alt_link %>">re-print</A> - <% if ( grep { $_ ne 'POST' } - $cust_bill->cust_main->invoicing_list ) { %> - | <A HREF="<%= $p %>misc/email-invoice.cgi?<%= $alt_link %>">re-email</A> - <% } %> - - <% if ( $conf->exists('hylafax') - && length($cust_bill->cust_main->fax) ) { %> - | <A HREF="<%= $p %>misc/fax-invoice.cgi?<%= $alt_link %>">re-fax</A> - <% } %> - - ) - <% } %> + if ( + $part_bill_event->plan eq 'send_alternate' + && $part_bill_event->plandata =~ /^templatename (.*)$/m + ) { + my $templatename = $1; + print qq! ( <A HREF="${p}view/cust_bill.cgi?$templatename-$invnum">!. + 'view text</A> | '. + qq!<A HREF="${p}view/cust_bill-pdf.cgi?$templatename-$invnum.pdf">!. + 'view typeset</A> )'; + } - </TD> - <TD><%= time2str("%a %b %e %T %Y", $cust_bill_event->_date) %></TD> - <TD><%= $status %></TD> - </TR> - <% } %> + print '</TD><TD>'. + time2str("%a %b %e %T %Y", $cust_bill_event->_date). '</TD><TD>'. + $status. '</TD></TR>'; + } + print '</TABLE><BR>'; +} + +print '<PRE>', $cust_bill->print_text('', $templatename); + + #formatting + print <<END; + </PRE></FONT> + </BODY> +</HTML> +END - </TABLE> - <BR> - -<% } %> - -<% if ( $conf->exists('invoice_html') ) { %> - <%= join('', $cust_bill->print_html('', $templatename) ) %> -<% } else { %> - <PRE><%= join('', $cust_bill->print_text('', $templatename) ) %></PRE> -<% } %> - -</BODY></HTML> +%> diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 59c1a4b73..8794f3074 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -16,6 +16,12 @@ foreach my $part_svc ( qsearch('part_svc',{}) ) { 'Main Menu' => $p, )) %> +<STYLE TYPE="text/css"> +.package TH { font-size: medium } +.package TR { font-size: smaller } +.package .provision { font-weight: bold } +</STYLE> + <% die "No customer specified (bad URL)!" unless $cgi->keywords; @@ -29,43 +35,18 @@ print qq!<A HREF="${p}edit/cust_main.cgi?$custnum">Edit this customer</A>!; %> -<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT> -<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT> -<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT> - -<SCRIPT TYPE="text/javascript"> +<SCRIPT> function areyousure(href, message) { - if (confirm(message) == true) - window.location.href = href; + if (confirm(message) == true) + window.location.href = href; } </SCRIPT> -<SCRIPT TYPE="text/javascript"> - <% -my $ban = ''; -if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { - $ban = '<BR><P ALIGN="center">'. - '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\\\'s '; - if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { - $ban .= 'credit card'; - } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { - $ban .= 'ACH account'; - } -} -%> - -var confirm_cancel = '<FORM METHOD="POST" ACTION="<%= $p %>misc/cust_main-cancel.cgi"> <INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $custnum %>"> <BR><P ALIGN="center"><B>Permanently delete all services and cancel this customer?</B> <%= $ban%><BR><P ALIGN="CENTER"> <INPUT TYPE="submit" VALUE="Cancel customer"> <INPUT TYPE="BUTTON" VALUE="Don\'t cancel" onClick="cClick()"> </FORM> '; -</SCRIPT> - -<% if ( $cust_main->ncancelled_pkgs ) { %> - - | <A HREF="javascript:void(0);" onClick="overlib(confirm_cancel, CAPTION, 'Confirm cancellation', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 128, TEXTSIZE, 3, BGCOLOR, '#ff0000', CGCOLOR, '#ff0000' ); return false; ">Cancel this customer</A> - -<% } %> - -<% +print qq! | <A HREF="javascript:areyousure('${p}misc/cust_main-cancel.cgi?$custnum', 'Perminantly delete all services and cancel this customer?')">!. + 'Cancel this customer</A>' + if $cust_main->ncancelled_pkgs; print qq! | <A HREF="${p}misc/delete-customer.cgi?$custnum">!. 'Delete this customer</A>' diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 5786a0711..18a203bd6 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -6,7 +6,22 @@ Billing information (<A HREF="<%= $p %>misc/bill.cgi?<%= $cust_main->custnum %>">Bill now</A>) <%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %> - +<TR> + <TD ALIGN="right">Tax exempt</TD> + <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD> +</TR> +<TR> + <TD ALIGN="right">Postal invoices</TD> + <TD BGCOLOR="#ffffff"> + <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> + </TD> +</TR> +<TR> + <TD ALIGN="right">Email invoices</TD> + <TD BGCOLOR="#ffffff"> + <%= join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no' %> + </TD> +</TR> <TR> <TD ALIGN="right">Billing type</TD> <TD BGCOLOR="#ffffff"> @@ -20,37 +35,10 @@ Billing information <TD ALIGN="right">Card number</TD> <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo_masked %></TD> </TR> - -<% -#false laziness w/elements/select-month_year.html & edit/cust_main/billing.html -my( $mon, $year ); -my $date = $cust_main->paydate || '12-2037'; -if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); -} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); -} else { - warn "unrecognized expiration date format: $date"; - ( $mon, $year ) = ( '', '' ); -} -%> <TR> <TD ALIGN="right">Expiration</TD> - <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD> -</TR> - -<% if ( $cust_main->paystart_month ) { %> - <TR> - <TD ALIGN="right">Start date</TD> - <TD BGCOLOR="#ffffff"><%= $cust_main->paystart_month. '/'. $cust_main->paystart_year %> - </TR> -<% } elsif ( $cust_main->payissue ) { %> - <TR> - <TD ALIGN="right">Issue #</TD> - <TD BGCOLOR="#ffffff"><%= $cust_main->payissue %> - </TR> -<% } %> - + <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD> +</TR> <TR> <TD ALIGN="right">Name on card</TD> <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD> @@ -69,7 +57,7 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format </TR> <TR> <TD ALIGN="right">Account number</TD> - <TD BGCOLOR="#ffffff"><%= 'x'x(length($account)-2). substr($account,(length($account)-2)) %></TD> + <TD BGCOLOR="#ffffff"><%= $account %></TD> </TR> <TR> <TD ALIGN="right">Bank name</TD> @@ -103,6 +91,10 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format <% } %> <TR> + <TD ALIGN="right">Expiration</TD> + <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD> +</TR> +<TR> <TD ALIGN="right">Attention</TD> <TD BGCOLOR="#ffffff"><%= $cust_main->payname %></TD> </TR> @@ -116,49 +108,12 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format <TD ALIGN="right">Authorized by</TD> <TD BGCOLOR="#ffffff"><%= $cust_main->payinfo %></TD> </TR> - -<% -#false laziness w/above etc. -my( $mon, $year ); -my $date = $cust_main->paydate || '12-2037'; -if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); -} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); -} else { - warn "unrecognized expiration date format: $date"; - ( $mon, $year ) = ( '', '' ); -} -%> <TR> <TD ALIGN="right">Expiration</TD> - <TD BGCOLOR="#ffffff"><%= "$mon/$year" %></TD> + <TD BGCOLOR="#ffffff"><%= $cust_main->paydate %></TD> </TR> <% } %> -<TR> - <TD ALIGN="right">Tax exempt</TD> - <TD BGCOLOR="#ffffff"><%= $cust_main->tax ? 'yes' : 'no' %></TD> -</TR> -<TR> - <TD ALIGN="right">Postal invoices</TD> - <TD BGCOLOR="#ffffff"> - <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> - </TD> -</TR> -<TR> - <TD ALIGN="right">FAX invoices</TD> - <TD BGCOLOR="#ffffff"> - <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> - </TD> -</TR> -<TR> - <TD ALIGN="right">Email invoices</TD> - <TD BGCOLOR="#ffffff"> - <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> - </TD> -</TR> - </TABLE></TD></TR></TABLE> diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index ece1b62bb..068a8276f 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -5,10 +5,6 @@ my $packages = get_packages($cust_main, $conf); %> -<STYLE TYPE="text/css"> -.package .provision { font-weight: bold } -</STYLE> - <A NAME="cust_pkg"><FONT SIZE="+2">Packages</FONT></A> <%= include('order_pkg.html', $cust_main ) %> @@ -75,10 +71,12 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$cust_main->custnum)%> ) <% } %> </TD> - <TD ROWSPAN=<%=$rowspan%>> - <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"> - <% + #foreach (qw(setup last_bill next_bill susp expire cancel)) { + # print qq! <TD ROWSPAN=$rowspan>! . pkg_datestr($pkg,$_,$conf) . qq!</TD>\n!; + #} + print "<TD ROWSPAN=$rowspan>". &itable(''); + sub myfreq { my $part_pkg = shift; my $freq = $part_pkg->freq_pretty; @@ -86,190 +84,92 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { $freq; } - #this should use cust_pkg->status and cust_pkg->statuscolor eventually - - my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4; - my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%'; + if ( $pkg->{cancel} ) { #status: cancelled + + print '<TR><TD><FONT COLOR="#ff0000"><B>Cancelled </B></FONT></TD>'. + '<TD>'. pkg_datestr($pkg,'cancel',$conf). '</TD></TR>'; + unless ( $pkg->{setup} ) { + print '<TR><TD COLSPAN=2>Never billed</TD></TR>'; + } else { + print "<TR><TD>Setup </TD><TD>". + pkg_datestr($pkg, 'setup',$conf). '</TD></TR>'; + print "<TR><TD>Last bill </TD><TD>". + pkg_datestr($pkg, 'last_bill',$conf). '</TD></TR>' + if $pkg->{'last_bill'}; + print "<TR><TD>Suspended </TD><TD>". + pkg_datestr($pkg, 'susp',$conf). '</TD></TR>' + if $pkg->{'susp'}; + } - #false laziness w/edit/REAL_cust_pkg.cgi - my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until ); - unless ( $pkg->{'part_pkg'}->is_prepaid ) { - $billed_or_prepaid = 'billed'; - $last_bill_or_renewed = 'Last bill'; - $next_bill_or_prepaid_until = 'Next bill'; } else { - $billed_or_prepaid = 'prepaid'; - $last_bill_or_renewed = 'Renewed'; - $next_bill_or_prepaid_until = 'Prepaid until'; - } - -%> - -<% if ( $pkg->{cancel} ) { %> <!-- #status: cancelled --> - - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right"><FONT COLOR="#ff0000"><B>Cancelled </B></FONT></TD> - <%= pkg_datestr($pkg,'cancel',$conf) %> - </TR> - - <% unless ( $pkg->{setup} ) { %> - - <TR> - <TD COLSPAN=<%=$colspan%>>Never billed</TD> - </TR> - - <% } else { %> - - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Setup </TD> - <%= pkg_datestr($pkg, 'setup',$conf) %> - </TR> - - <% if ( $pkg->{'last_bill'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right"><%= $last_bill_or_renewed %> </TD> - <%= pkg_datestr($pkg, 'last_bill',$conf) %> - </TR> - <% } %> - - <% if ( $pkg->{'susp'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Suspended </TD> - <%= pkg_datestr($pkg, 'susp',$conf) %> - </TR> - <% } %> - - <% } %> - -<% } else { %> - - <% if ( $pkg->{susp} ) { %> <!-- #status: suspended --> - - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right"><FONT COLOR="#FF9900"><B>Suspended</B> </FONT></TD> - <%= pkg_datestr($pkg,'susp',$conf) %> - </TR> - - <% unless ( $pkg->{setup} ) { %> - - <TR> - <TD COLSPAN=<%=$colspan%>>Never billed</TD> - </TR> - - <% } else { %> - - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Setup </TD> - <%= pkg_datestr($pkg, 'setup',$conf) %> - </TR> - - <% } %> - - <% if ( $pkg->{'last_bill'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right"><%= $last_bill_or_renewed %> </TD> - <%= pkg_datestr($pkg, 'last_bill',$conf) %> - </TR> - <% } %> - - <!-- # next bill ?? --> - <% if ( $pkg->{'expire'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Expires </TD> - <%= pkg_datestr($pkg, 'expire',$conf) %> - </TR> - <% } %> + if ( $pkg->{susp} ) { #status: suspended + print '<TR><TD><FONT COLOR="#FF9900"><B>Suspended</B> </FONT></TD>'. + '<TD>'. pkg_datestr($pkg,'susp',$conf). '</TD></TR>'; + unless ( $pkg->{setup} ) { + print '<TR><TD COLSPAN=2>Never billed</TD></TR>'; + } else { + print "<TR><TD>Setup </TD><TD>". + pkg_datestr($pkg, 'setup',$conf). '</TD></TR>'; + } + print "<TR><TD>Last bill </TD><TD>". + pkg_datestr($pkg, 'last_bill',$conf). '</TD></TR>' + if $pkg->{'last_bill'}; + # next bill ?? + print "<TR><TD>Expires </TD><TD>". + pkg_datestr($pkg, 'expire',$conf). '</TD></TR>' + if $pkg->{'expire'}; + print '<TR><TD COLSPAN=2>( '. pkg_unsuspend_link($pkg). + ' | '. pkg_cancel_link($pkg). ' )</TD></TR>'; + + } else { #status: active + + unless ( $pkg->{setup} ) { #not setup + + print '<TR><TD COLSPAN=2>Not yet billed ('; + unless ( $pkg->{freq} ) { + print 'one-time charge)</TD></TR>'; + print '<TR><TD COLSPAN=2>( '. pkg_cancel_link($pkg). + ' )</TD</TR>'; + } else { + print 'billed '. myfreq($pkg->{part_pkg}). ')</TD></TR>'; + } + + } else { #setup + + unless ( $pkg->{freq} ) { + print "<TR><TD COLSPAN=2>One-time charge</TD></TR>". + '<TR><TD>Billed </TD><TD>'. + pkg_datestr($pkg,'setup',$conf). '</TD></TR>'; + } else { + print '<TR><TD COLSPAN=2><FONT COLOR="#00CC00"><B>Active</B></FONT>'. + ', billed '. myfreq($pkg->{part_pkg}). '</TD></TR>'. + '<TR><TD>Setup </TD><TD>'. + pkg_datestr($pkg, 'setup',$conf). '</TD></TR>'; + } + + } + + print "<TR><TD>Last bill </TD><TD>". + pkg_datestr($pkg, 'last_bill',$conf). '</TD></TR>' + if $pkg->{'last_bill'}; + print "<TR><TD>Next bill </TD><TD>". + pkg_datestr($pkg, 'next_bill',$conf). '</TD></TR>' + if $pkg->{'next_bill'}; + print "<TR><TD>Expires </TD><TD>". + pkg_datestr($pkg, 'expire',$conf). '</TD></TR>' + if $pkg->{'expire'}; + if ( $pkg->{freq} ) { + print '<TR><TD COLSPAN=2>( '. pkg_suspend_link($pkg). + ' | '. pkg_cancel_link($pkg). ' )</TD></TR>'; + } - <TR> - <TD COLSPAN=<%=$colspan%>>( <%= pkg_unsuspend_link($pkg) %> | <%= pkg_cancel_link($pkg) %> )</TD> - </TR> - - <% } else { %> <!-- #status: active --> - - <% unless ( $pkg->{setup} ) { %> <!-- #not setup --> - - <% unless ( $pkg->{'freq'} ) { %> - - <TR> - <TD COLSPAN=<%=$colspan%>>Not yet billed (one-time charge)</TD> - </TR> - - <TR> - <TD COLSPAN=<%=$colspan%>>( <%= pkg_cancel_link($pkg) %> )</TD> - </TR> - - <% } else { %> - - <TR> - <TD COLSPAN=<%=$colspan%>>Not yet billed (<%= $billed_or_prepaid %> <%= myfreq($pkg->{part_pkg}) %>)</TD> - </TR> - - <% } %> - - <% } else { %> <!-- #setup --> - - <% unless ( $pkg->{freq} ) { %> - - <TR> - <TD COLSPAN=<%=$colspan%>>One-time charge</TD> - </TR> - - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Billed </TD> - <%= pkg_datestr($pkg,'setup',$conf) %> - </TR> - - <% } else { %> - - <TR> - <TD COLSPAN=<%=$colspan%>><FONT COLOR="#00CC00"><B>Active</B></FONT>, <%= $billed_or_prepaid %> <%= myfreq($pkg->{part_pkg}) %></TD> - </TR> - - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Setup </TD> - <%= pkg_datestr($pkg, 'setup',$conf) %> - </TR> - - <% } %> - - <% } %> - - <% if ( $pkg->{'last_bill'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right"><%= $last_bill_or_renewed %> </TD> - <%= pkg_datestr($pkg, 'last_bill',$conf) %> - </TR> - <% } %> - - <% if ( $pkg->{'next_bill'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right"><%= $next_bill_or_prepaid_until %> </TD> - <%= pkg_datestr($pkg, 'next_bill',$conf) %> - </TR> - <% } %> - - <% if ( $pkg->{'expire'} ) { %> - <TR> - <TD WIDTH="<%=$width%>" ALIGN="right">Expires </TD> - <%= pkg_datestr($pkg, 'expire',$conf) %> - </TR> - <% } %> - - <% if ( $pkg->{freq} ) { %> - <TR> - <TD COLSPAN=<%=$colspan%>>( <%= pkg_suspend_link($pkg) %> | <%= pkg_cancel_link($pkg) %> )</TD> - </TR> - <% } %> - - <% } %> + } -<% } %> + } -</TABLE> -</TD> + print "</TABLE></TD>\n"; -<% if ($rowspan == 0) { print qq!</TR>\n!; next; } my $cnt = 0; @@ -442,15 +342,9 @@ sub pkgsort_pkgnum_cancel { sub pkg_datestr { my($pkg, $field, $conf) = @_ or return ''; return ' ' unless $pkg->{$field}; - my $format = '<TD align="left"><B>%b</B></TD>'. - '<TD align="right"><B> %o,</B></TD>'. - '<TD align="right"><B> %Y</B></TD>'; - #$format .= ' <FONT SIZE=-3>%l:%M:%S%P %z</FONT>' - $format .= '<TD ALIGN="right"><B> %l</TD>'. - '<TD ALIGN="center"><B>:</B></TD>'. - '<TD ALIGN="left"><B>%M</B></TD>'. - '<TD ALIGN="left"><B> %P</B></TD>' - if $conf->exists('cust_pkg-display_times'); + my $format = $conf->exists('pkg_showtimes') + ? '<B>%D</B> <FONT SIZE=-3>%l:%M:%S%P %z</FONT>' + : '<B>%b %o, %Y</B>'; ( my $strip = time2str($format, $pkg->{$field}) ) =~ s/ (\d)/$1/g; $strip; } diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index ec99b8c54..0f3a98702 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -1,63 +1,13 @@ <% my( $cust_main ) = @_; - my $custnum = $cust_main->custnum; - my $conf = new FS::Conf; - - my @payby = grep /\w/, $conf->config('payby'); - #@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) - @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; - my %payby = map { $_=>1 } @payby; - - my $s = 0; - + my $custnum = $cust_main->custnum; %> <BR><BR><A NAME="history"><FONT SIZE="+2">Payment History</FONT></A><BR> - -<% if ( $payby{'BILL'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=BILL;custnum=<%= $custnum %>">Post check payment</A> - -<% } %> - -<% if ( $payby{'CASH'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=CASH;custnum=<%= $custnum %>">Post cash payment</A> - -<% } %> - -<% if ( $payby{'WEST'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;custnum=<%= $custnum %>">Post Western Union payment</A> - -<% } %> - -<% if ( $payby{'CARD'} || $payby{'DCRD'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>misc/payment.cgi?payby=CARD;custnum=<%= $custnum %>">Process credit card payment</A> - -<% } %> - -<% if ( $payby{'CHEK'} || $payby{'DCHK'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>misc/payment.cgi?payby=CHEK;custnum=<%= $custnum %>">Process electronic check (ACH) payment</A> - -<% } %> - -<% if ( $payby{'MCRD'} ) { %> - - <%= $s++ ? ' | ' : '' %> - <A HREF="<%= $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<%= $custnum %>">Post manual credit card payment</A> - -<% } %> - +<A HREF="<%= $p %>edit/cust_pay.cgi?custnum=<%= $custnum %>">Post cash/check payment</A> +| <A HREF="<%= $p %>misc/payment.cgi?payby=CARD;custnum=<%= $custnum %>">Process credit card payment</A> +| <A HREF="<%= $p %>misc/payment.cgi?payby=CHEK;custnum=<%= $custnum %>">Process electronic check (ACH) payment</A> <BR><A HREF="<%= $p %>edit/cust_credit.cgi?<%= $custnum %>">Post credit</A> <BR> @@ -100,13 +50,8 @@ foreach my $cust_pay ($cust_main->cust_pay) { my $target = "$payby$payinfo"; $payby =~ s/^BILL$/Check #/ if $payinfo; $payby =~ s/^CHEK$/Electronic check /; - $payby =~ s/^PREP$/Prepaid card /; - $payby =~ s/^CARD$/Credit card #/; - $payby =~ s/^COMP$/Complimentary by /; - $payby =~ s/^CASH$/Cash/; - $payby =~ s/^WEST$/Western Union/; - $payby =~ s/^MCRD$/Manual credit card/; $payby =~ s/^BILL$//; + $payby =~ s/^(CARD|COMP)$/$1 /; my $info = $payby ? " ($payby$payinfo)" : ''; my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' ); @@ -172,14 +117,14 @@ foreach my $cust_pay ($cust_main->cust_pay) { my $void = ''; if ( $cust_pay->closed !~ /^Y/i - && ( $cust_pay->payby ne 'CARD' || $conf->exists('cc-void') ) + && $cust_pay->payby ne 'CARD' && ( $cust_pay->payby ne 'CHEK' || $conf->exists('echeck-void') ) ) { $void = qq! (<A HREF="javascript:areyousure('!. qq!${p}misc/void-cust_pay.cgi?!. $cust_pay->paynum. qq!', 'Are you sure you want to void this payment?')"!. qq! TITLE="Void this payment from the database!. - ( $cust_pay->payby =~ /^(CARD|CHEK)$/ + ( $cust_pay->payby eq 'CHEK' ? ' (do not send anything to the payment gateway)' : '' ). '"'. @@ -229,24 +174,11 @@ foreach my $cust_pay_void ($cust_main->cust_pay_void) { $payby =~ s/^(CARD|COMP)$/$1 /; my $info = $payby ? " ($payby$payinfo)" : ''; - my $unvoid = ''; - if ( $cust_pay_void->closed !~ /^Y/i && $conf->exists('unvoid') ) { - $unvoid = qq! (<A HREF="javascript:areyousure('!. - qq!${p}misc/unvoid-cust_pay_void.cgi?!. $cust_pay_void->paynum. - qq!', 'Are you sure you want to unvoid this payment?')"!. - qq! TITLE="Unvoid this payment from the database!. - ( $cust_pay_void->payby =~ /^(CARD|CHEK)$/ - ? ' (do not send anything to the payment gateway)' - : '' - ). '"'. - qq!>unvoid</A>)!; - } - push @history, { 'date' => $cust_pay_void->_date, 'desc' => "<DEL>Payment $info</DEL> <I>voided ". time2str("%D", $cust_pay_void->void_date). - " by ". $cust_pay_void->otaker. '</i>'. $unvoid, + " by ". $cust_pay_void->otaker. '</i>', 'void_payment' => $cust_pay_void->paid, }; @@ -326,10 +258,7 @@ foreach my $cust_credit ($cust_main->cust_credit) { push @history, { 'date' => $cust_credit->_date, 'desc' => $pre. "Credit$post by ". $cust_credit->otaker. - ( $cust_credit->reason - ? ' ('. $cust_credit->reason. ')' - : '' - ). + ' ('. $cust_credit->reason. ')'. "$desc$apply$delete$unapply", 'credit' => $cust_credit->amount, }; diff --git a/httemplate/view/cust_main/quick-charge.html b/httemplate/view/cust_main/quick-charge.html index 2fe3d5f3d..0b51586d1 100644 --- a/httemplate/view/cust_main/quick-charge.html +++ b/httemplate/view/cust_main/quick-charge.html @@ -1,18 +1,32 @@ <% my( $cust_main ) = @_; + my $conf = new FS::Conf; %> <FORM ACTION="<%=$p%>edit/process/quick-charge.cgi" METHOD="POST"> - <INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $cust_main->custnum %>"> - Description:<INPUT TYPE="text" NAME="pkg"> + Amount:<INPUT TYPE="text" NAME="amount" SIZE=6> + <% + + #false laziness w/ edit/part_pkg.cgi + if ( $conf->exists('enable_taxclasses') ) { + print '<SELECT NAME="taxclass">'; + my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') + or die dbh->errstr; + $sth->execute or die $sth->errstr; + foreach my $taxclass ( map $_->[0], @{$sth->fetchall_arrayref} ) { + print qq!<OPTION VALUE="$taxclass"!; + #print ' SELECTED' if $taxclass eq $hashref->{taxclass}; + print qq!>$taxclass</OPTION>!; + } + print '</SELECT>'; + } else { + print '<INPUT TYPE="hidden" NAME="taxclass" VALUE="">'; + } -Amount:<INPUT TYPE="text" NAME="amount" SIZE=6> - -<%= include('/elements/select-taxclass.html') %> - +%> + <INPUT TYPE="submit" VALUE="One-time charge"> - </FORM> diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index 72d68152a..d6ddfa64c 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -30,7 +30,7 @@ Highest priority tickets (<A HREF="<%= FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>) -(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>) +(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main->custnum, join(', ', grep { $_ ne 'POST' } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>) <%= table() %> <TR> <TH>#</TH> diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index a20149ae2..5f0e6bffc 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -104,9 +104,8 @@ unless ($cancel) { #list of services this pkgpart includes my $pkg_svc; - my %pkg_svc; - #foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { - foreach $pkg_svc ( $cust_pkg->part_pkg->pkg_svc ) { + my %pkg_svc = (); + foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity; } diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index b42362d91..6ca9bf071 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -1,3 +1,4 @@ +<!-- mason kludge --> <% my $conf = new FS::Conf; @@ -23,46 +24,41 @@ if ($pkgnum) { my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); die "Unknown svcpart" unless $part_svc; -my $svc = $part_svc->svc; -die 'Empty domsvc for svc_acct.svcnum '. $svc_acct->svcnum - unless $svc_acct->domsvc; -my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } ); -die 'Unknown domain (domsvc '. $svc_acct->domsvc. - ' for svc_acct.svcnum '. $svc_acct->svcnum. ')' - unless $svc_domain; -my $domain = $svc_domain->domain; +my $domain; +if ( $svc_acct->domsvc ) { + my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } ); + die "Unknown domain" unless $svc_domain; + $domain = $svc_domain->domain; +} else { + die "No svc_domain.svcnum record for svc_acct.domsvc: ". $cust_svc->domsvc; +} %> -<% if ( $custnum ) { %> - - <%= header("View $svc account", menubar( - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - "Main menu" => $p, - )) %> - - <%= include( '/elements/small_custview.html', $custnum, '', 1 ) %> - <BR> - -<% } else { %> +<SCRIPT> +function areyousure(href) { + if (confirm("Permanently delete this account?") == true) + window.location.href = href; +} +</SCRIPT> - <SCRIPT> - function areyousure(href) { - if (confirm("Permanently delete this account?") == true) - window.location.href = href; - } - </SCRIPT> - - <%= header('Account View', menubar( - "Cancel this (unaudited) account" => - "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')", - "Main menu" => $p, - )) %> +<%= header('Account View', menubar( + ( ( $pkgnum || $custnum ) + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ) + : ( "Cancel this (unaudited) account" => + "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" ) + ), + "Main menu" => $p, +)) %> -<% } %> +<% -<% if ( $part_svc->part_export_usage ) { +#if ( $cust_pkg && $cust_pkg->part_pkg->plan eq 'sqlradacct_hour' ) { +if ( $part_svc->part_export('sqlradius') + || $part_svc->part_export('sqlradius_withdomain') +) { my $last_bill; my %plandata; @@ -155,178 +151,122 @@ function enable_change () { } %> -Service #<B><%= $svcnum %></B> -| <A HREF="<%=$p%>edit/svc_acct.cgi?<%=$svcnum%>">Edit this service</A> +Service Information +| <A HREF="<%=$p%>edit/svc_acct.cgi?<%=$svcnum%>">Edit this information</A> <% if ( @part_svc ) { %> | <SELECT NAME="svcpart" onChange="enable_change()"> <OPTION VALUE="">Change service</OPTION> <OPTION VALUE="">--------------</OPTION> - <% foreach my $opt_part_svc ( @part_svc ) { %> - <OPTION VALUE="<%= $opt_part_svc->svcpart %>"><%= $opt_part_svc->svc %></OPTION> + <% foreach my $part_svc ( @part_svc ) { %> + <OPTION VALUE="<%= $part_svc->svcpart %>"><%= $part_svc->svc %></OPTION> <% } %> </SELECT> <INPUT NAME="submit" TYPE="submit" VALUE="Change" disabled> <% } %> <%= &ntable("#cccccc") %><TR><TD><%= &ntable("#cccccc",2) %> +<TR><TD ALIGN="right">Service number</TD> + <TD BGCOLOR="#ffffff"><%= $svcnum %></TD></TR> +<TR><TD ALIGN="right">Service</TD> + <TD BGCOLOR="#ffffff"><%= $part_svc->svc %></TD></TR> +<TR><TD ALIGN="right">Username</TD> + <TD BGCOLOR="#ffffff"><%= $svc_acct->username %></TD></TR> +<TR><TD ALIGN="right">Domain</TD> + <TD BGCOLOR="#ffffff"><%= $domain %></TD></TR> + +<TR><TD ALIGN="right">Password</TD> + <TD BGCOLOR="#ffffff"><% + +my $password = $svc_acct->_password; +if ( $password =~ /^\*\w+\* (.*)$/ ) { + $password = $1; + print "<I>(login disabled)</I> "; +} +if ( $conf->exists('showpasswords') ) { + print '<PRE>'. encode_entities($password). '</PRE>'; +} else { + print "<I>(hidden)</I>"; +} +print "</TR></TD>"; +$password = ''; -<TR> - <TD ALIGN="right">Service</TD> - <TD BGCOLOR="#ffffff"><%= $part_svc->svc %></TD> -</TR> -<TR> - <TD ALIGN="right">Username</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->username %></TD> -</TR> -<TR> - <TD ALIGN="right">Domain</TD> - <TD BGCOLOR="#ffffff"><%= $domain %></TD> -</TR> - -<TR> - <TD ALIGN="right">Password</TD> - <TD BGCOLOR="#ffffff"> - - <% my $password = $svc_acct->_password; %> - <% if ( $password =~ /^\*\w+\* (.*)$/ ) { - $password = $1; - %> - <I>(login disabled)</I> - <% } %> - - <% if ( $conf->exists('showpasswords') ) { %> - <PRE><%= encode_entities($password) %></PRE> - <% } else { %> - <I>(hidden)</I> - <% } %> - - </TD> -</TR> -<% $password = ''; %> - -<% if ( $conf->exists('security_phrase') ) { - my $sec_phrase = $svc_acct->sec_phrase; -%> - <TR> - <TD ALIGN="right">Security phrase</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->sec_phrase %></TD> - </TR> -<% } %> - -<% if ( $svc_acct->popnum ) { - my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); -%> - <TR> - <TD ALIGN="right">Access number</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct_pop->text %></TD> - </TR> -<% } %> - -<% if ($svc_acct->uid ne '') { %> - <TR> - <TD ALIGN="right">UID</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->uid %></TD> - </TR> -<% } %> - -<% if ($svc_acct->gid ne '') { %> - <TR> - <TD ALIGN="right">GID</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->gid %></TD> - </TR> -<% } %> - -<% if ($svc_acct->finger ne '') { %> - <TR> - <TD ALIGN="right">GECOS</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->finger %></TD> - </TR> -<% } %> - -<% if ($svc_acct->dir ne '') { %> - <TR> - <TD ALIGN="right">Home directory</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->dir %></TD> - </TR> -<% } %> - -<% if ($svc_acct->shell ne '') { %> - <TR> - <TD ALIGN="right">Shell</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->shell %></TD> - </TR> -<% } %> - -<% if ($svc_acct->quota ne '') { %> - <TR> - <TD ALIGN="right">Quota</TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->quota %></TD> - </TR> -<% } %> - -<% if ($svc_acct->slipip) { %> - <TR> - <TD ALIGN="right">IP address</TD> - <TD BGCOLOR="#ffffff"> - <%= ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) - ? "<I>(Dynamic)</I>" - : $svc_acct->slipip - %> - </TD> - </TR> -<% } %> - -<% foreach my $attribute ( grep /^radius_/, $svc_acct->fields ) { - $attribute =~ /^radius_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; -%> - <TR> - <TD ALIGN="right">Radius (reply) <%= $pattribute %></TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->getfield($attribute) %></TD> - </TR> -<% } %> +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>'; +} -<% foreach my $attribute ( grep /^rc_/, $svc_acct->fields ) { - $attribute =~ /^rc_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; -%> - <TR> - <TD ALIGN="right">Radius (check) <%= $pattribute %></TD> - <TD BGCOLOR="#ffffff"><%= $svc_acct->getfield($attribute) %></TD> - </TR> -<% } %> +my $svc_acct_pop = $svc_acct->popnum + ? 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>' + if $svc_acct_pop; + +if ($svc_acct->uid ne '') { + print "<TR><TD ALIGN=\"right\">Uid</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->uid. "</TD></TR>", + "<TR><TD ALIGN=\"right\">Gid</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->gid. "</TD></TR>", + "<TR><TD ALIGN=\"right\">GECOS</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->finger. "</TD></TR>", + "<TR><TD ALIGN=\"right\">Home directory</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->dir. "</TD></TR>", + "<TR><TD ALIGN=\"right\">Shell</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->shell. "</TD></TR>", + "<TR><TD ALIGN=\"right\">Quota</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->quota. "</TD></TR>" + ; +} else { + print "<TR><TH COLSPAN=2>(No shell account)</TH></TR>"; +} -<TR> - <TD ALIGN="right">RADIUS groups</TD> - <TD BGCOLOR="#ffffff"><%= join('<BR>', $svc_acct->radius_groups) %></TD> -</TR> +if ($svc_acct->slipip) { + print "<TR><TD ALIGN=\"right\">IP address</TD><TD BGCOLOR=\"#ffffff\">". + ( ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) + ? "<I>(Dynamic)</I>" + : $svc_acct->slipip + ). "</TD>"; + my($attribute); + foreach $attribute ( grep /^radius_/, $svc_acct->fields ) { + #warn $attribute; + $attribute =~ /^radius_(.*)$/; + my $pattribute = $FS::raddb::attrib{$1}; + print "<TR><TD ALIGN=\"right\">Radius (reply) $pattribute</TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute). + "</TD></TR>"; + } + foreach $attribute ( grep /^rc_/, $svc_acct->fields ) { + #warn $attribute; + $attribute =~ /^rc_(.*)$/; + my $pattribute = $FS::raddb::attrib{$1}; + print "<TR><TD ALIGN=\"right\">Radius (check) $pattribute: </TD>". + "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute). + "</TD></TR>"; + } +} else { + print "<TR><TH COLSPAN=2>(No SLIP/PPP account)</TH></TR>"; +} -<% if ( $svc_acct->seconds =~ /^\d+$/ ) { %> - <TR> - <TD ALIGN="right">Prepaid time</TD> - <TD BGCOLOR="#ffffff"><%= duration_exact($svc_acct->seconds) %></TD> - </TR> -<% } %> +print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'. + join('<BR>', $svc_acct->radius_groups). '</TD></TR>'; -<% # Can this be abstracted further? Maybe a library function like # widget('HTML', 'view', $svc_acct) ? It would definitely make UI # style management easier. -%> - -<% foreach (sort { $a cmp $b } $svc_acct->virtual_fields) { %> - <%= $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)) %> -<% } %> -</TABLE></TD></TR></TABLE> -</FORM> -<BR><BR> +foreach (sort { $a cmp $b } $svc_acct->virtual_fields) { + print $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)), + "\n"; +} +%> +</TABLE></TD></TR></TABLE></FORM> +<% -<%= join("<BR>", $conf->config('svc_acct-notes') ) %> -<BR><BR> +print '<BR><BR>'; -<%= joblisting({'svcnum'=>$svcnum}, 1) %> +print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'. + joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>'; -</BODY> -</HTML> +%> diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index 428f3e9bf..cd9f79d36 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -36,8 +36,8 @@ my $domain = $svc_domain->domain; ( ( $pkgnum || $custnum ) ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) - : ( "Delete this (unaudited) domain" => - "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" ) + : ( "Cancel this (unaudited) domain" => + "${p}misc/cancel-unaudited.cgi?$svcnum" ) ), "Main menu" => $p, )) %> @@ -50,8 +50,8 @@ Service #<%= $svcnum %> <BR><BR><A HREF="<%= ${p} %>misc/whois.cgi?custnum=<%=$custnum%>;svcnum=<%=$svcnum%>;domain=<%=$domain%>">View whois information.</A> <BR><BR> <SCRIPT> - function areyousure(href, message) { - if ( confirm(message) == true ) + function areyousure(href) { + if ( confirm("Remove this record?") == true ) window.location.href = href; } function slave_areyousure() { @@ -74,7 +74,7 @@ Service #<%= $svcnum %> <td><%= $domain_record->recdata %> <% unless ( $domain_record->rectype eq 'SOA' ) { %> - (<A HREF="javascript:areyousure('<%=$p%>misc/delete-domain_record.cgi?<%=$domain_record->recnum%>', 'Delete \'<%= $domain_record->reczone %> <%= $type %> <%= $domain_record->recdata %>\' ?' )">delete</A>) + (<A HREF="javascript:areyousure('<%=$p%>misc/delete-domain_record.cgi?<%=$domain_record->recnum%>')">delete</A>) <% } %> </td></tr> <% } %> @@ -87,7 +87,7 @@ Service #<%= $svcnum %> <INPUT TYPE="text" NAME="reczone"> <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN <SELECT NAME="rectype"> -<% foreach (qw( A NS CNAME MX PTR TXT) ) { %> +<% foreach (qw( A NS CNAME MX PTR) ) { %> <OPTION VALUE="<%=$_%>"><%=$_%></OPTION> <% } %> </SELECT> diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi index 6c8cd6a0b..2980f846b 100644 --- a/httemplate/view/svc_www.cgi +++ b/httemplate/view/svc_www.cgi @@ -21,13 +21,9 @@ if ($pkgnum) { #eofalse my $usersvc = $svc_www->usersvc; -my $svc_acct = ''; -my $email = ''; -if ( $usersvc ) { - $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } ) - or die "svc_www: Unknown usersvc $usersvc"; - $email = $svc_acct->email; -} +my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } ) + or die "svc_www: Unknown usersvc $usersvc"; +my $email = $svc_acct->email; my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } ) or die "svc_www: Unknown recnum ". $svc_www->recnum; @@ -50,15 +46,7 @@ print header('Website View', menubar( qq!<TR><TD ALIGN="right">Website name</TD>!. qq!<TD BGCOLOR="#ffffff"><A HREF="http://$www">$www<A></TD></TR>!. qq!<TR><TD ALIGN="right">Account</TD>!. - qq!<TD BGCOLOR="#ffffff">!; - -if ( $usersvc ) { - print qq!<A HREF="${p}view/svc_acct.cgi?$usersvc">$email</A>!; -} else { - print '</i>(none)</i>'; -} - -print '</TD></TR>'; + qq!<TD BGCOLOR="#ffffff"><A HREF="${p}view/svc_acct.cgi?$usersvc">$email</A></TD></TR>!; foreach (sort { $a cmp $b } $svc_www->virtual_fields) { print $svc_www->pvf($_)->widget('HTML', 'view', $svc_www->getfield($_)), |