hide tickets with selfservice priority indicating closure, RT#79444
[freeside.git] / FS / FS / ClientAPI / MyAccount.pm
index e28aa18..66697ef 100644 (file)
@@ -237,6 +237,13 @@ sub login {
 
     $svc_x = $svc_phone;
 
+  } elsif ( $p->{'domain'} eq 'ip_mac' ) {
+
+      my $svc_broadband = qsearchs( 'svc_broadband', { 'mac_addr' => $p->{'username'} } );
+      return { error => 'IP address not found' }
+        unless $svc_broadband;
+      $svc_x = $svc_broadband;
+
   } elsif ( $p->{email}
               && (my $contact = FS::contact->by_selfservice_email($p->{email}))
           )
@@ -1707,6 +1714,16 @@ sub update_payby {
   my($context, $session, $custnum) = _custoragent_session_custnum($p);
   return { 'error' => $session } if $context eq 'error';
 
+  if ($p->{'payby'} eq 'CHEK') {
+     $p->{'payinfo1'} =~ /^([\dx]+)$/
+       or return { 'error' => "illegal account number ". $p->{'payinfo1'} };
+     my $payinfo1 = $1;
+      $p->{'payinfo2'} =~ /^([\dx\.]+)$/ # . turned on by echeck-country CA ?
+       or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} };
+     my $payinfo2 = $1;
+     $p->{'payinfo'} = $payinfo1. '@'. $payinfo2;
+   }
+
   my $cust_payby = qsearchs('cust_payby', {
                               'custnum'      => $custnum,
                               'custpaybynum' => $p->{'custpaybynum'},
@@ -3572,6 +3589,11 @@ sub list_tickets {
 
   # unavoidable false laziness w/ httemplate/view/cust_main/tickets.html
   if ( $FS::TicketSystem::system && FS::TicketSystem->selfservice_priority ) {
+
+    @tickets = grep { $_->{'_selfservice_priority'}
+                        !~ /^\s*(closed?|resolved?|done)\s*/i }
+                 @tickets;
+
     my $conf = new FS::Conf;
     my $dir = $conf->exists('ticket_system-priority_reverse') ? -1 : 1;
     +{ tickets => [