no warnings 'redefine';
*CGI::redirect = sub {
my $self = shift;
- my $cookie = '';
- if ( $_[0] eq '-cookie' ) { #this isn't actually used at the moment
- (my $x, $cookie) = (shift, shift);
- $HTML::Mason::r->err_headers_out->add( 'Set-cookie' => $cookie );
- }
- my $location = shift;
use vars qw($m);
+ my $location = '';
+ if ( $_[0] =~ /^-/ ) {
+ my %opt = @_;
+ $location = $opt{'-uri'};
+ my $cookie = $opt{'-cookie'};
+ $m->apache_req->err_headers_out->{'Set-cookie'} = $cookie if $cookie;
+ } else {
+ $location = shift;
+ }
+
# false laziness w/below
if ( @DBIx::Profile::ISA ) {
<& /elements/header.html, {
'title' => $title,
'title_noescape' => $title_noescape,
- 'nobr' => 1,
+ #'nobr' => 1,
'etc' => $opt{'etc'},
}
&>
<% $title_noescape || encode_entities($title) %>
</H1>
+% my %cookies = CGI::Cookie->fetch($r);
+% if ( $cookies{freeside_status} ) {
+ <BR>
+% foreach my $status_msg ( $cookies{freeside_status}->value ) {
+ <TABLE CLASS="fsinnerbox" STYLE="background-color:#eeffee"><TR>
+ <TD><IMG SRC="<% $fsurl %>images/tick.png"> <% $status_msg |h %></TD>
+ </TR></TABLE>
+% }
+ <script src="<% $fsurl %>elements/js.cookie.js"></script>
+ <SCRIPT TYPE="text/javascript">
+ Cookies.remove('freeside_status', { path: '/' });
+ </SCRIPT>
+% }
+
% unless ( $nobr ) {
<BR>
% }
<& /elements/header-popup.html, emt("Package $past_method") &>
+ <script src="<% $fsurl %>elements/js.cookie.js"></script>
<SCRIPT TYPE="text/javascript">
+ Cookies.set('freeside_status', <% mt("Package $past_method") |js_string %>,{
+ expires: 0.0035
+ });
topreload();
</SCRIPT>
</BODY>
%if ( $error ) {
% errorpage($error);
%} else {
-<% $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')) %>
+% 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
+ )
+%>
%}
<%init>