From: Mark Wells Date: Tue, 26 Jul 2016 22:06:36 +0000 (-0700) Subject: prevent reload loops on process pages, #71249 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=76b22e66bf8e615def0a24cd8cda23c3949eae70 prevent reload loops on process pages, #71249 --- diff --git a/httemplate/edit/process/bulk-cust_main_county.html b/httemplate/edit/process/bulk-cust_main_county.html index b7ff40fa7..b5a0258b1 100644 --- a/httemplate/edit/process/bulk-cust_main_county.html +++ b/httemplate/edit/process/bulk-cust_main_county.html @@ -12,7 +12,7 @@ <% include('/elements/header-popup.html', "Taxes ${action}ed") %> diff --git a/httemplate/edit/process/bulk-cust_svc-pkgnum.html b/httemplate/edit/process/bulk-cust_svc-pkgnum.html index f5cf7dd07..3c273069a 100644 --- a/httemplate/edit/process/bulk-cust_svc-pkgnum.html +++ b/httemplate/edit/process/bulk-cust_svc-pkgnum.html @@ -7,7 +7,7 @@ <% header(emt("Services moved")) %> diff --git a/httemplate/edit/process/cgp_rule-simplified.html b/httemplate/edit/process/cgp_rule-simplified.html index 60769d4e6..24515d551 100644 --- a/httemplate/edit/process/cgp_rule-simplified.html +++ b/httemplate/edit/process/cgp_rule-simplified.html @@ -4,7 +4,7 @@ % } else { #success XXX better msg talking about vacation vs. redirect all <% include('/elements/header-popup.html', 'Rule updated') %> diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html index 308ea8ffd..54cafbf18 100644 --- a/httemplate/edit/process/change-cust_pkg.html +++ b/httemplate/edit/process/change-cust_pkg.html @@ -5,7 +5,7 @@ <% header(emt("Package changed")) %> diff --git a/httemplate/edit/process/credit-cust_bill_pkg.html b/httemplate/edit/process/credit-cust_bill_pkg.html index 75900bde5..12b68c0f5 100644 --- a/httemplate/edit/process/credit-cust_bill_pkg.html +++ b/httemplate/edit/process/credit-cust_bill_pkg.html @@ -3,7 +3,7 @@ %} else { <& /elements/header-popup.html, 'Credit successful' &> % } diff --git a/httemplate/edit/process/cust_credit-pkgnum.html b/httemplate/edit/process/cust_credit-pkgnum.html index 8941cbc73..56f7989a4 100755 --- a/httemplate/edit/process/cust_credit-pkgnum.html +++ b/httemplate/edit/process/cust_credit-pkgnum.html @@ -4,7 +4,7 @@ %} else { <% header(emt('Credit package changed')) %> diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 39c6f1997..5d3028777 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -16,7 +16,7 @@ % <% header(emt('Credit successful')) %> diff --git a/httemplate/edit/process/cust_location-censustract.html b/httemplate/edit/process/cust_location-censustract.html index bc9cd4f31..6edaca3fd 100644 --- a/httemplate/edit/process/cust_location-censustract.html +++ b/httemplate/edit/process/cust_location-censustract.html @@ -5,7 +5,7 @@ <% header("Census tract changed") %> diff --git a/httemplate/edit/process/cust_location.cgi b/httemplate/edit/process/cust_location.cgi index fd1b8740e..3a2388111 100644 --- a/httemplate/edit/process/cust_location.cgi +++ b/httemplate/edit/process/cust_location.cgi @@ -5,7 +5,7 @@ <% header("Location changed") %> diff --git a/httemplate/edit/process/cust_main_attach.cgi b/httemplate/edit/process/cust_main_attach.cgi index 09c18adcb..569500246 100644 --- a/httemplate/edit/process/cust_main_attach.cgi +++ b/httemplate/edit/process/cust_main_attach.cgi @@ -9,7 +9,7 @@ % $act = 'deleted' if($attachnum and $delete); <% header('Attachment ' . $act ) %> % } diff --git a/httemplate/edit/process/cust_main_county-add.cgi b/httemplate/edit/process/cust_main_county-add.cgi index fc8956b0c..fcc138f49 100755 --- a/httemplate/edit/process/cust_main_county-add.cgi +++ b/httemplate/edit/process/cust_main_county-add.cgi @@ -1,7 +1,7 @@ <% include('/elements/header-popup.html', 'Addition successful' ) %> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index a10827621..42e46734a 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,7 +1,7 @@ <% include('/elements/header-popup.html', 'Addition successful' ) %> diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index 53e616a43..bb52db8f3 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -4,7 +4,7 @@ %} else { <% header('Note ' . ($notenum ? 'updated' : 'added') ) %> % } diff --git a/httemplate/edit/process/cust_pay-no_auto_apply.cgi b/httemplate/edit/process/cust_pay-no_auto_apply.cgi index ccbd2d7b5..4a5ee841a 100644 --- a/httemplate/edit/process/cust_pay-no_auto_apply.cgi +++ b/httemplate/edit/process/cust_pay-no_auto_apply.cgi @@ -15,7 +15,7 @@ Requires 'Apply payment' acl.

<% emt($message) %>

<% emt('Please wait while the page reloads.') %>

% } diff --git a/httemplate/edit/process/cust_pay-pkgnum.html b/httemplate/edit/process/cust_pay-pkgnum.html index d9a92a1de..cefe970fe 100755 --- a/httemplate/edit/process/cust_pay-pkgnum.html +++ b/httemplate/edit/process/cust_pay-pkgnum.html @@ -4,7 +4,7 @@ %} else { <% header(emt('Payment package changed')) %> diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index 56d3f2ff1..d85267cb1 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -14,7 +14,7 @@ % <% header(emt('Payment entered')) %> diff --git a/httemplate/edit/process/cust_pay_pending.html b/httemplate/edit/process/cust_pay_pending.html index 0ff7d26d0..80bd14aaf 100644 --- a/httemplate/edit/process/cust_pay_pending.html +++ b/httemplate/edit/process/cust_pay_pending.html @@ -3,7 +3,7 @@ Error: <% $error |h %> % } else { % } diff --git a/httemplate/edit/process/cust_pkg_detail.html b/httemplate/edit/process/cust_pkg_detail.html index 132ff63c5..25fabd930 100644 --- a/httemplate/edit/process/cust_pkg_detail.html +++ b/httemplate/edit/process/cust_pkg_detail.html @@ -6,7 +6,7 @@ % } else { <% header($action) %> % } diff --git a/httemplate/edit/process/cust_pkg_discount.html b/httemplate/edit/process/cust_pkg_discount.html index 143611ef9..963546363 100644 --- a/httemplate/edit/process/cust_pkg_discount.html +++ b/httemplate/edit/process/cust_pkg_discount.html @@ -5,7 +5,7 @@ <% header("Discount applied") %> diff --git a/httemplate/edit/process/cust_pkg_quantity.html b/httemplate/edit/process/cust_pkg_quantity.html index fb2657252..b60595583 100644 --- a/httemplate/edit/process/cust_pkg_quantity.html +++ b/httemplate/edit/process/cust_pkg_quantity.html @@ -5,7 +5,7 @@ <& /elements/header-popup.html, "Quantity changed" &> diff --git a/httemplate/edit/process/cust_pkg_salesnum.html b/httemplate/edit/process/cust_pkg_salesnum.html index aab37416a..c1cb26813 100644 --- a/httemplate/edit/process/cust_pkg_salesnum.html +++ b/httemplate/edit/process/cust_pkg_salesnum.html @@ -5,7 +5,7 @@ <& /elements/header-popup.html, "Sales Person changed" &> diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index 8977ced20..d4236bcdf 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -7,7 +7,7 @@ % <% header('Refund entered') %> diff --git a/httemplate/edit/process/cust_tax_adjustment.html b/httemplate/edit/process/cust_tax_adjustment.html index 204b5b9f7..fe232757f 100644 --- a/httemplate/edit/process/cust_tax_adjustment.html +++ b/httemplate/edit/process/cust_tax_adjustment.html @@ -4,7 +4,7 @@ % } else { <% header("Tax adjustment added") %> diff --git a/httemplate/edit/process/detach-cust_pkg.html b/httemplate/edit/process/detach-cust_pkg.html index 782ffa5e0..34c580560 100644 --- a/httemplate/edit/process/detach-cust_pkg.html +++ b/httemplate/edit/process/detach-cust_pkg.html @@ -5,7 +5,7 @@ <% header(emt("Package detached")) %> diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi index 8369f7114..9d869d547 100755 --- a/httemplate/edit/process/domain_record.cgi +++ b/httemplate/edit/process/domain_record.cgi @@ -3,7 +3,7 @@ %} elsif ( $recnum ) { #editing <% header('Nameservice record changed') %> %} else { #adding diff --git a/httemplate/edit/process/elements/ApplicationCommon.html b/httemplate/edit/process/elements/ApplicationCommon.html index a73b1bccd..67fa89196 100644 --- a/httemplate/edit/process/elements/ApplicationCommon.html +++ b/httemplate/edit/process/elements/ApplicationCommon.html @@ -26,7 +26,7 @@ Examples: %} else { <% header("$src_thing application$to sucessful") %> diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 60aaf749a..76722c960 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -188,7 +188,7 @@ process(); <% include('/elements/header-popup.html', $opt{'popup_reload'} ) %> diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index d1b8e1086..00d17c8b1 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -1,4 +1,13 @@ +% if ( $error ) { +% $cgi->param('error', $error ); <% $cgi->redirect($redirect) %> +% } else { +<% header(emt($message)) %> + + +% } <%init> my $curuser = $FS::CurrentUser::CurrentUser; diff --git a/httemplate/edit/process/quotation_pkg_detail.html b/httemplate/edit/process/quotation_pkg_detail.html index b836baebc..5728832b2 100644 --- a/httemplate/edit/process/quotation_pkg_detail.html +++ b/httemplate/edit/process/quotation_pkg_detail.html @@ -6,7 +6,7 @@ % } else { <% header($action) %> % } diff --git a/httemplate/elements/header-full.html b/httemplate/elements/header-full.html index 07595a539..850eaed8c 100644 --- a/httemplate/elements/header-full.html +++ b/httemplate/elements/header-full.html @@ -53,7 +53,7 @@ Example: % } <% include('init_overlib.html') |n %> <% include('rs_init_object.html') |n %> - + <% $head |n %> %# announce our base path, and the Mason comp path of this page diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html index 6c0f80b37..839a63676 100644 --- a/httemplate/elements/header-popup.html +++ b/httemplate/elements/header-popup.html @@ -34,6 +34,7 @@ Example: % } % } + <% $head |n %> > diff --git a/httemplate/elements/topreload.js b/httemplate/elements/topreload.js new file mode 100644 index 000000000..a66703b29 --- /dev/null +++ b/httemplate/elements/topreload.js @@ -0,0 +1,5 @@ +window.topreload = function() { + if (window != window.top) { + window.top.location.reload(); + } +} diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi index f6fd1e915..73c4deb7a 100755 --- a/httemplate/misc/cust_main-cancel.cgi +++ b/httemplate/misc/cust_main-cancel.cgi @@ -1,6 +1,6 @@ <& /elements/header-popup.html, mt("Customer cancelled") &> diff --git a/httemplate/misc/cust_main-suspend.cgi b/httemplate/misc/cust_main-suspend.cgi index 7a501d61a..e81e2b490 100755 --- a/httemplate/misc/cust_main-suspend.cgi +++ b/httemplate/misc/cust_main-suspend.cgi @@ -1,6 +1,6 @@ <& /elements/header-popup.html, mt("Customer suspended") &> diff --git a/httemplate/misc/cust_main-unsuspend.cgi b/httemplate/misc/cust_main-unsuspend.cgi index e8ac8d31e..99ec70a23 100755 --- a/httemplate/misc/cust_main-unsuspend.cgi +++ b/httemplate/misc/cust_main-unsuspend.cgi @@ -1,6 +1,6 @@ <& /elements/header-popup.html, mt("Customer unsuspended") &> diff --git a/httemplate/misc/delete-addr_range.html b/httemplate/misc/delete-addr_range.html index c6310e9b1..239332d23 100644 --- a/httemplate/misc/delete-addr_range.html +++ b/httemplate/misc/delete-addr_range.html @@ -3,7 +3,7 @@ % } else { <& /elements/header-popup.html, "Address range deleted" &> diff --git a/httemplate/misc/delete-rate_detail.html b/httemplate/misc/delete-rate_detail.html index 30856a73a..b4d31b379 100755 --- a/httemplate/misc/delete-rate_detail.html +++ b/httemplate/misc/delete-rate_detail.html @@ -3,7 +3,7 @@ % } else { <% header('Rate deleted') %> % } diff --git a/httemplate/misc/did_order_confirmed.html b/httemplate/misc/did_order_confirmed.html index 53dbb2f3a..3cc121c6f 100644 --- a/httemplate/misc/did_order_confirmed.html +++ b/httemplate/misc/did_order_confirmed.html @@ -14,7 +14,7 @@ die "access denied" my $action = $1; my $header = ''; my $popup = ''; -my $js = 'window.top.location.reload();'; +my $js = 'topreload();'; $cgi->param('ordernum') =~ /^(\d+)$/ or die 'illegal ordernum'; my $ordernum = $1; diff --git a/httemplate/misc/disable-cust_location.cgi b/httemplate/misc/disable-cust_location.cgi index ee7ba1dbc..677f0b891 100755 --- a/httemplate/misc/disable-cust_location.cgi +++ b/httemplate/misc/disable-cust_location.cgi @@ -1,6 +1,6 @@ <% header("Location disabled") %> diff --git a/httemplate/misc/disable-msg_template.cgi b/httemplate/misc/disable-msg_template.cgi index 1eb4d25e5..565eb2cee 100644 --- a/httemplate/misc/disable-msg_template.cgi +++ b/httemplate/misc/disable-msg_template.cgi @@ -3,7 +3,7 @@ % } else { <& /elements/header-popup.html, "Template ${actioned}" &> 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') %> % } diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index eb3b2efe6..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")) %> 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")) %> 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 @@ - + <%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) %> 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) %> 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' &> <%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' &> <%init> 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") %> %} 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 &> 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' &> %} diff --git a/httemplate/misc/reason-merge.html b/httemplate/misc/reason-merge.html index 14f5ebb84..b7e4df454 100644 --- a/httemplate/misc/reason-merge.html +++ b/httemplate/misc/reason-merge.html @@ -1,7 +1,7 @@ % if ($success) { <% include('/elements/header-popup.html', 'Reason Merge Success') %> % } else { <% include('/elements/header-popup.html', 'Merge Reasons') %> diff --git a/httemplate/misc/void-cust_credit.html b/httemplate/misc/void-cust_credit.html index 1e71f0030..81ba31d54 100755 --- a/httemplate/misc/void-cust_credit.html +++ b/httemplate/misc/void-cust_credit.html @@ -1,7 +1,7 @@ %if ( $success ) { <& /elements/header-popup.html, mt("Credit voided") &>