X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=4ca777d6aed04381ec7d9ec72bfe521edc60fd1d;hb=eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd;hp=850b48b2751520fc31ff520893c09892efe7e566;hpb=32b5d3a31f112a381f0a15ac5e3a2204242f3405;p=freeside.git diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 850b48b27..4ca777d6a 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -16,52 +16,38 @@ function areyousure(href, message) { } - % if ( $curuser->access_right('Cancel customer') % && $cust_main->ncancelled_pkgs % ) { -% - Cancel this customer | + <% cust_cancel_link($cust_main) %> | + % } + % if ( $conf->exists('deletecustomers') % && $curuser->access_right('Delete customer') % ) { -% - Delete this customer | % } -% unless ( $conf->exists('disable_customer_referrals') ) { - Refer a new customer | - View this customer's referrals +% unless ( $conf->exists('disable_customer_referrals') ) { + Refer a new customer | + View this customer's referrals % } +

+% if ( $curuser->access_right('Billing event reports') +% || $curuser->access_right('View customer billing events') +% ) { + + View billing events for this customer +

+ +% } -

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

% } @@ -161,11 +147,41 @@ die "No customer specified (bad URL)!" unless $cgi->keywords; my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array $query =~ /^(\d+)$/; my $custnum = $1; -my $cust_main = qsearchs({ +my $cust_main = qsearchs( { 'table' => 'cust_main', - 'hashref' => {'custnum'=>$custnum}, + 'hashref' => { 'custnum' => $custnum }, 'extra_sql' => ' AND '. $curuser->agentnums_sql, }); die "Customer not found!" unless $cust_main; +<%once> + + +sub cust_cancel_link { cust_popup_link( 'misc/cancel_cust.html', + 'Cancel this customer', + 'Confirm Cancellation', + '#ff0000', + @_, + ); +} + +#false laziness w/view/cust_main/packages.html + +sub cust_popup_link { + my($action, $label, $actionlabel, $color, $cust_main) = @_; + $action .= '?'. $cust_main->custnum; + popup_link($action, $label, $actionlabel, $color); +} + +sub popup_link { + my($action, $label, $actionlabel, $color) = @_; + $color ||= '#333399'; + qq!$label!; + +# CLOSETEXT, '', +#WIDTH, 576, HEIGHT, 128, TEXTSIZE, 3, +#BGCOLOR, '#ff0000', CGCOLOR, '#ff0000' +} + +