-<% $cgi->redirect($redirect) %>
+<% $cgi->redirect(@redirect) %>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
}
-my $redirect;
+my @redirect = ();
if ( $error ) {
$cgi->param('error', $error );
- $redirect = $p.'quick-charge.html?'. $cgi->query_string;
+ @redirect = ( $p.'quick-charge.html?'. $cgi->query_string );
} elsif ( $quotation ) {
- $redirect = $fsurl.'view/quotation.html?' . $quotation->quotationnum;
+ @redirect = (
+ -uri => $fsurl.'view/quotation.html?' . $quotation->quotationnum,
+ -cookie => CGI::Cookie->new( -name => 'freeside_status',
+ -value => mt('One-time charge added to quotation'),
+ -expires => '+5m',
+ ),
+ );
} else {
- $redirect = $fsurl.'view/cust_main.cgi?custnum=' . $cust_main->custnum . ';show=last';
+ @redirect = (
+ -uri => $fsurl.'view/cust_main.cgi?custnum='. $cust_main->custnum.
+ ';show=last',
+ -cookie => CGI::Cookie->new( -name => 'freeside_status',
+ -value => mt('One-time charge ordered'),
+ -expires => '+5m',
+ ),
+ );
}
</%init>
-% if ( $quotationnum ) {
-<& /elements/header.html, mt('One-time charge') &>
+% if ( $quotationnum && ! $cust_main ) {
+<& /elements/header.html, mt('Quotation #[_1]: add one-time charge', $quotationnum) &>
% } else {
<& /elements/header-cust_main.html,
- view => 'packages',
+ view => $quotationnum ? 'quotations' : 'packages',
cust_main => $cust_main,
etc => $cgi->param('error') ? '' : 'onload="addRow()"',
&>
-<h2>One-time charge</h2>
+<h2><% $quotationnum
+ ? emt('Quotation #[_1]: add one-time charge', $quotationnum)
+ : mt('One-time charge')
+ %></h2>
% }
<& /elements/init_calendar.html &>