Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / search / cust_event.html
index bfc5f43..241a026 100644 (file)
@@ -69,7 +69,7 @@ my $status_sub = sub {
   my $cust_event = shift;
 
   my $status = $cust_event->status;
-  $status .= ': '.$cust_event->statustext
+  $status .= ': '. encode_entities($cust_event->statustext)
     if $cust_event->statustext;
 
   my $part_event = $cust_event->part_event;
@@ -152,7 +152,12 @@ die "access denied"
               || $cgi->param('pkgnum')  =~ /^(\d+)$/
             );
 
-my $title = $cgi->param('failed') ? 'Failed billing events' : 'Billing events';
+my @statuses = $cgi->multi_param('event_status');
+my $title = 'Billing events';
+if ( $statuses[0] eq 'failed' and !defined($statuses[1]) ) {
+  # tweak the title if we're showing only failed events
+  $title = 'Failed billing events';
+}
 
 my %search = ();
 
@@ -161,9 +166,10 @@ for my $param (@scalars) {
   $search{$param} = scalar( $cgi->param($param) )
     if $cgi->param($param);
 }
+$search{event_status} = \@statuses;
 
 #lists
-my @lists = qw( payby eventpart );
+my @lists = qw( eventpart );
 foreach my $param (@lists) {
   $search{$param} = [ $cgi->param($param) ];
 }