remove customer deletion
[freeside.git] / httemplate / view / cust_main.cgi
index fb3bfc3..430c50c 100755 (executable)
@@ -43,13 +43,42 @@ function areyousure(href, message) {
 % if ( $view eq 'basics' || $view eq 'jumbo' ) {
 
 % if ( $curuser->access_right('Edit customer') ) { 
-  <A HREF="<% $p %>edit/cust_main.cgi?<% $custnum %>">Edit this customer</A> | 
+  <A HREF="<% $p %>edit/cust_main.cgi?<% $custnum %>"><% mt('Edit this customer') |h %></A> | 
 % } 
 
-% if ( $curuser->access_right('Cancel customer')
-%        && $cust_main->ncancelled_pkgs
+% if ( $curuser->access_right('Suspend customer')
+%        && scalar($cust_main->unsuspended_pkgs)
 %      ) {
+  <& /elements/popup_link-cust_main.html,
+              { 'action'      => $p. 'misc/suspend_cust.html',
+                'label'       => emt('Suspend this customer'),
+                'actionlabel' => emt('Confirm Suspension'),
+                'color'       => '#ff9900',
+                'cust_main'   => $cust_main,
+                'width'       => 616, #make room for reasons
+                'height'      => 366,
+              }
+  &> | 
+% }
 
+% if ( $curuser->access_right('Unsuspend customer')
+%        && scalar($cust_main->suspended_pkgs)
+%      ) {
+  <& /elements/popup_link-cust_main.html,
+              { 'action'      => $p. 'misc/unsuspend_cust.html',
+                'label'       => emt('Unsuspend this customer'),
+                'actionlabel' => emt('Confirm Unsuspension'),
+                #'color'       => '#ff9900',
+                'cust_main'   => $cust_main,
+                #'width'       => 616, #make room for reasons
+                #'height'      => 366,
+              }
+  &> | 
+% }
+
+% if ( $curuser->access_right('Cancel customer')
+%        && scalar($cust_main->ncancelled_pkgs)
+%      ) {
   <& /elements/popup_link-cust_main.html,
               { 'action'      => $p. 'misc/cancel_cust.html',
                 'label'       => emt('Cancel this customer'),
@@ -60,27 +89,23 @@ function areyousure(href, message) {
                 'height'      => 366,
               }
   &> | 
-
 % }
 
-% if ( $curuser->access_right('Merge customer') ) {
-
+% if (     $curuser->access_right('Merge customer')
+%      and (    scalar($cust_main->ncancelled_pkgs)
+%            # || we start supporting payment info merge again in some way
+%          )
+%    )
+% {
   <& /elements/popup_link-cust_main.html,
               { 'action'      => $p. 'misc/merge_cust.html',
                 'label'       => emt('Merge this customer'),
                 'actionlabel' => emt('Merge customer'),
                 'cust_main'   => $cust_main,
-                'width'       => 480,
-                'height'      => 192,
+                'width'       => 569,
+                'height'      => 210,
               }
   &> | 
-
-% } 
-
-% if ( $conf->exists('deletecustomers')
-%        && $curuser->access_right('Delete customer')
-%      ) {
-  <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>"><% mt('Delete this customer') |h %></A> | 
 % } 
 
 % unless ( $conf->exists('disable_customer_referrals') ) { 
@@ -97,6 +122,17 @@ function areyousure(href, message) {
 % $br=1;
   <A HREF="<% $p %>search/cust_event.html?custnum=<% $custnum %>"><% mt('View billing events for this customer') |h %></A>
 % }
+% 
+% my $email_link = ($cust_main->invoicing_list_emailonly) && 
+%   include('/elements/email-link.html',
+%            'table' => 'cust_main', 
+%            'search_hash' => { 'custnum' => $custnum },
+%            'label' => 'Email a notice to this customer',
+% );
+% if ( $email_link and $br ) {
+ | 
+% }
+<% $email_link || '' %>
 
 % if ( $conf->config('cust_main-external_links') ) {
     <% $br++ ? ' | ' : '' %>
@@ -120,11 +156,6 @@ function areyousure(href, message) {
   <BR><BR>
 % } 
 
-%if ( $conf->exists('maestro-status_test') ) {
-  <A HREF="<% $p %>misc/maestro-customer_status-test.html?<% $custnum %>"><% mt('Test maestro status') |h %></A>
-  <BR><BR>
-% } 
-
 <A NAME="cust_main"></A>
 <TABLE BORDER=0>
 <TR>
@@ -139,6 +170,11 @@ function areyousure(href, message) {
 
   </TD>
 </TR>
+<TR>
+  <TD COLSPAN = 2>
+    <& cust_main/contacts_new.html, $cust_main &>
+  </TD>
+</TR>
 </TABLE>
 
 % }
@@ -216,9 +252,9 @@ function areyousure(href, message) {
 % }
 
 % if ( $view eq 'jumbo' ) {
-    <BR><BR>
-    <A NAME="tickets"><FONT SIZE="+2"><% mt('Tickets') |h %></FONT></A><BR>
+    <BR>
 % }
+<BR>
 
 % if ( $view eq 'tickets' || $view eq 'jumbo' ) {
 
@@ -261,7 +297,13 @@ function areyousure(href, message) {
 % }
 
 % if ( $view eq 'custom' ) { 
+%   if ( $conf->config('cust_main-custom_link') ) {
 <& cust_main/custom.html, $cust_main &>
+%   } elsif ( $conf->config('cust_main-custom_content') ) {
+      <& cust_main/custom_content.html, $cust_main &>
+%   #} else {
+%   #  warn "custom view without cust_main-custom_link or -custom_content?";
+%   }
 % }
 
 </DIV>
@@ -295,7 +337,7 @@ die "Customer not found!" unless $cust_main;
 my $title = $cust_main->name;
 $title = '('. $cust_main->display_custnum. ") $title"
   if $conf->exists('cust_main-title-display_custnum');
-$title = "Customer: $title";
+$title = mt("Customer:")." ".$title;
 
 #false laziness w/pref/pref.html and Conf.pm (cust_main-default_view)
 tie my %views, 'Tie::IxHash',
@@ -310,7 +352,8 @@ $views{emt('Payment History')} =  'payment_history'
 $views{emt('Change History')}  =  'change_history'
   if $curuser->access_right('View customer history');
 $views{$conf->config('cust_main-custom_title') || emt('Custom')} =  'custom'
-  if $conf->config('cust_main-custom_link');
+  if $conf->config('cust_main-custom_link')
+  || $conf->config('cust_main-custom_content');
 $views{emt('Jumbo')}           =  'jumbo';
 
 my %viewname = reverse %views;