X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=4880ac3dcd1cca601d9a5ac96e603a936dd3ab60;hb=ee17093f5b41c1544d00a2670d26794aee33077a;hp=dcadf991219e5c4c63400f8761ea157ce20c1e62;hpb=4b80fe118da16b21603fcdbd090bc03d8fbf0578;p=freeside.git diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index dcadf9912..4880ac3dc 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -40,16 +40,50 @@ function areyousure(href, message) { } + +% ### +% # Basics +% ### + % if ( $view eq 'basics' || $view eq 'jumbo' ) { % if ( $curuser->access_right('Edit customer') ) { <% mt('Edit this customer') |h %> | % } -% 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 +94,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') -% ) { - <% mt('Delete this customer') |h %> | % } % unless ( $conf->exists('disable_customer_referrals') ) { @@ -100,15 +130,20 @@ function areyousure(href, message) { % % 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', +% 'table' => 'cust_main', +% 'search_hash' => { 'custnum' => $custnum }, +% 'agent_virt_agentnum' => $cust_main->agentnum, +% 'label' => 'Email a notice to this customer', % ); % if ( $email_link and $br ) { | % } <% $email_link || '' %> +% 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')); @@ -122,7 +157,6 @@ function areyousure(href, message) { % if ( $br ) {

% } - %my $signupurl = $conf->config('signupurl'); %if ( $signupurl ) { @@ -131,11 +165,6 @@ function areyousure(href, message) {

% } -%if ( $conf->exists('maestro-status_test') ) { - <% mt('Test maestro status') |h %> -

-% } - @@ -150,86 +179,36 @@ function areyousure(href, message) { -
- -% } - -% if ( $view eq 'notes' || $view eq 'jumbo' ) { - -%if ( $cust_main->comments =~ /[^\s\n\r]/ ) { -
<% mt('Comments') |h %> -<% ntable("#cccccc") %><% ntable("#cccccc",2) %> - -
<% encode_entities($cust_main->comments) %>
+ + <& cust_main/contacts_new.html, $cust_main &> - -

-% } - -% my $notecount = scalar($cust_main->notes(0)); -% if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { - -% unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { -
-
<% mt('Notes') |h %>
-% } + -% if ( $curuser->access_right('Add customer note') && -% ! $conf->exists('cust_main-disable_notes') -% ) { +% } - <& /elements/popup_link-cust_main.html, - 'label' => emt('Add customer note'), - 'action' => $p. 'edit/cust_main_note.cgi', - 'actionlabel' => emt('Enter customer note'), - 'cust_main' => $cust_main, - 'width' => 616, - 'height' => 538, #575 - &> -% } +% ### +% # Notes +% ### -
+% if ( $view eq 'notes' || $view eq 'jumbo' ) { -<& cust_main/notes.html, 'custnum' => $cust_main->custnum &> +<& cust_main/notes.html, 'cust_main' => $cust_main &> % } -
-% if(! $conf->config('disable_cust_attachment') -% and $curuser->access_right('Add attachment')) { -<& /elements/popup_link-cust_main.html, - 'label' => emt('Attach file'), - 'action' => $p.'edit/cust_main_attach.cgi', - 'actionlabel' => emt('Upload file'), - 'cust_main' => $cust_main, - 'width' => 480, - 'height' => 296, -&> -% } -% if( $curuser->access_right('View attachments') ) { -<& cust_main/attachments.html, 'custnum' => $cust_main->custnum &> -% if ($cgi->param('show_deleted')) { -">(<% mt('Show active attachments') |h %>) -% } -% elsif($curuser->access_right('View deleted attachments')) { -">(<% mt('Show deleted attachments') |h %>) -% } +% if ( $view eq 'jumbo' ) { +
% } +
-% } -% if ( $view eq 'jumbo' ) { -

- <% mt('Tickets') |h %>
-% } +% ### +% # Tickets +% ### % if ( $view eq 'tickets' || $view eq 'jumbo' ) { @@ -240,6 +219,42 @@ function areyousure(href, message) { % } +% ### +% # Appointments +% ### + +% if ( $view eq 'appointments' || $view eq 'jumbo' ) { + +% if ( $conf->config('ticket_system') +% && $curuser->access_right('View appointments') ) { + <& cust_main/appointments.html, $cust_main &> +% } +

+ +% } + + +% ### +% # Quotations +% ### + +% if ( $view eq 'jumbo' && $curuser->access_right('Generate quotation') ) { + <% mt('Quotations') |h %>
+% } + +% if ( $view eq 'quotations' || $view eq 'jumbo' ) { + +% if ( $curuser->access_right('Generate quotation') ) { + <& cust_main/quotations.html, $cust_main &> +% } + +% } + + +% ### +% # Packages +% ### + % if ( $view eq 'jumbo' ) { #XXX enable me && $curuser->access_right('View customer packages') { <% mt('Packages') |h %>
@@ -253,6 +268,11 @@ function areyousure(href, message) { % } + +% ### +% # Payment History +% ### + % if ( $view eq 'jumbo' ) {

<% mt('Payment History') |h %> @@ -267,12 +287,23 @@ function areyousure(href, message) { % } + +% ### +% # Change History +% ### + % if ( $view eq 'change_history' ) { # || $view eq 'jumbo' <& cust_main/change_history.html, $cust_main &> % } % 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?"; +% } % } @@ -294,6 +325,7 @@ if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array $query =~ /^(\d+)$/; $custnum = $1; + $cgi->param('custnum', $1); } my $cust_main = qsearchs( { @@ -310,18 +342,23 @@ $title = mt("Customer:")." ".$title; #false laziness w/pref/pref.html and Conf.pm (cust_main-default_view) tie my %views, 'Tie::IxHash', - emt('Basics') => 'basics', - emt('Notes') => 'notes', #notes and files? + emt('Basics') => 'basics', + emt('Notes') => 'notes', #notes and files? ; -$views{emt('Tickets')} = 'tickets' - if $conf->config('ticket_system'); -$views{emt('Packages')} = 'packages'; +if ( $conf->config('ticket_system') ) { + $views{emt('Tickets')} = 'tickets'; + $views{emt('Appointments')} = 'appointments' + if $curuser->access_right('View appointments'); +} +$views{emt('Quotations')} = 'quotations'; +$views{emt('Packages')} = 'packages'; $views{emt('Payment History')} = 'payment_history' unless $conf->config('payby-default' eq 'HIDE'); $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;