ticket # and account(customer) options for time worked report
[freeside.git] / httemplate / search / rt_transaction.html
index 651f289..34fb733 100644 (file)
@@ -77,6 +77,10 @@ if ( $cgi->param('otaker') && $cgi->param('otaker') =~ /^([\w\.\-]+)$/ ) {
   $where .= " AND Users.name = '$1' ";
 }
 
+if ( $cgi->param('ticketid') =~ /^\s*(\d+)\s*$/ ) {
+  $where .= " AND Tickets.ID = $1";
+}
+
 my $query = {
   'select'    => "Transactions.*, Tickets.Id AS ticketid, Tickets.Subject, Users.name as otaker, $transactiontime AS transaction_time",
   #'table'     => 'Transactions',
@@ -91,6 +95,6 @@ my $query = {
 my $count_query =
   "SELECT COUNT(*), SUM($transactiontime) FROM Transactions $join $where";
 
-my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->get('id'); } ];
+my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->get('ticketid'); } ];
 
 </%init>