diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-11-11 12:48:15 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-11-11 12:48:15 -0800 |
commit | 5fc06d3c683c6d9a51508e2a50fa7e487af9294d (patch) | |
tree | ec8d55fdc15b61dc2757532101260b02d62ef470 | |
parent | 287b33b072a38c08535bc0c300ea48e0a587190c (diff) |
UX: acknowledge actions instead of silently redirecting
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 9 | ||||
-rwxr-xr-x | httemplate/misc/cust_main-cancel.cgi | 4 | ||||
-rwxr-xr-x | httemplate/misc/cust_main-suspend.cgi | 4 | ||||
-rwxr-xr-x | httemplate/misc/cust_main-unsuspend.cgi | 3 | ||||
-rwxr-xr-x | httemplate/misc/unsusp_pkg.cgi | 16 |
5 files changed, 27 insertions, 9 deletions
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 2cb1648..354e22e 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -15,7 +15,14 @@ % % } else { % -<% $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum) %> +<% $cgi->redirect( -uri => popurl(3). "view/cust_main.cgi?". $new->custnum, + -cookie => CGI::Cookie->new( + -name => 'freeside_status', + -value => mt('Customer edited'), + -expires => '+5m', + ), + ) +%> % % } <%once> diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi index 73c4deb..4348873 100755 --- a/httemplate/misc/cust_main-cancel.cgi +++ b/httemplate/misc/cust_main-cancel.cgi @@ -1,5 +1,9 @@ <& /elements/header-popup.html, mt("Customer cancelled") &> + <script src="<% $fsurl %>elements/js.cookie.js"></script> <SCRIPT TYPE="text/javascript"> + Cookies.set('freeside_status', <% mt("Customer cancelled") |js_string %>,{ + expires: 0.0035 + }); topreload(); </SCRIPT> </BODY> diff --git a/httemplate/misc/cust_main-suspend.cgi b/httemplate/misc/cust_main-suspend.cgi index e81e2b4..f20f20c 100755 --- a/httemplate/misc/cust_main-suspend.cgi +++ b/httemplate/misc/cust_main-suspend.cgi @@ -1,5 +1,9 @@ <& /elements/header-popup.html, mt("Customer suspended") &> + <script src="<% $fsurl %>elements/js.cookie.js"></script> <SCRIPT TYPE="text/javascript"> + Cookies.set('freeside_status', <% mt("Customer suspended") |js_string %>,{ + expires: 0.0035 + }); topreload(); </SCRIPT> </BODY> diff --git a/httemplate/misc/cust_main-unsuspend.cgi b/httemplate/misc/cust_main-unsuspend.cgi index 99ec70a..7ccd707 100755 --- a/httemplate/misc/cust_main-unsuspend.cgi +++ b/httemplate/misc/cust_main-unsuspend.cgi @@ -1,5 +1,8 @@ <& /elements/header-popup.html, mt("Customer unsuspended") &> <SCRIPT TYPE="text/javascript"> + Cookies.set('freeside_status', <% mt("Customer unsuspended") |js_string %>,{ + expires: 0.0035 + }); topreload(); </SCRIPT> </BODY> diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi index ad7effc..e7157db 100755 --- a/httemplate/misc/unsusp_pkg.cgi +++ b/httemplate/misc/unsusp_pkg.cgi @@ -1,15 +1,13 @@ %if ( $error ) { % errorpage($error); %} else { -% my $cookie = CGI::Cookie->new( -name => 'freeside_status', -% -value => mt('Package unsuspended'), -% -expires => '+5m', -% ); -% #$r->headers_out->add( 'Set-Cookie' => $cookie->as_string ); <% $cgi->redirect( - -uri => popurl(2). "view/cust_main.cgi?show=packages;custnum=".$cust_pkg->getfield('custnum'), - -cookie => $cookie - ) + -uri => popurl(2). "view/cust_main.cgi?show=packages;custnum=$custnum", + -cookie => CGI::Cookie->new( -name => 'freeside_status', + -value => mt('Package unsuspended'), + -expires => '+5m', + ), + ) %> %} <%init> @@ -26,4 +24,6 @@ my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); my $error = $cust_pkg->unsuspend; +my $custnum = $cust_pkg->custnum; + </%init> |