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 <% cust_cancel_link($cust_main) %> |
27 % if ( $conf->exists('deletecustomers')
28 % && $curuser->access_right('Delete customer')
30 <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>">Delete this customer</A> |
33 % unless ( $conf->exists('disable_customer_referrals') ) {
34 <A HREF="<% $p %>edit/cust_main.cgi?referral_custnum=<% $custnum %>">Refer a new customer</A> |
35 <A HREF="<% $p %>search/cust_main.cgi?referral_custnum=<% $custnum %>">View this customer's referrals</A>
40 % if ( $curuser->access_right('Billing event reports')
41 % || $curuser->access_right('View customer billing events')
44 <A HREF="<% $p %>search/cust_event.html?custnum=<% $custnum %>">View billing events for this customer</A>
49 %my $signupurl = $conf->config('signupurl');
51 This customer's signup URL: <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A><BR><BR>
55 <A NAME="cust_main"></A>
59 <% include('cust_main/contacts.html', $cust_main ) %>
61 <TD VALIGN="top" STYLE="padding-left: 54px">
62 <% include('cust_main/misc.html', $cust_main ) %>
63 % if ( $conf->config('payby-default') ne 'HIDE' ) {
66 <% include('cust_main/billing.html', $cust_main ) %>
73 %if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
78 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
80 <TD BGCOLOR="#ffffff">
81 <PRE><% encode_entities($cust_main->comments) %></PRE>
87 % my $notecount = scalar($cust_main->notes());
88 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
90 <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
91 % if ( $curuser->access_right('Add customer note') &&
92 % ! $conf->exists('cust_main-disable_notes')
95 <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>
103 <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">
104 <div><br>[iframe not supported]<br><br></div>
107 % }else{ # make firefox happy wrt POSTDATA
109 <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">
110 <div><br>[iframe not supported]<br><br></div>
118 % if ( $conf->config('ticket_system') ) {
121 <% include('cust_main/tickets.html', $cust_main ) %>
127 % #XXX enable me# if ( $curuser->access_right('View customer packages') {
128 <% include('cust_main/packages.html', $cust_main ) %>
131 % if ( $conf->config('payby-default') ne 'HIDE' ) {
132 <% include('cust_main/payment_history.html', $cust_main ) %>
136 <% include('/elements/footer.html') %>
139 my $curuser = $FS::CurrentUser::CurrentUser;
142 unless $curuser->access_right('View customer');
144 my $conf = new FS::Conf;
146 die "No customer specified (bad URL)!" unless $cgi->keywords;
147 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
150 my $cust_main = qsearchs( {
151 'table' => 'cust_main',
152 'hashref' => { 'custnum' => $custnum },
153 'extra_sql' => ' AND '. $curuser->agentnums_sql,
155 die "Customer not found!" unless $cust_main;
161 sub cust_cancel_link { cust_popup_link( 'misc/cancel_cust.html',
162 'Cancel this customer',
163 'Confirm Cancellation',
169 #false laziness w/view/cust_main/packages.html
171 sub cust_popup_link {
172 my($action, $label, $actionlabel, $color, $cust_main) = @_;
173 $action .= '?'. $cust_main->custnum;
174 popup_link($action, $label, $actionlabel, $color);
178 my($action, $label, $actionlabel, $color) = @_;
179 $color ||= '#333399';
180 qq!<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('$p$action', 540, 336, 'pkg_or_svc_action_popup' ), CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '' ); return false;">$label</A>!;
183 #WIDTH, 576, HEIGHT, 128, TEXTSIZE, 3,
184 #BGCOLOR, '#ff0000', CGCOLOR, '#ff0000'