From 8588f3c0bfbcbeb58dd25a57b5ea375cec00279a Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 16 Jun 2009 03:29:26 +0000 Subject: basic customer view tabs, RT#5586 --- httemplate/view/cust_main.cgi | 104 +++++++++++++++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 16 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 2231d4148..00856a021 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,8 +1,19 @@ -<% include("/elements/header.html","Customer View: ". $cust_main->name ) %> +<% include('/elements/header.html', { + 'title' => "Customer View: ". $cust_main->name, + 'nobr' => 1, + }) +%> +
-% if ( $curuser->access_right('Edit customer') ) { - Edit this customer | -% } +<% include('/elements/menubar.html', + { 'newstyle' => 1, + 'selected' => $viewname{$view}, + 'url_base' => $cgi->url. "?custnum=$custnum;show=", + }, + %views, + ) +%> +
<% include('/elements/init_overlib.html') %> @@ -13,6 +24,12 @@ function areyousure(href, message) { } +% if ( $view eq 'basics' || $view eq 'jumbo' ) { + +% if ( $curuser->access_right('Edit customer') ) { + Edit this customer | +% } + % if ( $curuser->access_right('Cancel customer') % && $cust_main->ncancelled_pkgs % ) { @@ -74,10 +91,12 @@ function areyousure(href, message) { -% -%if ( $cust_main->comments =~ /[^\s\n\r]/ ) { -% +% } + +% if ( $view eq 'notes' || $view eq 'jumbo' ) { + +%if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
Comments <% ntable("#cccccc") %><% ntable("#cccccc",2) %> @@ -87,12 +106,16 @@ Comments -% }

+% } + % my $notecount = scalar($cust_main->notes()); % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { -Notes
+% unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { + Notes
+% } + % if ( $curuser->access_right('Add customer note') && % ! $conf->exists('cust_main-disable_notes') % ) { @@ -115,24 +138,47 @@ Comments % } +% } -% if ( $conf->config('ticket_system') ) { +% if ( $view eq 'jumbo' ) { +

+ Tickets
+% } -

+% if ( $view eq 'tickets' || $view eq 'jumbo' ) { + +% if ( $conf->config('ticket_system') ) { <% include('cust_main/tickets.html', $cust_main ) %> % } +

+% } -

+% if ( $view eq 'jumbo' ) { #XXX enable me && $curuser->access_right('View customer packages') { + + Packages
+% } + +% if ( $view eq 'packages' || $view eq 'jumbo' ) { % #XXX enable me# if ( $curuser->access_right('View customer packages') { <% include('cust_main/packages.html', $cust_main ) %> % #} +% } + +% if ( $view eq 'jumbo' ) { +

+ Payment History
+% } + +% if ( $view eq 'payment_history' || $view eq 'jumbo' ) { + % if ( $conf->config('payby-default') ne 'HIDE' ) { <% include('cust_main/payment_history.html', $cust_main ) %> % } +% } <% include('/elements/footer.html') %> <%init> @@ -144,10 +190,16 @@ die "access denied" my $conf = new FS::Conf; -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 $custnum; +if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { + $custnum = $1; +} else { + die "No customer specified (bad URL)!" unless $cgi->keywords; + my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array + $query =~ /^(\d+)$/; + $custnum = $1; +} + my $cust_main = qsearchs( { 'table' => 'cust_main', 'hashref' => { 'custnum' => $custnum }, @@ -155,4 +207,24 @@ my $cust_main = qsearchs( { }); die "Customer not found!" unless $cust_main; +#false laziness w/pref/pref.html +tie my %views, 'Tie::IxHash', + 'Basics' => 'basics', + 'Notes' => 'notes', #notes and files? +; +$views{'Tickets'} = 'tickets' + if $conf->config('ticket_system'); +$views{'Packages'} = 'packages'; +$views{'Payment History'} = 'payment_history' + unless $conf->config('payby-default' eq 'HIDE'); +#$views{'Change History'} = ''; +$views{'Jumbo'} = 'jumbo'; + +my %viewname = reverse %views; + + +my $view = $cgi->param('show') + || $curuser->option('default_customer_view') + || 'jumbo'; #'Basics' in 1.9.1? + -- cgit v1.2.1 From 3a02c437eadd9a39f7e56056ca987a4846650209 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 17 Jun 2009 02:39:09 +0000 Subject: finish up initial work on customer view tabs (ensure links back to customer view call include show=packages if default view isn't jumbo or packages already), RT#5586 --- httemplate/view/cust_main.cgi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 00856a021..88fd03713 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -207,7 +207,7 @@ my $cust_main = qsearchs( { }); die "Customer not found!" unless $cust_main; -#false laziness w/pref/pref.html +#false laziness w/pref/pref.html and Conf.pm (cust_main-default_view) tie my %views, 'Tie::IxHash', 'Basics' => 'basics', 'Notes' => 'notes', #notes and files? @@ -222,9 +222,6 @@ $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; - -my $view = $cgi->param('show') - || $curuser->option('default_customer_view') - || 'jumbo'; #'Basics' in 1.9.1? +my $view = $cgi->param('show') || $curuser->default_customer_view; -- cgit v1.2.1 From e1b1693a656964c6db0b8a3fb85494014434dcb1 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 28 Jul 2009 21:17:45 +0000 Subject: adding a basic change history using history tables, RT#1005, RT#4357 --- httemplate/view/cust_main.cgi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 88fd03713..78bcb1fc1 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -113,6 +113,7 @@ Comments % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { +
Notes
% } @@ -180,6 +181,10 @@ Comments % } +% if ( $view eq 'change_history' ) { # || $view eq 'jumbo' + <% include('cust_main/change_history.html', $cust_main ) %> +% } + <% include('/elements/footer.html') %> <%init> @@ -213,11 +218,12 @@ tie my %views, 'Tie::IxHash', 'Notes' => 'notes', #notes and files? ; $views{'Tickets'} = 'tickets' - if $conf->config('ticket_system'); + if $conf->config('ticket_system'); $views{'Packages'} = 'packages'; $views{'Payment History'} = 'payment_history' - unless $conf->config('payby-default' eq 'HIDE'); -#$views{'Change History'} = ''; + unless $conf->config('payby-default' eq 'HIDE'); +$views{'Change History'} = 'change_history' + if $curuser->access_right('View customer history'); $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; -- cgit v1.2.1 From 283ea2b5137ae3ec36882b492e6de024b0ce6027 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 9 Aug 2009 09:05:38 +0000 Subject: Add cust_attachment stuff --- httemplate/view/cust_main.cgi | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 78bcb1fc1..da1a56a96 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -113,7 +113,6 @@ Comments % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { -
Notes
% } @@ -138,6 +137,22 @@ Comments <% include('cust_main/notes.html', 'custnum' => $cust_main->custnum ) %> % } +
+ +% if(! $conf->config('disable_cust_attachment') +% and $curuser->access_right('Add attachment')) { +<% include( '/elements/popup_link-cust_main.html', + 'label' => 'Attach file', + 'action' => $p.'edit/cust_main_attach.cgi', + 'actionlabel' => 'Upload file', + 'cust_main' => $cust_main, + 'width' => 616, + 'height' => 408, + ) +%> +% } +<% include('cust_main/attachments.html', 'custnum' => $cust_main->custnum ) %> +
% } @@ -181,10 +196,6 @@ Comments % } -% if ( $view eq 'change_history' ) { # || $view eq 'jumbo' - <% include('cust_main/change_history.html', $cust_main ) %> -% } - <% include('/elements/footer.html') %> <%init> @@ -218,12 +229,11 @@ tie my %views, 'Tie::IxHash', 'Notes' => 'notes', #notes and files? ; $views{'Tickets'} = 'tickets' - if $conf->config('ticket_system'); + if $conf->config('ticket_system'); $views{'Packages'} = 'packages'; $views{'Payment History'} = 'payment_history' - unless $conf->config('payby-default' eq 'HIDE'); -$views{'Change History'} = 'change_history' - if $curuser->access_right('View customer history'); + unless $conf->config('payby-default' eq 'HIDE'); +#$views{'Change History'} = ''; $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; -- cgit v1.2.1 From ae898cc8e6de40fbecb30c973f91cd955434b159 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 10 Aug 2009 23:04:57 +0000 Subject: Improve handling of deleted attachments --- httemplate/view/cust_main.cgi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index da1a56a96..bbdfe5166 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -108,7 +108,7 @@ Comments

% } - + % my $notecount = scalar($cust_main->notes()); % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { @@ -152,6 +152,16 @@ Comments %> % } <% include('cust_main/attachments.html', 'custnum' => $cust_main->custnum ) %> +% if($cgi->param('show_deleted')) { +">(Show active attachments) +% } +% elsif($curuser->access_right('View deleted attachments')) { +">(Show deleted attachments) +% }
% } -- cgit v1.2.1 From 6d406c07de8348a0a0e5ec1e8f2a3d8ffe5309cd Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 13 Aug 2009 09:25:02 +0000 Subject: fix reverted changes. grr. RT#4964 --- httemplate/view/cust_main.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index bbdfe5166..3e5a8cee3 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -113,6 +113,7 @@ Comments % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { +
Notes
% } @@ -206,6 +207,10 @@ Comments % } +% if ( $view eq 'change_history' ) { # || $view eq 'jumbo' +<% include('cust_main/change_history.html', $cust_main ) %> +% } + <% include('/elements/footer.html') %> <%init> @@ -243,7 +248,8 @@ $views{'Tickets'} = 'tickets' $views{'Packages'} = 'packages'; $views{'Payment History'} = 'payment_history' unless $conf->config('payby-default' eq 'HIDE'); -#$views{'Change History'} = ''; +$views{'Change History'} = 'change_history' + if $curuser->access_right('View customer history'); $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; -- cgit v1.2.1 From 2c35c432f6cd3be7e40edd360b1d91eb788ed55e Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 4 Oct 2009 00:08:42 +0000 Subject: more room for cancellation reason --- httemplate/view/cust_main.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 3e5a8cee3..314207bb0 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -40,6 +40,7 @@ function areyousure(href, message) { 'actionlabel' => 'Confirm Cancellation', 'color' => '#ff0000', 'cust_main' => $cust_main, + 'width' => 616, #make room for reasons } ) %> | -- cgit v1.2.1