From 41a6a1b1811e337be2fca47504ff9687b6b46cf8 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 19 Jun 2006 11:25:14 +0000 Subject: ACLs, take three or four or something --- httemplate/view/cust_main.cgi | 55 +++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 58f2925d5..e7b3319c7 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,4 +1,3 @@ - <% my $conf = new FS::Conf; @@ -12,13 +11,17 @@ foreach my $part_svc ( qsearch('part_svc',{}) ) { %> + <%= include("/elements/header.html","Customer View", include("/elements/menubar.html", 'Main Menu' => $p, )) %> + <% +my $curuser = $FS::CurrentUser::CurrentUser; + die "No customer specified (bad URL)!" unless $cgi->keywords; my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array $query =~ /^(\d+)$/; @@ -26,10 +29,14 @@ my $custnum = $1; my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); die "Customer not found!" unless $cust_main; -print qq!Edit this customer!; - %> + +<% if ( $curuser->access_right('Edit customer') ) { %> + Edit this customer | +<% } %> + + @@ -60,37 +67,36 @@ var confirm_cancel = '
Cancel this customer | +<% } %> - | Cancel this customer +<% if ( $conf->exists('deletecustomers') + && $curuser->access_right('Delete customer') + ) { +%> + Delete this customer | <% } %> -<% -print qq! | !. - 'Delete this customer' - if $conf->exists('deletecustomers'); +<% unless ( $conf->exists('disable_customer_referrals') ) { %> + Refer a new customer | + View this customer's referrals +<% } %> -unless ( $conf->exists('disable_customer_referrals') ) { - print qq! | !, - qq!Refer a new customer!; - print qq! | !, - qq!View this customer's referrals!; -} - -print '

'; +

+<% my $signupurl = $conf->config('signupurl'); if ( $signupurl ) { -print "This customer's signup URL: ". - "$signupurl?ref=$custnum

"; -} - %> + This customer's signup URL: <%= $signupurl %>?ref=<%= $custnum %>

+<% } %> @@ -135,5 +141,4 @@ Comments <%= include('cust_main/payment_history.html', $cust_main ) %> <% } %> - - +<%= include('/elements/footer.html') %> -- cgit v1.2.1