1 <% include("/elements/header.html","Customer View: ". $cust_main->name ) %>
3 % if ( $curuser->access_right('Edit customer') ) {
4 <A HREF="<% $p %>edit/cust_main.cgi?<% $custnum %>">Edit this customer</A> |
7 <% include('/elements/init_overlib.html') %>
9 <SCRIPT TYPE="text/javascript">
10 function areyousure(href, message) {
11 if (confirm(message) == true)
12 window.location.href = href;
16 % if ( $curuser->access_right('Cancel customer')
17 % && $cust_main->ncancelled_pkgs
20 <% include( '/elements/popup_link-cust_main.html',
21 { 'action' => $p. 'misc/cancel_cust.html',
22 'label' => 'Cancel this customer',
23 'actionlabel' => 'Confirm Cancellation',
25 'cust_main' => $cust_main,
32 % if ( $conf->exists('deletecustomers')
33 % && $curuser->access_right('Delete customer')
35 <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>">Delete this customer</A> |
38 % unless ( $conf->exists('disable_customer_referrals') ) {
39 <A HREF="<% $p %>edit/cust_main.cgi?referral_custnum=<% $custnum %>">Refer a new customer</A> |
40 <A HREF="<% $p %>search/cust_main.cgi?referral_custnum=<% $custnum %>">View this customer's referrals</A>
45 % if ( $curuser->access_right('Billing event reports')
46 % || $curuser->access_right('View customer billing events')
49 <A HREF="<% $p %>search/cust_event.html?custnum=<% $custnum %>">View billing events for this customer</A>
54 %my $signupurl = $conf->config('signupurl');
56 This customer's signup URL: <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A><BR><BR>
60 <A NAME="cust_main"></A>
64 <% include('cust_main/contacts.html', $cust_main ) %>
66 <TD VALIGN="top" STYLE="padding-left: 54px">
67 <% include('cust_main/misc.html', $cust_main ) %>
68 % if ( $conf->config('payby-default') ne 'HIDE' ) {
71 <% include('cust_main/billing.html', $cust_main ) %>
78 %if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
83 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
85 <TD BGCOLOR="#ffffff">
86 <PRE><% encode_entities($cust_main->comments) %></PRE>
92 % my $notecount = scalar($cust_main->notes());
93 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
95 <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
96 % if ( $curuser->access_right('Add customer note') &&
97 % ! $conf->exists('cust_main-disable_notes')
100 <% include( '/elements/popup_link-cust_main.html',
101 'label' => 'Add customer note',
102 'action' => $p. 'edit/cust_main_note.cgi',
103 'actionlabel' => 'Enter customer note',
104 'cust_main' => $cust_main,
116 <iframe src="<% $p %>view/cust_main/notes.html?custnum=<% $cust_main->custnum %>" height="186" width="616" name="cust_main_notes" frameborder="0" marginborder="0" marginheight="0" scrolling="auto">
117 <div><br>[iframe not supported]<br><br></div>
120 % }else{ # make firefox happy wrt POSTDATA
122 <iframe src="<% $p %>view/cust_main/notes.html?custnum=<% $cust_main->custnum %>" height="24" width="616" name="cust_main_notes" frameborder="0" marginborder="0" marginheight="0" scrolling="auto">
123 <div><br>[iframe not supported]<br><br></div>
131 % if ( $conf->config('ticket_system') ) {
134 <% include('cust_main/tickets.html', $cust_main ) %>
140 % #XXX enable me# if ( $curuser->access_right('View customer packages') {
141 <% include('cust_main/packages.html', $cust_main ) %>
144 % if ( $conf->config('payby-default') ne 'HIDE' ) {
145 <% include('cust_main/payment_history.html', $cust_main ) %>
149 <% include('/elements/footer.html') %>
152 my $curuser = $FS::CurrentUser::CurrentUser;
155 unless $curuser->access_right('View customer');
157 my $conf = new FS::Conf;
159 die "No customer specified (bad URL)!" unless $cgi->keywords;
160 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
163 my $cust_main = qsearchs( {
164 'table' => 'cust_main',
165 'hashref' => { 'custnum' => $custnum },
166 'extra_sql' => ' AND '. $curuser->agentnums_sql,
168 die "Customer not found!" unless $cust_main;