summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2001-09-16 12:45:35 +0000
committerivan <ivan>2001-09-16 12:45:35 +0000
commit87661d51ce44b78c5b156f4ee7c52e75a9d38746 (patch)
tree7aab13ab158ef8feae0d64a97f00140313bb4e40 /httemplate
parent5477d23b51bd3135893c4d79091a9e272a17f4f8 (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')
-rw-r--r--httemplate/docs/config.html1
-rw-r--r--httemplate/index.html2
-rwxr-xr-xhttemplate/search/cust_main.cgi25
-rwxr-xr-xhttemplate/view/cust_main.cgi14
4 files changed, 32 insertions, 10 deletions
diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html
index 84e9538f7..b985ebee9 100644
--- a/httemplate/docs/config.html
+++ b/httemplate/docs/config.html
@@ -89,6 +89,7 @@ All further configuration files and directories are located in
<li><a name="shellmachines">shellmachines</a> - Your Linux and System V flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/shadow' files.
<li><a name="shells"><font color="#ff0000">shells</font></a> - Legal shells (think /etc/shells). You probably want to `cut -d: -f7 /etc/passwd | sort | uniq' initially so that importing doesn't fail with `Illegal shell' errors, then remove any special entries afterwords. A blank line specifies that an empty shell is permitted.
<li><a name="showpasswords">showpasswords</a> - The existance of this file will allow unencrypted user passwords to be displayed.
+ <li><a name="signupurl">signupurl</a> - if you are using customer-to-customer referrals, and you enter the URL of your <a href="signup.html">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral.
<li><a name="smtpmachine"><font color="#ff0000">smtpmachine</font></a> - SMTP relay for Freeside's outgoing mail.
<li><a name="soadefaultttl">soadefaultttl</a> - SOA default TTL for new domains.
<li><a name="soaemail">soaemail</a> - SOA email for new domains, in BIND form (`.' instead of `@'), with trailing `.'
diff --git a/httemplate/index.html b/httemplate/index.html
index 2fbc06221..c45997608 100644
--- a/httemplate/index.html
+++ b/httemplate/index.html
@@ -34,7 +34,7 @@
</ul>
<li><A NAME="browse">Browse</A>
<ul>
- <LI>customers (<A HREF="search/cust_main.cgi?custnum">by customer number</A>) (<A HREF="search/cust_main.cgi?last">by last name</A>) (<A HREF="search/cust_main.cgi?company">by company</A>)
+ <LI>customers (<A HREF="search/cust_main.cgi?browse=custnum">by customer number</A>) (<A HREF="search/cust_main.cgi?browse=last">by last name</A>) (<A HREF="search/cust_main.cgi?browse=company">by company</A>)
<LI>invoices
<UL>
<LI>open invoices (<A HREF="search/cust_bill.cgi?OPEN_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN_custnum">by customer number</A>)
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";
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 174c08760..6df28c844 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,10 +1,11 @@
<%
-#<!-- $Id: cust_main.cgi,v 1.10 2001-09-11 09:56:27 ivan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.11 2001-09-16 12:45:35 ivan Exp $ -->
use strict;
use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral
@packages $package @history @bills $bill @credits $credit
- $balance $item @agents @referrals @invoicing_list $n1 $conf );
+ $balance $item @agents @referrals @invoicing_list $n1 $conf
+ $signupurl );
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Date::Format;
@@ -53,10 +54,17 @@ unless ( $conf->exists('disable_customer_referrals') ) {
print qq! | <A HREF="!, popurl(2),
qq!search/cust_main.cgi?referral_custnum=$custnum">!,
- qq!View this customer's referrals<A>!;
+ qq!View this customer's referrals</A>!;
}
print '<BR><BR>';
+
+my $signupurl = $conf->config('signupurl');
+if ( $signupurl ) {
+print "This customer's signup URL: ".
+ "<a href=\"$signupurl?ref=$custnum\">$signupurl?ref=$custnum</a><BR><BR>";
+}
+
print '<A NAME="cust_main"></A>';
print &itable(), '<TR>';