diff options
author | ivan <ivan> | 2009-10-07 23:44:26 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-10-07 23:44:26 +0000 |
commit | 06187016fd78ba41fb82846b9e8d461405f316b6 (patch) | |
tree | 1a9106fd1da791f2270ad1e502c5951495ab322d /httemplate/view/cust_bill-ps.cgi | |
parent | cb4443b58fb55f5c2fe28f031616e80922a0431c (diff) |
naming follow-up notices from the event rather than creting a slew of separate templates, RT#5217
Diffstat (limited to 'httemplate/view/cust_bill-ps.cgi')
-rwxr-xr-x | httemplate/view/cust_bill-ps.cgi | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/httemplate/view/cust_bill-ps.cgi b/httemplate/view/cust_bill-ps.cgi index 5313dbf02..881491f69 100755 --- a/httemplate/view/cust_bill-ps.cgi +++ b/httemplate/view/cust_bill-ps.cgi @@ -1,14 +1,25 @@ -<% $cust_bill->print_ps( '', $templatename) %> +<% $cust_bill->print_ps(\%opt) %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); -#untaint invnum +my( $invnum, $template, $notice_name ); my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; -my $invnum = $3; +if ( $query =~ /^((.+)-)?(\d+)(.pdf)?$/ ) { + $template = $2; + $invnum = $3; + $notice_name = 'Invoice'; +} else { + $invnum = $cgi->param('invnum'); + $template = $cgi->param('template'); + $notice_name = ( $cgi->param('notice_name') || 'Invoice' ); +} + +my %opt = ( + 'template' => $template, + 'notice_name' => $notice_name, +); my $cust_bill = qsearchs({ 'select' => 'cust_bill.*', |