From c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 31 Jan 2006 04:26:54 +0000 Subject: move header() to include(/elements/header.html) so it can be changed in one place, thanks to Scott Edwards --- httemplate/view/cust_main.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 59c1a4b73..4975c52fd 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -12,7 +12,7 @@ foreach my $part_svc ( qsearch('part_svc',{}) ) { %> -<%= header("Customer View", menubar( +<%= include("/elements/header.html","Customer View", menubar( 'Main Menu' => $p, )) %> -- cgit v1.2.1 From b3d608b436cdf673a5552acf9e4b4601f4f79b9d Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 9 Mar 2006 11:48:06 +0000 Subject: don't use a table with WIDTH="100%", it shoves the custnum and "billing information" boxes way out to the right --- httemplate/view/cust_main.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 4975c52fd..082a93bb7 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -92,12 +92,12 @@ print "This customer's signup URL: ". %> -<%= &itable() %> + -
<%= include('cust_main/contacts.html', $cust_main ) %> + <%= include('cust_main/misc.html', $cust_main ) %> <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
-- cgit v1.2.1 From 7bdf17a005cf4c0fe8b6b6ad1ce97abaa52a4510 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 9 Apr 2006 23:41:01 +0000 Subject: a few more fixups for our favorite include(...) from Scott Edwards --- httemplate/view/cust_main.cgi | 3 ++- 1 file changed, 2 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 082a93bb7..58f2925d5 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -12,7 +12,8 @@ foreach my $part_svc ( qsearch('part_svc',{}) ) { %> -<%= include("/elements/header.html","Customer View", menubar( +<%= include("/elements/header.html","Customer View", + include("/elements/menubar.html", 'Main Menu' => $p, )) %> -- cgit v1.2.1 From 41a6a1b1811e337be2fca47504ff9687b6b46cf8 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 19 Jun 2006 11:25:14 +0000 Subject: ACLs, take three or four or something --- httemplate/view/cust_main.cgi | 55 +++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 58f2925d5..e7b3319c7 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,4 +1,3 @@ - <% my $conf = new FS::Conf; @@ -12,13 +11,17 @@ foreach my $part_svc ( qsearch('part_svc',{}) ) { %> + <%= include("/elements/header.html","Customer View", include("/elements/menubar.html", 'Main Menu' => $p, )) %> + <% +my $curuser = $FS::CurrentUser::CurrentUser; + die "No customer specified (bad URL)!" unless $cgi->keywords; my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array $query =~ /^(\d+)$/; @@ -26,10 +29,14 @@ my $custnum = $1; my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); die "Customer not found!" unless $cust_main; -print qq!Edit this customer!; - %> + +<% if ( $curuser->access_right('Edit customer') ) { %> + Edit this customer | +<% } %> + + @@ -60,37 +67,36 @@ var confirm_cancel = '
Cancel this customer | +<% } %> - | Cancel this customer +<% if ( $conf->exists('deletecustomers') + && $curuser->access_right('Delete customer') + ) { +%> + Delete this customer | <% } %> -<% -print qq! | !. - 'Delete this customer' - if $conf->exists('deletecustomers'); +<% unless ( $conf->exists('disable_customer_referrals') ) { %> + Refer a new customer | + View this customer's referrals +<% } %> -unless ( $conf->exists('disable_customer_referrals') ) { - print qq! | !, - qq!Refer a new customer!; - print qq! | !, - qq!View this customer's referrals!; -} - -print '

'; +

+<% my $signupurl = $conf->config('signupurl'); if ( $signupurl ) { -print "This customer's signup URL: ". - "$signupurl?ref=$custnum

"; -} - %> + This customer's signup URL: <%= $signupurl %>?ref=<%= $custnum %>

+<% } %> @@ -135,5 +141,4 @@ Comments <%= include('cust_main/payment_history.html', $cust_main ) %> <% } %> - - +<%= include('/elements/footer.html') %> -- cgit v1.2.1 From 265a8a9728e907ccee97ed395e6eca3014deb890 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 21 Jun 2006 12:58:43 +0000 Subject: need the OLiframecontent sub --- 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 e7b3319c7..89ddc38f2 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -40,6 +40,7 @@ die "Customer not found!" unless $cust_main; + @@ -33,96 +35,100 @@ function areyousure(href, message) { +% if ( $curuser->access_right('Cancel customer') +% && $cust_main->ncancelled_pkgs +% ) { +% -<% if ( $curuser->access_right('Cancel customer') - && $cust_main->ncancelled_pkgs - ) { -%> Cancel this customer | -<% } %> - +% } +% if ( $conf->exists('deletecustomers') +% && $curuser->access_right('Delete customer') +% ) { +% -<% if ( $conf->exists('deletecustomers') - && $curuser->access_right('Delete customer') - ) { -%> - Delete this customer | -<% } %> + Delete this customer | +% } +% unless ( $conf->exists('disable_customer_referrals') ) { + Refer a new customer | + View this customer's referrals +% } -<% unless ( $conf->exists('disable_customer_referrals') ) { %> - Refer a new customer | - View this customer's referrals -<% } %>

+% +%my $signupurl = $conf->config('signupurl'); +%if ( $signupurl ) { +% + + This customer's signup URL: <% $signupurl %>?ref=<% $custnum %>

+% } -<% -my $signupurl = $conf->config('signupurl'); -if ( $signupurl ) { -%> - This customer's signup URL: <%= $signupurl %>?ref=<%= $custnum %>

-<% } %>
- <%= include('cust_main/contacts.html', $cust_main ) %> + <% include('cust_main/contacts.html', $cust_main ) %> - <%= include('cust_main/misc.html', $cust_main ) %> - <% if ( $conf->config('payby-default') ne 'HIDE' ) { %> + <% include('cust_main/misc.html', $cust_main ) %> +% if ( $conf->config('payby-default') ne 'HIDE' ) { +
- <%= include('cust_main/billing.html', $cust_main ) %> - <% } %> + <% include('cust_main/billing.html', $cust_main ) %> +% } +
+% +%if ( defined $cust_main->dbdef_table->column('comments') +% && $cust_main->comments =~ /[^\s\n\r]/ ) { +% -<% -if ( defined $cust_main->dbdef_table->column('comments') - && $cust_main->comments =~ /[^\s\n\r]/ ) { -%>
Comments -<%= ntable("#cccccc") %>
<%= ntable("#cccccc",2) %> +<% ntable("#cccccc") %>
<% ntable("#cccccc",2) %>
-
<%= encode_entities($cust_main->comments) %>
+
<% encode_entities($cust_main->comments) %>
-<% } %> +% } +% if ( $conf->config('ticket_system') ) { -<% if ( $conf->config('ticket_system') ) { %>
- <%= include('cust_main/tickets.html', $cust_main ) %> -<% } %> + <% include('cust_main/tickets.html', $cust_main ) %> +% } +

-<%= include('cust_main/packages.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 ) %> +% } -<% if ( $conf->config('payby-default') ne 'HIDE' ) { %> - <%= include('cust_main/payment_history.html', $cust_main ) %> -<% } %> -<%= include('/elements/footer.html') %> +<% include('/elements/footer.html') %> -- cgit v1.2.1 From 30c3ff2acf90e1386fae00759078899c859faf36 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 3 Oct 2006 22:44:28 +0000 Subject: Enhanced customer notes --- httemplate/view/cust_main.cgi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index e82a5196c..6b2277756 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -116,6 +116,34 @@ Comments % } +

+% my $notecount = scalar($cust_main->notes()); +% if ($conf->exists('cust_main-use_notes') || $notecount) { + +Notes
+% if ( $curuser->access_right('Add customer note') && +% $conf->exists('cust_main-use_notes') +% ) { + + Add customer note + +% } + +
+ +% if ($notecount) { + + + +% } else { + +
+% } +% } + + % if ( $conf->config('ticket_system') ) {
-- cgit v1.2.1 From 17fa39cf364f9876d41c033f63ef0b4f6f8b1bb7 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 9 Oct 2006 00:26:27 +0000 Subject: clean up the customer view a tiny bit --- httemplate/view/cust_main.cgi | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 6b2277756..96acf15eb 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -102,8 +102,7 @@ var confirm_cancel = 'Notes
% if ( $curuser->access_right('Add customer note') && -% $conf->exists('cust_main-use_notes') +% ! $conf->exists('cust_main-disable_notes') % ) { Add customer note -- cgit v1.2.1 From ae3253689aba4912b7308167cad11f10ebb2658a Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 25 Nov 2006 21:04:54 +0000 Subject: chill FF wrt POSTDATA --- httemplate/view/cust_main.cgi | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 70d424065..fa3de92f0 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -136,6 +136,12 @@ Comments

[iframe not supported]

+% }else{ # make firefox happy wrt POSTDATA + + + % } % } -- cgit v1.2.1 From 88a07a3c2aac1fff33bd1f400ee5c0672ce716a0 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 26 Nov 2006 23:06:37 +0000 Subject: more ajaxy customer notes --- httemplate/view/cust_main.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index fa3de92f0..3c66df1a7 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -138,7 +138,7 @@ Comments % }else{ # make firefox happy wrt POSTDATA - -- cgit v1.2.1 From 0c81ee14be99875c8f9f9e34a442a23543333611 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Jan 2007 11:39:46 +0000 Subject: fix elements/ links here too --- httemplate/view/cust_main.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'httemplate/view/cust_main.cgi') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 3c66df1a7..101fe2cff 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -22,10 +22,10 @@ - - - - + + + + - - - + + + + @@ -155,11 +137,35 @@ Comments

+ +% #XXX enable me# if ( $curuser->access_right('View customer packages') { <% include('cust_main/packages.html', $cust_main ) %> -% if ( $conf->config('payby-default') ne 'HIDE' ) { +% #} +% if ( $conf->config('payby-default') ne 'HIDE' ) { <% include('cust_main/payment_history.html', $cust_main ) %> % } <% include('/elements/footer.html') %> +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('View customer'); + +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 $cust_main = qsearchs({ + 'table' => 'cust_main', + 'hashref' => {'custnum'=>$custnum}, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, +}); +die "Customer not found!" unless $cust_main; + + -- cgit v1.2.1