diff options
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_bill.cgi | 19 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 16 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 2 | ||||
-rw-r--r-- | httemplate/view/cust_main/contacts.html | 14 | ||||
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 5 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/services.html | 44 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/status.html | 6 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 22 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/payment.html | 5 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/pending_payment.html | 61 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/voided_payment.html | 8 | ||||
-rw-r--r-- | httemplate/view/cust_pay.html | 34 | ||||
-rw-r--r-- | httemplate/view/elements/svc_Common.html | 16 | ||||
-rw-r--r-- | httemplate/view/image.cgi | 31 | ||||
-rw-r--r-- | httemplate/view/svc_domain/dns.html | 86 | ||||
-rw-r--r-- | httemplate/view/svc_pbx.cgi | 72 |
16 files changed, 79 insertions, 362 deletions
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 0928d04bc..ce8d96a95 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -26,7 +26,7 @@ % if ( $cust_bill->owed > 0 % && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) ) -% && $curuser->access_right(['Post payment', 'Post check payment', 'Post cash payment']) +% && $curuser->access_right('Post payment') % && ! $conf->exists('pkg-balances') % ) % { @@ -34,22 +34,22 @@ Post -% if ( $payby{'BILL'} && $curuser->access_right(['Post payment', 'Post check payment']) ) { +% if ( $payby{'BILL'} ) { <% $s++ ? ' | ' : '' %> <A HREF="<% $p %>edit/cust_pay.cgi?payby=BILL;invnum=<% $invnum %>">check</A> % } -% if ( $payby{'CASH'} && $curuser->access_right(['Post payment', 'Post cash payment']) ) { +% if ( $payby{'CASH'} ) { <% $s++ ? ' | ' : '' %> <A HREF="<% $p %>edit/cust_pay.cgi?payby=CASH;invnum=<% $invnum %>">cash</A> % } -% if ( $payby{'WEST'} && $curuser->access_right(['Post payment']) ) { +% if ( $payby{'WEST'} ) { <% $s++ ? ' | ' : '' %> <A HREF="<% $p %>edit/cust_pay.cgi?payby=WEST;invnum=<% $invnum %>">Western Union</A> % } -% if ( $payby{'MCRD'} && $curuser->access_right(['Post payment']) ) { +% if ( $payby{'MCRD'} ) { <% $s++ ? ' | ' : '' %> <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;invnum=<% $invnum %>">manual credit card</A> % } @@ -117,14 +117,13 @@ if ( $query =~ /^((.+)-)?(\d+)$/ ) { $notice_name = $cgi->param('notice_name'); } -my $conf = new FS::Conf; - my %opt = ( - 'unsquelch_cdr' => $conf->exists('voip-cdr_email'), - 'template' => $template, - 'notice_name' => $notice_name, + 'template' => $template, + 'notice_name' => $notice_name, ); +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 )) diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 0f9c1e250..b4a6170c5 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -64,22 +64,6 @@ function areyousure(href, message) { % } -% if ( $curuser->access_right('Merge customer') ) { - - <% include( '/elements/popup_link-cust_main.html', - { 'action' => $p. 'misc/merge_cust.html', - 'label' => 'Merge this customer', - 'actionlabel' => 'Merge customer', - #'color' => '#ff0000', - 'cust_main' => $cust_main, - 'width' => 480, - 'height' => 192, - } - ) - %> | - -% } - % if ( $conf->exists('deletecustomers') % && $curuser->access_right('Delete customer') % ) { diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 014ddaba2..dd195236a 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -132,7 +132,7 @@ Billing information <TR> <TD ALIGN="right">Attention</TD> - <TD BGCOLOR="#ffffff"><% $cust_main->payname |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->payname %></TD> </TR> % } elsif ( $cust_main->payby eq 'COMP' ) { diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html index e91af54e6..e88c02ea5 100644 --- a/httemplate/view/cust_main/contacts.html +++ b/httemplate/view/cust_main/contacts.html @@ -10,7 +10,7 @@ <TR> <TD ALIGN="right">Contact name</TD> <TD COLSPAN=5 BGCOLOR="#ffffff"> - <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") |h %> + <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %> </TD> % if ( $which eq '' && $conf->exists('show_ss') ) { <TD ALIGN="right">SS#</TD> @@ -19,11 +19,11 @@ </TR> <TR> <TD ALIGN="right">Company</TD> - <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD> + <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") %></TD> </TR> <TR> <TD ALIGN="right">Address</TD> - <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD> + <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") %></TD> </TR> % if ( $cust_main->get("${pre}address2") ) { @@ -36,20 +36,20 @@ <TR> <TD ALIGN="right"><% $address2_label %></TD> - <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") |h %></TD> + <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") %></TD> </TR> % } <TR> <TD ALIGN="right">City</TD> - <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") %></TD> % if ( $cust_main->get("${pre}county") ) { <TD ALIGN="right">County</TD> - <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") %></TD> % } <TD ALIGN="right">State</TD> - <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %></TD> + <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) %></TD> <TD ALIGN="right">Zip</TD> <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD> </TR> diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 660d0ef86..811ac3c98 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -57,9 +57,7 @@ Current packages <TD ALIGN="right"> <A HREF="<%$p%>search/report_cust_pkg.html?custnum=<% $cust_main->custnum %>">Package reports</A><BR> Service reports: - <A HREF="<%$p%>search/report_svc_acct.html?custnum=<% $cust_main->custnum %>">accounts</A><BR> - Usage reports: - <A HREF="<%$p%>search/report_cdr.html?custnum=<% $cust_main->custnum %>">CDRs</A> + <A HREF="<%$p%>search/report_svc_acct.html?custnum=<% $cust_main->custnum %>">accounts</A> </TD> </TR> @@ -163,7 +161,6 @@ my %conf_opt = ( 'legacy_link' => $conf->exists('legacy_link'), 'svc_broadband-manage_link' => scalar($conf->config('svc_broadband-manage_link')), 'maestro-status_test' => $conf->exists('maestro-status_test'), - 'cust_pkg-large_pkg_size' => $conf->config('cust_pkg-large_pkg_size'), ); #subroutines diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 512efccc4..6e30922c5 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -4,40 +4,12 @@ <TD CLASS="inv" BGCOLOR="<% $bgcolor %>"> <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"> - <SCRIPT TYPE="text/javascript"> -function clearhint_search_cust_svc(obj, str) { - if (obj.value == str) obj.value = ''; -} - </SCRIPT> % #foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) { % foreach my $part_svc ( $cust_pkg->part_svc ) { -% if ( $opt{'cust_pkg-large_pkg_size'} > 0 and -% $opt{'cust_pkg-large_pkg_size'} <= $cust_pkg->num_svcs ) { -% # summarize - <TR> - <TD ALIGN="center" VALIGN="top"> -% my $href="${p}search/cust_pkg_svc.html?svcpart=".$part_svc->svcpart. -% ";pkgnum=".$cust_pkg->pkgnum; - <A HREF="<% $href %>"><% $part_svc->svc %></A> - <A HREF="<% $href %>"><B>(view all <% $cust_pkg->num_svcs %>)</B></A> -% my $hint = $hints{$part_svc->svcdb}; -% if ( $hint ) { - <BR> - <FORM name="svcpart<%$part_svc->svcpart%>_search" STYLE="display:inline" - ACTION="<%$p%>search/cust_pkg_svc.html" METHOD="GET"> - <INPUT TYPE="hidden" NAME="svcpart" VALUE="<%$part_svc->svcpart%>"> - <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%$cust_pkg->pkgnum%>"> - <INPUT TYPE="text" NAME="search_svc" - onfocus="clearhint_search_cust_svc(this, '<%$hint%>')" VALUE="<%$hint%>"> - <INPUT TYPE="submit" VALUE="Search"></FORM> -% } #$hint - </TD> - </TR> -% } -% else { -% foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) { +% #foreach my $service (@{$svcpart->{services}}) { +% foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) { <TR> <TD ALIGN="right" VALIGN="top"><% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %></TD> @@ -93,8 +65,7 @@ function clearhint_search_cust_svc(obj, str) { </TD> </TR> -% } #foreach $cust_svc -% } +% } % if ( ! $cust_pkg->get('cancel') % && $curuser->access_right('Provision customer service') @@ -166,13 +137,4 @@ sub svc_unprovision_link { qq!', 'Permanently unprovision and delete this service?')">Unprovision</A>!; } -my %hints = ( -svc_acct => '(user or email)', -svc_domain => '(domain)', -svc_broadband => '(ip or mac)', -svc_forward => '(email)', -svc_phone => '(phone)', -svc_pbx => '(phone)', -); - </%init> diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index c05cd5a94..a6868434b 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -54,11 +54,8 @@ <% pkg_status_row_changed( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %> -% if ( $part_pkg->option('suspend_bill') ) { - <% pkg_status_row_if( $cust_pkg, 'Next bill', 'bill', %opt, curuser=>$curuser ) %> -% } +% # pkg_status_row($cust_pkg, 'Next bill', 'bill', %opt) <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', %opt, curuser=>$curuser ) %> - <% pkg_status_row_if( $cust_pkg, 'Contract ends', 'contract_end', %opt ) %> <TR> <TD COLSPAN=<%$colspan%>> @@ -170,7 +167,6 @@ <% pkg_status_row_if($cust_pkg, 'Will automatically suspend by', 'autosuspend', %opt) %> <% pkg_status_row_if( $cust_pkg, 'Will suspend on', 'adjourn', %opt, curuser=>$curuser ) %> <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', %opt, curuser=>$curuser ) %> - <% pkg_status_row_if( $cust_pkg, 'Contract ends', 'contract_end', %opt ) %> % if ( $part_pkg->freq ) { diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 046899e5e..b84883a2f 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -1,7 +1,7 @@ %# payment links % my $s = 0; -% if ( $payby{'BILL'} && $curuser->access_right(['Post payment', 'Post check payment' ]) ) { +% if ( $payby{'BILL'} && $curuser->access_right('Post payment') ) { <% $s++ ? ' | ' : '' %> <% include('/elements/popup_link-cust_main.html', 'label' => 'Enter check payment', @@ -14,7 +14,7 @@ %> % } -% if ( $payby{'CASH'} && $curuser->access_right(['Post payment', 'Post cash payment']) ) { +% if ( $payby{'CASH'} && $curuser->access_right('Post payment') ) { <% $s++ ? ' | ' : '' %> <% include('/elements/popup_link-cust_main.html', 'label' => 'Enter cash payment', @@ -33,7 +33,7 @@ % } % if ( ( $payby{'CARD'} || $payby{'DCRD'} ) -% && $curuser->access_right(['Process payment', 'Process credit card payment']) +% && $curuser->access_right('Process payment') % && ! $cust_main->is_encrypted($cust_main->payinfo) % ) { <% $s++ ? ' | ' : '' %> @@ -41,7 +41,7 @@ % } % if ( ( $payby{'CHEK'} || $payby{'DCHK'} ) -% && $curuser->access_right(['Process payment', 'Process Echeck payment']) +% && $curuser->access_right('Process payment') % && ! $cust_main->is_encrypted($cust_main->payinfo) % ) { <% $s++ ? ' | ' : '' %> @@ -73,7 +73,7 @@ %# refund links % $s = 0; -% if ( $payby{'BILL'} && $curuser->access_right(['Post refund', 'Post check refund']) ) { +% if ( $payby{'BILL'} && $curuser->access_right('Post refund') ) { <% $s++ ? ' | ' : '' %> <% include('/elements/popup_link-cust_main.html', 'label' => 'Enter check refund', @@ -86,7 +86,7 @@ %> % } -% if ( $payby{'CASH'} && $curuser->access_right(['Post refund', 'Post cash refund']) ) { +% if ( $payby{'CASH'} && $curuser->access_right('Post refund') ) { <% $s++ ? ' | ' : '' %> <% include('/elements/popup_link-cust_main.html', 'label' => 'Enter cash refund', @@ -412,16 +412,6 @@ foreach my $cust_pay ($cust_main->cust_pay) { }; } -#pending payments -foreach my $cust_pay_pending ($cust_main->cust_pay_pending) { - push @history, { - 'date' => $cust_pay_pending->_date, - 'desc' => include('payment_history/pending_payment.html', $cust_pay_pending, %opt ), - 'void_payment' => $cust_pay_pending->paid, - }; -} - - #voided payments foreach my $cust_pay_void ($cust_main->cust_pay_void) { push @history, { diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index e745864b7..6ec9fdb96 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -155,14 +155,11 @@ my $view = my $refund = ''; my $refund_days = $opt{'card_refund-days'} || 120; -my @rights = ('Refund payment'); -push @rights, 'Refund credit card payment' if $payby eq 'CARD'; -push @rights, 'Refund Echeck payment' if $payby eq 'CHEK'; if ( $cust_pay->closed !~ /^Y/i && $cust_pay->payby =~ /^(CARD|CHEK)$/ && time-$cust_pay->_date < $refund_days*86400 && $cust_pay->unrefunded > 0 - && $curuser->access_right(\@rights) + && $curuser->access_right('Refund payment') ) { $refund = qq! (<A HREF="${p}edit/cust_refund.cgi?payby=$1;!. qq!paynum=!. $cust_pay->paynum. '"'. diff --git a/httemplate/view/cust_main/payment_history/pending_payment.html b/httemplate/view/cust_main/payment_history/pending_payment.html deleted file mode 100644 index 40805b1aa..000000000 --- a/httemplate/view/cust_main/payment_history/pending_payment.html +++ /dev/null @@ -1,61 +0,0 @@ -<b><font size="+1" color="#FF0000">Pending payment </font></b> <% "$info $status ($link)" %> -<%init> - -my( $cust_pay_pending, %opt ) = @_; - -my $conf = new FS::Conf; - -my $curuser = $FS::CurrentUser::CurrentUser; - -my $payby = $cust_pay_pending->payby; - -my $payinfo; -if ( $payby eq 'CARD' ) { - $payinfo = $cust_pay_pending->paymask; -} elsif ( $payby eq 'CHEK' ) { - my( $account, $aba ) = split('@', $cust_pay_pending->paymask ); - $payinfo = "ABA $aba, Acct #$account"; -} else { - $payinfo = $cust_pay_pending->payinfo; -} - -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$//; -my $info = $payby ? "($payby$payinfo)" : ''; - -my %statusaction = ( - 'new' => 'delete', - 'pending' => 'complete', - 'captured' => 'capture', -); - -my $edit_pending = - $FS::CurrentUser::CurrentUser->access_right('Edit customer pending payments'); - -my $status = "Status: ".$cust_pay_pending->status; - -my $action = $statusaction{$cust_pay_pending->status}; - -my $link = ""; -if ( $action && $edit_pending ) { - $link = include('/elements/popup_link.html', - 'action' => $p. 'edit/cust_pay_pending.html'. - '?paypendingnum='. $cust_pay_pending->paypendingnum. - ";action=$action", - 'label' => $action, - 'color' => '#ff0000', - 'width' => 655, - 'height' => ( $action eq 'delete' ? 480 : 575 ), - 'actionlabel' => ucfirst($action). ' pending payment', - ); -} - -</%init> diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index 5d7f60cf5..be68ff091 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -1,10 +1,6 @@ -<DEL>Payment <% $info %> by <% $cust_pay_void->otaker %></DEL> +<DEL>Payment <% $info %></DEL> <I>voided <% time2str($date_format, $cust_pay_void->void_date) %> -% my $void_user = $cust_pay_void->void_access_user; -% if ($void_user) { - by <% $void_user->username %></I> -% } -<% $unvoid %> +by <% $cust_pay_void->otaker %></I><% $unvoid %> <%init> my( $cust_pay_void, %opt ) = @_; diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html index 1408b3db2..2f23d9e14 100644 --- a/httemplate/view/cust_pay.html +++ b/httemplate/view/cust_pay.html @@ -2,10 +2,7 @@ <% include('/elements/header-popup.html', "$thing Receipt" ) %> - <div align="center"> - <A HREF="javascript:self.parent.location = '<% $pr_link %>'">Print</A> | - <A HREF="javascript:self.location = '<% $email_link %>'">Re-email</A> - </div><BR> + <CENTER><A HREF="javascript:self.parent.location = '<% $pr_link %>'">Print</A></CENTER><BR> % } elsif ( $link eq 'print' ) { @@ -18,12 +15,7 @@ ) %> <BR><BR> -% } elsif ( $link eq 'email' ) { -% if ( $email_error ) { - <% include('/elements/header-popup.html', "Error re-emailing receipt: $email_error" ) %> -% } else { - <% include('/elements/header-popup.html', "Re-emailed receipt" ) %> -% } + % } else { <% include('/elements/header.html', "$thing Receipt", menubar( @@ -34,7 +26,7 @@ % } -% unless ($link =~ /^(popup|email)$/ ) { +% unless ($link eq 'popup' ) { <% include('/elements/small_custview.html', $custnum, scalar($conf->config('countrydefault')), @@ -118,14 +110,9 @@ window.print(); </SCRIPT> -% } elsif ( $link eq 'email' ) { - - <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); - </SCRIPT> - % } -% if ( $link =~ /^(popup|print|email)$/ ) { + +% if ( $link =~ /^(popup|print)$/ ) { </BODY> </HTML> % } else { @@ -162,7 +149,6 @@ my $cust_pay = qsearchs({ die "$thing #$paynum not found!" unless $cust_pay; my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum;void=$void"; -my $email_link = "${p}view/cust_pay.html?link=email;paynum=$paynum;void=$void"; my $custnum = $cust_pay->custnum; my $display_custnum = $cust_pay->cust_main->display_custnum; @@ -173,14 +159,4 @@ my $money_char = $conf->config('money_char') || '$'; tie my %payby, 'Tie::IxHash', FS::payby->payby2longname; -my $email_error; - -if ( $link eq 'email' ) { - my $email_error = $cust_pay->send_receipt( - 'manual' => 1, - ); - - warn "can't send payment receipt/statement: $email_error" if $email_error; -} - </%init> diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 8a352f3fa..852640e0c 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -21,13 +21,6 @@ ) </%doc> -<SCRIPT> -function areyousure(href) { - if (confirm("Permanently delete this <% $label %>?") == true) - window.location.href = href; -} -</SCRIPT> - % if ( $custnum ) { <% include("/elements/header.html","View $label: $value") %> @@ -43,13 +36,18 @@ function areyousure(href) { "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" )) %> + <SCRIPT> + function areyousure(href) { + if (confirm("Permanently delete this <% $label %>?") == true) + window.location.href = href; + } + </SCRIPT> + % } Service #<B><% $svcnum %></B> % my $url = $opt{'edit_url'} || $p. 'edit/'. $opt{'table'}. '.cgi?'; | <A HREF="<%$url%><%$svcnum%>">Edit this <% $label %></A> -| <A HREF="javascript:areyousure('<%$p.'misc/unprovision.cgi?'.$svcnum%>')"> -Unprovision this Service</A> <BR> <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %> diff --git a/httemplate/view/image.cgi b/httemplate/view/image.cgi deleted file mode 100644 index 153ec858e..000000000 --- a/httemplate/view/image.cgi +++ /dev/null @@ -1,31 +0,0 @@ -<% $data %>\ -<%init> - -#die "access denied" -# unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -my $conf = new FS::Conf; - -my $type; -if ( $cgi->param('type') eq 'png' ) { - $type = 'png'; -} elsif ( $cgi->param('type') eq 'eps' ) { - $type = 'eps'; -} else { - die "unknown image type ". $cgi->param('type'); -} - -my $data; -if ( $cgi->param('prefname') =~ /^(\w+)$/ ) { - - my $prefname = $1; - my $curuser = $FS::CurrentUser::CurrentUser; - $data = decode_base64( $curuser->option("$prefname") ); - -} else { - die "no preview_session specified"; -} - -http_header('Content-Type' => 'image/png' ); - -</%init> diff --git a/httemplate/view/svc_domain/dns.html b/httemplate/view/svc_domain/dns.html index 184286c31..82cab068a 100644 --- a/httemplate/view/svc_domain/dns.html +++ b/httemplate/view/svc_domain/dns.html @@ -7,30 +7,28 @@ return confirm("Remove all records and slave from " + document.SlaveForm.recdata.value + "?"); } </SCRIPT> -<% include('/elements/init_overlib.html') %> -<A NAME="dns"></A> <div class="fscontainer"> <div class="fsbox"> <div class="fsbox-title"> <span class="left">DNS Records</span> </div> -<% include('/elements/table-grid.html') %> +% my @records; if ( @records = $svc_domain->domain_record ) { + + <% include('/elements/table-grid.html') %> % my $bgcolor1 = '#eeeeee'; -% my $bgcolor2 = '#ffffff'; -% my $bgcolor = $bgcolor2; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = $bgcolor2; <tr> <th CLASS="grid" BGCOLOR="#cccccc">Zone</th> <th CLASS="grid" BGCOLOR="#cccccc">Type</th> <th CLASS="grid" BGCOLOR="#cccccc">Data</th> <th CLASS="grid" BGCOLOR="#cccccc">TTL</th> - <th CLASS="grid" BGCOLOR="#cccccc"></th> </tr> -% my @records = $svc_domain->domain_record; % foreach my $domain_record ( @records ) { % my $type = $domain_record->rectype eq '_mstr' % ? "(slave)" @@ -47,20 +45,9 @@ % unless ( $domain_record->rectype eq 'SOA' % || ! $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') % ) { -% my $edit_link = include('/elements/popup_link.html', -% 'label' => 'edit', -% 'action' => $p.'edit/domain_record.html?recnum='. -% $domain_record->recnum, -% 'actionlabel' => 'Edit nameservice record', -% 'width' => 655, -% 'height' => 176, -% #'color' => '#ff0000', -% ); % ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g; -% my $delete_url= "javascript:areyousure('${p}misc/delete-domain_record.cgi?". -% $domain_record->recnum. "', 'Delete ". -% $domain_record->reczone. " $type $recdata ?' )"; - <%$edit_link%> | <A HREF="<%$delete_url%>">delete</A> + (<A HREF="<%$p%>edit/domain_record.html?<%$domain_record->recnum%>">edit</A>) + (<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $recdata %>\' ?' )">delete</A>) % } </td> </tr> @@ -74,48 +61,50 @@ % } -% if ( ! @records ) { + </table> +% } else { <FORM METHOD="POST" NAME="DefaultForm" ACTION="<%$p%>edit/process/svc_domain-defaultrecords.cgi"> - <tr> - <td class="grid" BGCOLOR="#ffffff" COLSPAN=5> <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> <INPUT TYPE="submit" VALUE="Add default records"> - </td> - </tr> </FORM> % } % if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') ) { + <BR> <FORM METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi"> - <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> - <tr> - <td class="grid" bgcolor="<%$bgcolor%>"> - <INPUT TYPE="text" NAME="reczone"><BR> - <FONT SIZE="-1"><I>Zone</I></FONT> - </TD> - <TD class="grid" bgcolor="<%$bgcolor%>"> - <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> + <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>"> + <TABLE> + <TR> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="text" NAME="reczone"><BR> + <FONT SIZE="-1"><I>Zone</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN + </TD> + <TD ALIGN="right" VALIGN="top"> <SELECT NAME="rectype"> % foreach ( @{ FS::domain_record->rectypes } ) { - <OPTION VALUE="<%$_%>">IN <%$_%></OPTION> + <OPTION VALUE="<%$_%>"><%$_%></OPTION> % } </SELECT><BR> <FONT SIZE="-1"><I>Type</I></FONT> - </TD> - <TD class="grid" bgcolor="<%$bgcolor%>"> - <INPUT TYPE="text" NAME="recdata"><BR> - <FONT SIZE="-1"><I>Data</I></FONT> - </TD> - <TD class="grid" bgcolor="<%$bgcolor%>"> - <INPUT TYPE="text" NAME="ttl" size="6"><BR> - <FONT SIZE="-1"><I>TTL</I></FONT> - </TD> - <TD class="grid" bgcolor="<%$bgcolor%>" VALIGN="top"> - <INPUT TYPE="submit" VALUE="Add record"> - </TD> - </TR> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="text" NAME="recdata"><BR> + <FONT SIZE="-1"><I>Data</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="text" NAME="ttl" size="6"><BR> + <FONT SIZE="-1"><I>TTL</I></FONT> + </TD> + <TD ALIGN="right" VALIGN="top"> + <INPUT TYPE="submit" VALUE="Add record"> + </TD> + </TR> + </TABLE> </FORM> <BR> @@ -133,12 +122,9 @@ <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Slave domain" onClick="return slave_areyousure()"> </FORM> - <BR><BR> % } -</table> - </div> </div> <%init> diff --git a/httemplate/view/svc_pbx.cgi b/httemplate/view/svc_pbx.cgi deleted file mode 100644 index 79cafed4d..000000000 --- a/httemplate/view/svc_pbx.cgi +++ /dev/null @@ -1,72 +0,0 @@ -<% include('elements/svc_Common.html', - 'table' => 'svc_pbx', - 'edit_url' => $p."edit/svc_Common.html?svcdb=svc_pbx;svcnum=", - 'labels' => \%labels, - 'html_foot' => $html_foot, - ) -%> -<%init> - -my $fields = FS::svc_pbx->table_info->{'fields'}; -my %labels = map { $_ => ( ref($fields->{$_}) - ? $fields->{$_}{'label'} - : $fields->{$_} - ); - } - keys %$fields; - -my $html_foot = sub { - my $svc_pbx = shift; - - ## - # CDR links - ## - - tie my %what, 'Tie::IxHash', - 'pending' => 'NULL', - 'billed' => 'done', - ; - - #matching as per package def cdr_svc_method - my $cust_pkg = $svc_pbx->cust_svc->cust_pkg; - return '' unless $cust_pkg; - - my @voip_pkgs = - grep { $_->plan eq 'voip_cdr' } $cust_pkg->part_pkg->self_and_bill_linked; - if ( scalar(@voip_pkgs) > 1 ) { - warn "multiple voip_cdr packages bundled\n"; - return ''; - } elsif ( !@voip_pkgs ) { - warn "no voip_cdr packages\n"; - } - my $voip_pkg = @voip_pkgs[0]; - - my $cdr_svc_method = $voip_pkg->option('cdr_svc_method') - || 'svc_phone.phonenum'; - return '' unless $cdr_svc_method =~ /^svc_pbx\.(\w+)$/; - my $field = $1; - - my $search; - if ( $field eq 'title' ) { - $search = 'charged_party='. uri_escape($svc_pbx->title); - } elsif ( $field eq 'svcnum' ) { - $search = 'svcnum='. $svc_pbx->svcnum; - } else { - warn "unknown cdr_svc_method svc_pbx.$field"; - return ''; - } - - my @links = map { - qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;$search;freesidestatus=$what{$_}">). - "View $_ CDRs</A>"; - } keys(%what); - - ### - # concatenate & return - ### - - join(' | ', @links ). '<BR>'; - -}; - -</%init> |