From: ivan Date: Sun, 30 Mar 2008 02:42:53 +0000 (+0000) Subject: don't show invoice resend and payment posting links if you can't do that anyway X-Git-Tag: root_of_webpay_support~785 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=cf9ea3b22181348e70df1faf826bb783e296301f;p=freeside.git don't show invoice resend and payment posting links if you can't do that anyway --- diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 25a7ea051..2860f7a4d 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -213,15 +213,18 @@ function confirm_fax_process() { '; -my $menubar = [ - 'Print these invoices' => - "javascript:confirm_print_process()", - 'Email these invoices' => - "javascript:confirm_email_process()", - ]; - -push @$menubar, 'Fax these invoices' => - "javascript:confirm_fax_process()" - if $conf->exists('hylafax'); +my $menubar = []; + +if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { + + push @$menubar, 'Print these invoices' => + "javascript:confirm_print_process()", + 'Email these invoices' => + "javascript:confirm_email_process()"; + + push @$menubar, 'Fax these invoices' => + "javascript:confirm_fax_process()" + if $conf->exists('hylafax'); +} diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 951725531..db30d3ecc 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -4,56 +4,56 @@ % if ( $cust_bill->owed > 0 -% && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} || $payby{'MCRD'} ) -% ) -% { +% && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) ) +% && $FS::CurrentUser::CurrentUser->access_right('Post payment') +% ) +% { % my $s = 0; - Post -% if ( $payby{'BILL'} ) { + Post - - <% $s++ ? ' | ' : '' %> - check -% } -% if ( $payby{'CASH'} ) { +% if ( $payby{'BILL'} ) { + <% $s++ ? ' | ' : '' %> + check +% } - - <% $s++ ? ' | ' : '' %> - cash -% } -% if ( $payby{'WEST'} ) { +% if ( $payby{'CASH'} ) { + <% $s++ ? ' | ' : '' %> + cash +% } - - <% $s++ ? ' | ' : '' %> - Western Union -% } -% if ( $payby{'MCRD'} ) { +% if ( $payby{'WEST'} ) { + <% $s++ ? ' | ' : '' %> + Western Union +% } - - <% $s++ ? ' | ' : '' %> - manual credit card -% } +% if ( $payby{'MCRD'} ) { + <% $s++ ? ' | ' : '' %> + manual credit card +% } + payment against this invoice

- payment against this invoice
% } -Re-print this invoice -% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { +% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { - | Re-email - this invoice -% } -% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { + Re-print this invoice + +% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { + | Re-email this invoice +% } + +% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { + | Re-fax this invoice +% } + +

- | Re-fax - this invoice % } -

% if ( $conf->exists('invoice_latex') ) { View typeset invoice