fix error w/current perl - can't call keys on a scalar hashref anymore, RT#77532
[freeside.git] / httemplate / search / cust_main.html
index b97a4ef..cb8d66e 100755 (executable)
                                                       $cgi->param('cust_fields')
                                                                    )
                                      ),
-                                     map '', @extra_fields
+                                     map  { $_ eq 'num_referrals'
+                                              ? $referral_link
+                                              : ''
+                                          }
+                                       @extra_fields
                                    ],
 &>
 <%init>
@@ -41,13 +45,17 @@ my %search_hash = ();
 
 #scalars
 my @scalars = qw (
-  agentnum salesnum status address zip paydate_year paydate_month invoice_terms
-  no_censustract with_geocode with_email POST no_POST
+  agentnum salesnum status
+  address city county state zip country location_history
+  invoice_terms
+  no_censustract with_geocode with_email tax no_tax POST no_POST
   custbatch usernum
   cancelled_pkgs
   cust_fields flattened_pkgs
   all_tags
   all_pkg_classnums
+  any_pkg_status
+  with_referrals referral_status
 );
 
 for my $param ( @scalars ) {
@@ -56,10 +64,26 @@ for my $param ( @scalars ) {
 }
 
 #lists
-for my $param (qw( classnum refnum payby tagnum pkg_classnum )) {
+for my $param (qw( classnum refnum pkg_classnum )) {
   $search_hash{$param} = [ $cgi->param($param) ];
 }
 
+my $params = $cgi->Vars;
+
+#contacts
+$search_hash{'contacts'} = {
+  map { $_ => $cgi->param($_), }
+    grep { /^(contacts_*)/ && $cgi->param($_) }
+      keys %$params
+};
+
+#tags
+$search_hash{'tagnum'} = [
+  map { /^tagnum(\d+)/ && $1 }
+    grep { /^tagnum(\d+)/ && $cgi->param($_) }
+      keys %$params
+];
+
 ###
 # parse dates
 ###
@@ -101,6 +125,8 @@ my @extra_fields  = @{ delete($sql_query->{'extra_fields'})  };
 
 my $link = [ "${p}view/cust_main.cgi?", 'custnum' ];
 
+my $referral_link = [ "${p}search/cust_main.cgi?referral_custnum=", 'custnum' ];
+
 ###
 # email links
 ###