lastapp searching, RT#12181
[freeside.git] / httemplate / search / cdr.html
index bf59ff6..7e62447 100644 (file)
@@ -182,7 +182,7 @@ if ( $cgi->param('dst') ) {
 if ( $cgi->param('dcontext') =~ /^\s*(.+)\s*$/ ) {
   my $dcontext = $1;
   $hashref->{'dcontext'} = $dcontext;
-  push @search, "dcontext = '$dcontext'";
+  push @search, 'dcontext = '. dbh->quote($dcontext);
 }
 
 if ( $cgi->param('charged_party') ) {
@@ -208,6 +208,12 @@ if ( $cgi->param('charged_party_or_src') ) {
   push @qsearch, $search;
 }
 
+if ( $cgi->param('lastapp') =~ /^\s*(.+)\s*$/ ) {
+  my $lastapp = $1;
+  $hashref->{'lastapp'} = $lastapp;
+  push @search, 'lastapp = '. dbh->quote($lastapp);
+}
+
 if ( $cgi->param('svcnum') =~ /^([\d, ]+)$/ ) {
   my $svcnum = $1;
   my $search = "svcnum IN ($svcnum)";