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 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws.js"></SCRIPT>
8 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_iframe.js"></SCRIPT>
9 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_draggable.js"></SCRIPT>
10 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/iframecontentmws.js"></SCRIPT>
12 <SCRIPT TYPE="text/javascript">
13 function areyousure(href, message) {
14 if (confirm(message) == true)
15 window.location.href = href;
19 % if ( $curuser->access_right('Cancel customer')
20 % && $cust_main->ncancelled_pkgs
23 <% include( '/elements/popup_link-cust_main.html',
24 { 'action' => $p. 'misc/cancel_cust.html',
25 'label' => 'Cancel this customer',
26 'actionlabel' => 'Confirm Cancellation',
28 'cust_main' => $cust_main,
35 % if ( $conf->exists('deletecustomers')
36 % && $curuser->access_right('Delete customer')
38 <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>">Delete this customer</A> |
41 % unless ( $conf->exists('disable_customer_referrals') ) {
42 <A HREF="<% $p %>edit/cust_main.cgi?referral_custnum=<% $custnum %>">Refer a new customer</A> |
43 <A HREF="<% $p %>search/cust_main.cgi?referral_custnum=<% $custnum %>">View this customer's referrals</A>
48 % if ( $curuser->access_right('Billing event reports')
49 % || $curuser->access_right('View customer billing events')
52 <A HREF="<% $p %>search/cust_event.html?custnum=<% $custnum %>">View billing events for this customer</A>
57 %my $signupurl = $conf->config('signupurl');
59 This customer's signup URL: <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A><BR><BR>
63 <A NAME="cust_main"></A>
67 <% include('cust_main/contacts.html', $cust_main ) %>
69 <TD VALIGN="top" STYLE="padding-left: 54px">
70 <% include('cust_main/misc.html', $cust_main ) %>
71 % if ( $conf->config('payby-default') ne 'HIDE' ) {
74 <% include('cust_main/billing.html', $cust_main ) %>
81 %if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
86 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
88 <TD BGCOLOR="#ffffff">
89 <PRE><% encode_entities($cust_main->comments) %></PRE>
95 % my $notecount = scalar($cust_main->notes());
96 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
98 <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
99 % if ( $curuser->access_right('Add customer note') &&
100 % ! $conf->exists('cust_main-disable_notes')
103 <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<% $p %>edit/cust_main_note.cgi?custnum=<% $cust_main->custnum %>', 616, 386, 'cust_main_note_popup' ), CAPTION, 'Enter customer note', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;">Add customer note</A>
111 <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">
112 <div><br>[iframe not supported]<br><br></div>
115 % }else{ # make firefox happy wrt POSTDATA
117 <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">
118 <div><br>[iframe not supported]<br><br></div>
126 % if ( $conf->config('ticket_system') ) {
129 <% include('cust_main/tickets.html', $cust_main ) %>
135 % #XXX enable me# if ( $curuser->access_right('View customer packages') {
136 <% include('cust_main/packages.html', $cust_main ) %>
139 % if ( $conf->config('payby-default') ne 'HIDE' ) {
140 <% include('cust_main/payment_history.html', $cust_main ) %>
144 <% include('/elements/footer.html') %>
147 my $curuser = $FS::CurrentUser::CurrentUser;
150 unless $curuser->access_right('View customer');
152 my $conf = new FS::Conf;
154 die "No customer specified (bad URL)!" unless $cgi->keywords;
155 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
158 my $cust_main = qsearchs( {
159 'table' => 'cust_main',
160 'hashref' => { 'custnum' => $custnum },
161 'extra_sql' => ' AND '. $curuser->agentnums_sql,
163 die "Customer not found!" unless $cust_main;