1 <& /elements/header.html, {
3 'title_noescape' => $title_noescape,
9 % my @part_tag = $cust_main->part_tag;
10 % if ( $conf->config('cust_tag-location') eq 'top' && @part_tag ) {
11 <TABLE STYLE="margin-bottom:8px" CELLSPACING=2>
12 % foreach my $part_tag ( @part_tag ) {
16 <% length($part_tag->tagcolor)
17 ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"'
19 %>><% $part_tag->tagname.': '. $part_tag->tagdesc |h %></FONT>
26 <& cust_main/menu.html, cust_main => $cust_main, show => $view &>
27 <DIV CLASS="fstabcontainer">
29 <& /elements/init_overlib.html &>
31 <SCRIPT TYPE="text/javascript">
32 function areyousure(href, message) {
33 if (confirm(message) == true)
34 window.location.href = href;
44 % if ( $view eq 'basics' || $view eq 'jumbo' ) {
47 % if ( $curuser->access_right('Order customer package') && $conf->exists('cust_main-enable_order_package') ) {
48 | <& /elements/order_pkg_link.html, 'cust_main'=>$cust_main &>
51 % if ( $conf->config('cust_main-external_links') ) {
52 <% $br++ ? ' | ' : '' %>
53 % my @links = split(/\n/, $conf->config('cust_main-external_links'));
54 % foreach my $link (@links) {
55 % $link =~ /^\s*(\S+)\s+(.*?)(\s*\(([^\)]*)\))?$/ or next;
56 % my($url, $label, $alt) = ($1, $2, $4);
57 <A HREF="<% $url.$custnum %>" ALT="<% $alt |h %>"><% $label |h %></A>
65 %my $signupurl = $conf->config('signupurl');
67 <% mt('This customer\'s signup URL:') |h %>
68 <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A>
72 <A NAME="cust_main"></A>
76 <& cust_main/contacts.html, $cust_main &>
78 <& cust_main/misc.html, $cust_main &>
80 <TD VALIGN="top" STYLE="padding-left: 54px">
81 <& cust_main/billing.html, $cust_main &>
83 <& cust_main/cust_payby.html, $cust_main &>
88 <& cust_main/contacts_new.html, $cust_main &>
100 % if ( $view eq 'notes' || $view eq 'jumbo' ) {
102 <& cust_main/notes.html, 'cust_main' => $cust_main &>
106 % if ( $view eq 'jumbo' ) {
117 % if ( $view eq 'tickets' || $view eq 'jumbo' ) {
119 % if ( $conf->config('ticket_system') ) {
120 <& cust_main/tickets.html, $cust_main &>
130 % if ( $view eq 'appointments' || $view eq 'jumbo' ) {
132 % if ( $conf->config('ticket_system')
133 % && $curuser->access_right('View appointments') ) {
134 <& cust_main/appointments.html, $cust_main &>
145 % if ( $view eq 'jumbo' && $curuser->access_right('Generate quotation') ) {
146 <A NAME="quotations"><FONT SIZE="+2"><% mt('Quotations') |h %></FONT></A><BR>
149 % if ( $view eq 'quotations' || $view eq 'jumbo' ) {
151 % if ( $curuser->access_right('Generate quotation') ) {
152 <& cust_main/quotations.html, $cust_main &>
162 % if ( $view eq 'jumbo' ) { #XXX enable me && $curuser->access_right('View customer packages') {
164 <A NAME="cust_pkg"><FONT SIZE="+2"><% mt('Packages') |h %></FONT></A><BR>
167 % if ( $view eq 'packages' || $view eq 'jumbo' ) {
169 % #XXX enable me# if ( $curuser->access_right('View customer packages') {
170 <& cust_main/packages.html, $cust_main &>
180 % if ( $view eq 'jumbo' ) {
182 <A NAME="history"><FONT SIZE="+2"><% mt('Payment History') |h %></FONT></A>
186 % if ( $view eq 'payment_history' || $view eq 'jumbo' ) {
188 <& cust_main/payment_history.html, $cust_main &>
197 % if ( $view eq 'change_history' ) { # || $view eq 'jumbo'
198 <& cust_main/change_history.html, $cust_main &>
201 % if ( $view eq 'custom' ) {
202 % if ( $conf->config('cust_main-custom_link') ) {
203 <& cust_main/custom.html, $cust_main &>
204 % } elsif ( $conf->config('cust_main-custom_content') ) {
205 <& cust_main/custom_content.html, $cust_main &>
207 % # warn "custom view without cust_main-custom_link or -custom_content?";
212 <& /elements/footer.html &>
215 my $curuser = $FS::CurrentUser::CurrentUser;
218 unless $curuser->access_right('View customer');
220 my $conf = new FS::Conf;
223 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
226 die "No customer specified (bad URL)!" unless $cgi->keywords;
227 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
230 $cgi->delete('keywords');
231 $cgi->param('custnum', $1);
234 my $cust_main = qsearchs( {
235 'table' => 'cust_main',
236 'hashref' => { 'custnum' => $custnum },
237 'extra_sql' => ' AND '. $curuser->agentnums_sql,
239 die "Customer not found!" unless $cust_main;
241 my $title = encode_entities($cust_main->name);
242 $title = '#'. $cust_main->display_custnum. " $title";
243 # if $conf->exists('cust_main-title-display_custnum');
244 $title = mt("Customer")." ".$title;
246 my @agentnums = $curuser->agentnums;
247 if (scalar(@agentnums) > 1 ) {
248 $title = encode_entities($cust_main->agent->agent). " $title";
251 my $status = $cust_main->status_label;
252 $status .= ' (Cancelled)' if $cust_main->is_status_delay_cancel;
253 my $title_noescape = $title. ' (<B><FONT COLOR="#'. $cust_main->statuscolor. '">'. $status. '</FONT></B>)';
254 $title .= " ($status)";
256 #false laziness w/pref/pref.html and Conf.pm (cust_main-default_view)
257 tie my %views, 'Tie::IxHash',
258 emt('Basics') => 'basics',
259 emt('Notes') => 'notes', #notes and files?
261 if ( $conf->config('ticket_system') ) {
262 $views{emt('Tickets')} = 'tickets';
263 $views{emt('Appointments')} = 'appointments'
264 if $curuser->access_right('View appointments');
266 $views{emt('Quotations')} = 'quotations';
267 $views{emt('Packages')} = 'packages';
268 $views{emt('Payment History')} = 'payment_history';
269 $views{emt('Change History')} = 'change_history'
270 if $curuser->access_right('View customer history');
271 $views{$conf->config('cust_main-custom_title') || emt('Custom')} = 'custom'
272 if $conf->config('cust_main-custom_link')
273 || $conf->config('cust_main-custom_content');
274 $views{emt('Jumbo')} = 'jumbo';
276 my %viewname = reverse %views;
278 my $view = $cgi->param('show') || $curuser->default_customer_view;
280 my $ie_compat = $conf->config('ie-compatibility_mode');
283 $head = qq(<meta http-equiv="X-UA-Compatible" content="IE=$ie_compat" />);