diff options
Diffstat (limited to 'httemplate/misc/process')
| -rwxr-xr-x | httemplate/misc/process/bulk_pkg_increment_bill.cgi | 2 | ||||
| -rwxr-xr-x | httemplate/misc/process/cancel_pkg.html | 12 | ||||
| -rw-r--r-- | httemplate/misc/process/change_pkg_contact.html | 2 | ||||
| -rwxr-xr-x | httemplate/misc/process/change_pkg_date.html (renamed from httemplate/misc/process/change_pkg_start.html) | 32 | ||||
| -rw-r--r-- | httemplate/misc/process/cust_bill-promised_date.html | 2 | ||||
| -rwxr-xr-x | httemplate/misc/process/delay_susp_pkg.html | 2 | ||||
| -rwxr-xr-x | httemplate/misc/process/enable_or_disable_tax.html | 2 | ||||
| -rw-r--r-- | httemplate/misc/process/nms-add_iface.html | 2 | ||||
| -rw-r--r-- | httemplate/misc/process/nms-add_router.html | 2 | ||||
| -rw-r--r-- | httemplate/misc/process/payment.cgi | 2 | ||||
| -rwxr-xr-x | httemplate/misc/process/recharge_svc.html | 2 | ||||
| -rw-r--r-- | httemplate/misc/process/set_page_pref.html | 12 | ||||
| -rwxr-xr-x | httemplate/misc/process/unhold_pkg.html | 2 | ||||
| -rwxr-xr-x | httemplate/misc/process/void-cust_bill.html | 2 |
14 files changed, 55 insertions, 23 deletions
diff --git a/httemplate/misc/process/bulk_pkg_increment_bill.cgi b/httemplate/misc/process/bulk_pkg_increment_bill.cgi index 0d8417b26..8da849508 100755 --- a/httemplate/misc/process/bulk_pkg_increment_bill.cgi +++ b/httemplate/misc/process/bulk_pkg_increment_bill.cgi @@ -4,7 +4,7 @@ %} else { <% header('Packages Adjusted') %> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY></HTML> % } diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index c7a43979d..46ba06a6d 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -1,6 +1,6 @@ <% header(emt("Package $past_method")) %> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY> </HTML> @@ -33,8 +33,10 @@ $method =~ /^(cancel|expire|suspend|adjourn|resume|uncancel)$/ $method = $1; my $past_method = $past{$method}; +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right($right{$method}); + unless $curuser->access_right($right{$method}); #untaint pkgnum my $pkgnum = $cgi->param('pkgnum'); @@ -60,7 +62,8 @@ if ( $method eq 'suspend' ) { #or 'adjourn' $options = { map { $_ => scalar($cgi->param($_)) } qw( suspend_bill no_suspend_bill ) - }; + } + if $curuser->access_right('Customize billing during suspension'); } my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); @@ -82,6 +85,8 @@ my $bill = my $svc_fatal = ( $cgi->param('svc_not_fatal') ne 'Y' ); +my $only_svcnum = ($method eq 'uncancel') ? [ $cgi->param('only_svcnum') ] : undef; + $error ||= $cust_pkg->$method( 'reason' => $reasonnum, 'date' => $date, 'resume_date' => $resume_date, @@ -89,6 +94,7 @@ $error ||= $cust_pkg->$method( 'reason' => $reasonnum, 'bill' => $bill, 'svc_fatal' => $svc_fatal, 'options' => $options, + 'only_svcnum' => $only_svcnum, ); if ($error) { diff --git a/httemplate/misc/process/change_pkg_contact.html b/httemplate/misc/process/change_pkg_contact.html index 2795c1197..5bf896200 100644 --- a/httemplate/misc/process/change_pkg_contact.html +++ b/httemplate/misc/process/change_pkg_contact.html @@ -1,6 +1,6 @@ <% header(emt("Package contact $past_method")) %> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY> </HTML> diff --git a/httemplate/misc/process/change_pkg_start.html b/httemplate/misc/process/change_pkg_date.html index 17a8518f9..3084ec538 100755 --- a/httemplate/misc/process/change_pkg_start.html +++ b/httemplate/misc/process/change_pkg_date.html @@ -6,9 +6,21 @@ </HTML> <%init> +my $field = $cgi->param('field'); + +my ($acl, $isstart); +if ($field eq 'start_date') { + $acl = 'Change package start date'; + $isstart = 1; +} elsif ($field eq 'contract_end') { + $acl = 'Change package contract end date'; +} else { + die "Unknown date field"; +} + my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" - unless $curuser->access_right('Change package start date'); + unless $curuser->access_right($acl); $cgi->param('pkgnum') =~ /^(\d+)$/ or die "illegal pkgnum"; @@ -24,23 +36,25 @@ my $cust_pkg = qsearchs({ my $cust_main = $cust_pkg->cust_main; my $error; -my $start_date; +my $date_value; if ( $cgi->param('when') eq 'now' ) { - # start it the next time billing runs - $start_date = ''; + # blank start means start it the next time billing runs ("Now") + # blank contract end means it never ends ("Never") + $date_value = ''; } elsif ( $cgi->param('when') eq 'next_bill_date' ) { - $start_date = $cust_main->next_bill_date; + $date_value = $cust_main->next_bill_date; } elsif ( $cgi->param('when') eq 'date' ) { - $start_date = parse_datetime($cgi->param('start_date')); + $date_value = parse_datetime($cgi->param('date_value')); } -if ( $cust_pkg->setup ) { +if ( $isstart && $cust_pkg->setup ) { # shouldn't happen $error = 'This package has already started billing.'; } else { local $FS::UID::AutoCommit = 0; foreach my $pkg ($cust_pkg, $cust_pkg->supplemental_pkgs) { - $pkg->set('start_date', $start_date); + last if $error; + $pkg->set($field, $date_value); $error ||= $pkg->replace; } $error ? dbh->rollback : dbh->commit; @@ -48,6 +62,6 @@ if ( $cust_pkg->setup ) { if ( $error ) { $cgi->param('error', $error); - print $cgi->redirect($fsurl.'misc/change_pkg_start.html?', $cgi->query_string); + print $cgi->redirect($fsurl.'misc/change_pkg_date.html?', $cgi->query_string); } </%init> diff --git a/httemplate/misc/process/cust_bill-promised_date.html b/httemplate/misc/process/cust_bill-promised_date.html index 721a763eb..f390609c7 100644 --- a/httemplate/misc/process/cust_bill-promised_date.html +++ b/httemplate/misc/process/cust_bill-promised_date.html @@ -1,4 +1,4 @@ -<SCRIPT TYPE="text/javascript">window.top.location.reload()</SCRIPT> +<SCRIPT TYPE="text/javascript">topreload()</SCRIPT> <%init> # XXX ACL? die "access denied" diff --git a/httemplate/misc/process/delay_susp_pkg.html b/httemplate/misc/process/delay_susp_pkg.html index 675da0496..15a3c963c 100755 --- a/httemplate/misc/process/delay_susp_pkg.html +++ b/httemplate/misc/process/delay_susp_pkg.html @@ -1,6 +1,6 @@ <% header($msg) %> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY> </HTML> diff --git a/httemplate/misc/process/enable_or_disable_tax.html b/httemplate/misc/process/enable_or_disable_tax.html index 9b7324b0d..8a7a559a0 100755 --- a/httemplate/misc/process/enable_or_disable_tax.html +++ b/httemplate/misc/process/enable_or_disable_tax.html @@ -4,7 +4,7 @@ <% include('/elements/header-popup.html', $title) %> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY> diff --git a/httemplate/misc/process/nms-add_iface.html b/httemplate/misc/process/nms-add_iface.html index 79e685686..cbd0fc048 100644 --- a/httemplate/misc/process/nms-add_iface.html +++ b/httemplate/misc/process/nms-add_iface.html @@ -1,6 +1,6 @@ <& /elements/header-popup.html, 'Interface added' &> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY></HTML> <%init> diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html index c3b42a8d3..a4c3423da 100644 --- a/httemplate/misc/process/nms-add_router.html +++ b/httemplate/misc/process/nms-add_router.html @@ -1,6 +1,6 @@ <& /elements/header-popup.html, 'Router added' &> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY></HTML> <%init> diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index d232fe729..7768f921f 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -86,7 +86,7 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { $payinfo = $cust_payby->payinfo; $paymask = $cust_payby->paymask; - $paycvv = ''; + $paycvv = $cust_payby->paycvv; # pass it if we got it, running a transaction will clear it ( $month, $year ) = $cust_payby->paydate_mon_year; $payname = $cust_payby->payname; diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html index 2d49f6b06..88a1f7f36 100755 --- a/httemplate/misc/process/recharge_svc.html +++ b/httemplate/misc/process/recharge_svc.html @@ -4,7 +4,7 @@ %} else { <% header("Package recharged") %> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY></HTML> %} diff --git a/httemplate/misc/process/set_page_pref.html b/httemplate/misc/process/set_page_pref.html new file mode 100644 index 000000000..a7f123116 --- /dev/null +++ b/httemplate/misc/process/set_page_pref.html @@ -0,0 +1,12 @@ +<%init> +my $path = $cgi->param('path'); +my $name = $cgi->param('name'); +my $tablenum = $cgi->param('num') || ''; +my $value = $cgi->param('value'); + +my $error = $FS::CurrentUser::CurrentUser->set_page_pref($path, $name, $tablenum, $value); +my $result = { 'error' => $error }; # in case someone cares + +http_header('Content-Type', 'application/json'); +</%init> +<% encode_json($result) %> diff --git a/httemplate/misc/process/unhold_pkg.html b/httemplate/misc/process/unhold_pkg.html index 694048023..7e54262c6 100755 --- a/httemplate/misc/process/unhold_pkg.html +++ b/httemplate/misc/process/unhold_pkg.html @@ -1,6 +1,6 @@ <& /elements/header-popup.html &> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY> </HTML> diff --git a/httemplate/misc/process/void-cust_bill.html b/httemplate/misc/process/void-cust_bill.html index 7773b0ba9..32a2fc591 100755 --- a/httemplate/misc/process/void-cust_bill.html +++ b/httemplate/misc/process/void-cust_bill.html @@ -4,7 +4,7 @@ %} else { <& /elements/header-popup.html, 'Invoice voided' &> <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); + topreload(); </SCRIPT> </BODY></HTML> %} |
