X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Fcust_main.cgi;h=95cb5da7cbf3e4ad21b331f8130187c2c2af6c48;hb=5376c66e2e5c1849763777f9d44ad013405c1d9e;hp=8f39f80bfdb6a0f8d9dd2deaa1625132fb14d114;hpb=2bb8b57782d966c231947bc4e82feed552a55b51;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 8f39f80bf..95cb5da7c 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,144 +1,265 @@
-
-<%
+<& /elements/header.html, {
+ 'title' => $title,
+ 'title_noescape' => $title_noescape,
+ 'head' => $head,
+ 'nobr' => 1,
+ }
+&>
+
+% my @part_tag = $cust_main->part_tag;
+% if ( $conf->config('cust_tag-location') eq 'top' && @part_tag ) {
+
-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";
+<& /elements/init_overlib.html &>
+
+
-%>
+
+
+% ###
+% # 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 &>
+% }
+
+% 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 %>
+% }
+% }
+
+% if ( $br ) {
+
+% }
+
+%my $signupurl = $conf->config('signupurl');
+%if ( $signupurl ) {
+ <% mt('This customer\'s signup URL:') |h %>
+
<% $signupurl %>?ref=<% $custnum %>
+
+% }
+
+
+
+
+ <& cust_main/contacts.html, $cust_main &>
+
+ <& cust_main/misc.html, $cust_main &>
+ |
+
+ <& cust_main/billing.html, $cust_main &>
+
+ <& cust_main/cust_payby.html, $cust_main &>
+ |
+
+
+
+ <& cust_main/contacts_new.html, $cust_main &>
+ |
+
+
+
-<%= header("Customer View", menubar(
- 'Main Menu' => $p,
-)) %>
+% }
-
-<%
+% ###
+% # Notes
+% ###
+% if ( $view eq 'notes' ) {
+ <& cust_main/notes.html, 'cust_main' => $cust_main &>
+
+% }
-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;
-print qq!
Edit this customer!;
+% ###
+% # Tickets
+% ###
-%>
+% if ( $view eq 'tickets' ) {
-
-
-
+% if ( $conf->config('ticket_system') ) {
+ <& cust_main/tickets.html, $cust_main &>
+% }
+
-
+% }
-
+% }
-<% if ( $cust_main->ncancelled_pkgs ) { %>
- |
Cancel this customer
+% ###
+% # Quotations
+% ###
-<% } %>
+% if ( $view eq 'quotations' ) {
-<%
+% if ( $curuser->access_right('Generate quotation') ) {
+ <& cust_main/quotations.html, $cust_main &>
+% }
-print qq! |
!.
- 'Delete this customer'
- if $conf->exists('deletecustomers');
+% }
-unless ( $conf->exists('disable_customer_referrals') ) {
- print qq! |
!,
- qq!Refer a new customer!;
- print qq! |
!,
- qq!View this customer's referrals!;
-}
+% ###
+% # Packages
+% ###
-print '
';
+% if ( $view eq 'packages' ) {
-my $signupurl = $conf->config('signupurl');
-if ( $signupurl ) {
-print "This customer's signup URL: ".
- "
$signupurl?ref=$custnum";
-}
+% #XXX enable me# if ( $curuser->access_right('View customer packages') {
+<& cust_main/packages.html, $cust_main &>
+% #}
+
-%>
+% }
-
-<%= &itable() %>
-
-
- <%= include('cust_main/contacts.html', $cust_main ) %>
- |
-
- <%= include('cust_main/misc.html', $cust_main ) %>
- <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
-
- <%= include('cust_main/billing.html', $cust_main ) %>
- <% } %>
- |
-
-
-<%
-if ( defined $cust_main->dbdef_table->column('comments')
- && $cust_main->comments =~ /[^\s\n\r]/ ) {
-%>
+% ###
+% # Payment History
+% ###
+
+% if ( $view eq 'payment_history' ) {
+
+<& cust_main/payment_history.html, $cust_main &>
-Comments
-<%= ntable("#cccccc") %>
<%= ntable("#cccccc",2) %>
- |
-
- <%= encode_entities($cust_main->comments) %>
- |
-
-
-<% } %>
-<% if ( $conf->config('ticket_system') ) { %>
-
- <%= include('cust_main/tickets.html', $cust_main ) %>
-<% } %>
+% }
-
-<%= include('cust_main/packages.html', $cust_main ) %>
-<% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
- <%= include('cust_main/payment_history.html', $cust_main ) %>
-<% } %>
+% ###
+% # Change History
+% ###
-