diff options
author | ivan <ivan> | 2001-09-16 12:45:35 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-09-16 12:45:35 +0000 |
commit | 87661d51ce44b78c5b156f4ee7c52e75a9d38746 (patch) | |
tree | 7aab13ab158ef8feae0d64a97f00140313bb4e40 /httemplate/search | |
parent | 5477d23b51bd3135893c4d79091a9e272a17f4f8 (diff) |
fix oops in FS::cust_main_invoice::replace preventing package cancellation
add toggle switch to cust_main searching to show/hide cancelled customers.
hidecancelledcustomers config file is just which state it starts in.
add signupurl config file to enable showing of the customer's signup URL
on the view page.
Diffstat (limited to 'httemplate/search')
-rwxr-xr-x | httemplate/search/cust_main.cgi | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 9dcada7c2..25dbe6964 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: cust_main.cgi,v 1.5 2001-09-11 00:08:18 ivan Exp $ --> +#<!-- $Id: cust_main.cgi,v 1.6 2001-09-16 12:45:35 ivan Exp $ --> use strict; #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby ); @@ -19,8 +19,8 @@ cgisuidsetup($cgi); $conf = new FS::Conf; -if ( $cgi->keywords ) { - my($query)=$cgi->keywords; +if ( $cgi->param('browse') ) { + my $query = $cgi->param('browse'); if ( $query eq 'custnum' ) { $sortby=\*custnum_sort; @cust_main=qsearch('cust_main',{}); @@ -31,7 +31,7 @@ if ( $cgi->keywords ) { $sortby=\*company_sort; @cust_main=qsearch('cust_main',{}); } else { - die "unknown query string $query"; + die "unknown browse field $query"; } } else { @cust_main=(); @@ -42,7 +42,9 @@ if ( $cgi->keywords ) { } @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main - if $conf->exists('hidecancelledcustomers'); + if $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me + || ( $conf->exists('hidecancelledcustomers') + && ! $cgi->param('showcancelledcustomers') ); if ( $conf->exists('hidecancelledpackages' ) ) { %all_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main; } else { @@ -59,7 +61,18 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) { my($total)=scalar(@cust_main); print $cgi->header( '-expires' => 'now' ), header("Customer Search Results",menubar( 'Main Menu', popurl(2) - )), "$total matching customers found"; + )), "$total matching customers found "; + if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me + || ( $conf->exists('hidecancelledcustomers') + && ! $cgi->param('showcancelledcustomers') + ) + ) { + $cgi->param('showcancelledcustomers', 1); + print qq!( <a href="!. $cgi->self_url. qq!">show cancelled customers</a> )!; + } else { + $cgi->param('showcancelledcustomers', 0); + print qq!( <a href="!. $cgi->self_url. qq!">hide cancelled customers</a> )!; + } if ( $cgi->param('referral_custnum') ) { $cgi->param('referral_custnum') =~ /^(\d+)$/ or eidiot "Illegal referral_custnum\n"; |