X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=af611bbbd76e6e697fcdfe6cda0c90704c3d80d9;hb=1598480a192e9a056834d636fbd7de7ae00dead6;hp=31fd1f81154d06ec0c512ecb9e0c53303c61f877;hpb=2d47f0f566b7e7afc30c050ec65fd9737194614d;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 31fd1f811..af611bbbd 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,138 +1,273 @@
-
-<%
+<& /elements/header.html, {
+ 'title' => $title,
+ 'title_noescape' => $title_noescape,
+ 'head' => $head,
+ 'nobr' => 1,
+ }
+&>
-my $conf = new FS::Conf;
-
-my %uiview = ();
-my %uiadd = ();
-foreach my $part_svc ( qsearch('part_svc',{}) ) {
- $uiview{$part_svc->svcpart} = $p. "view/". $part_svc->svcdb . ".cgi";
- $uiadd{$part_svc->svcpart}= $p. "edit/". $part_svc->svcdb . ".cgi";
-}
-
-%>
-
-<%= header("Customer View", menubar(
- 'Main Menu' => $p,
-)) %>
-
-<%
-
-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('cust_main',{'custnum'=>$custnum});
-die "Customer not found!" unless $cust_main;
+% my @part_tag = $cust_main->part_tag;
+% if ( $conf->config('cust_tag-location') eq 'top' && @part_tag ) {
+
-
-
-
+<& /elements/init_overlib.html &>
-
-
-<% if ( $cust_main->ncancelled_pkgs ) { %>
+
- |
Cancel this customer
+% ###
+% # Basics
+% ###
-<% } %>
+% if ( $view eq 'basics' ) {
-<%
+% my $br = 0;
+% if ( $curuser->access_right('Order customer package') && $conf->exists('cust_main-enable_order_package') ) {
+ | <& /elements/order_pkg_link.html, 'cust_main'=>$cust_main &>
+% }
-print qq! |
!.
- 'Delete this customer'
- if $conf->exists('deletecustomers');
+% if ( $conf->config('cust_main-external_links') ) {
+ <% $br++ ? ' | ' : '' %>
+% my @links = split(/\n/, $conf->config('cust_main-external_links'));
+% foreach my $link (@links) {
+% $link =~ /^\s*(\S+)\s+(.*?)(\s*\(([^\)]*)\))?$/ or next;
+% my($url, $label, $alt) = ($1, $2, $4);
+
<% $label |h %>
+% }
+% }
-unless ( $conf->exists('disable_customer_referrals') ) {
- print qq! |
!,
- qq!Refer a new customer!;
-
- print qq! |
!,
- qq!View this customer's referrals!;
-}
+% if ( $br ) {
+
+% }
-print '
';
+%my $signupurl = $conf->config('signupurl');
+%if ( $signupurl ) {
+ <% mt('This customer\'s signup URL:') |h %>
+
<% $signupurl %>?ref=<% $custnum %>
+
+% }
-my $signupurl = $conf->config('signupurl');
-if ( $signupurl ) {
-print "This customer's signup URL: ".
- "
$signupurl?ref=$custnum";
-}
-
-%>
-
-
-<%= &itable() %>
+
- <%= include('cust_main/contacts.html', $cust_main ) %>
+ <& cust_main/contacts.html, $cust_main &>
+
+ <& cust_main/misc.html, $cust_main &>
|
-
- <%= include('cust_main/misc.html', $cust_main ) %>
- <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
-
- <%= include('cust_main/billing.html', $cust_main ) %>
- <% } %>
+ |
+ <& cust_main/billing.html, $cust_main &>
+
+ <& cust_main/cust_payby.html, $cust_main &>
|
-
-
-<%
-if ( defined $cust_main->dbdef_table->column('comments')
- && $cust_main->comments =~ /[^\s\n\r]/ ) {
-%>
-
-Comments
-<%= ntable("#cccccc") %>
<%= ntable("#cccccc",2) %>
|
-
- <%= encode_entities($cust_main->comments) %>
+ |
+ <& cust_main/contacts_new.html, $cust_main &>
|
-
-<% } %>
+
+
+
+% }
-<% if ( $conf->config('ticket_system') ) { %>
+
+% ###
+% # Notes
+% ###
+% if ( $view eq 'notes' ) {
+ <& cust_main/notes.html, 'cust_main' => $cust_main &>
+
+% }
+
+
+% ###
+% # Tickets
+% ###
+
+% if ( $view eq 'tickets' ) {
+
+% if ( $conf->config('ticket_system') ) {
+ <& cust_main/tickets.html, $cust_main &>
+% }
- <%= include('cust_main/tickets.html', $cust_main ) %>
-<% } %>
-
-<%= include('cust_main/packages.html', $cust_main ) %>
+% }
+
+% ###
+% # Appointments
+% ###
+
+% if ( $view eq 'appointments' ) {
+
+% if ( $conf->config('ticket_system')
+% && $curuser->access_right('View appointments') ) {
+ <& cust_main/appointments.html, $cust_main &>
+% }
+
-<% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
- <%= include('cust_main/payment_history.html', $cust_main ) %>
-<% } %>
+% }
-