Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / httemplate / search / report_rt_ticket.html
index 79a601b..7abc3e8 100644 (file)
@@ -6,15 +6,23 @@
 
   <% include ( '/elements/tr-input-beginning_ending.html' ) %>
 
+  <& /elements/tr-select.html,
+      label       => 'Time category:',
+      field       => 'category',
+      options     => [ '', 'development', 'support' ],
+      option_labels => { '' => 'all' },
+      curr_value  => 'development',
+  &>
+
   <% include ( '/elements/tr-select-otaker.html' ) %>
 
   <TR>
-    <TD>Account</TD>
+    <TD ALIGN="right">Account:</TD>
     <TD>
       <SELECT NAME="svcnum">
         <OPTION VALUE="">(all)
 %       foreach my $svc_acct (@svc_acct) {
-          <OPTION VALUE="<% $svc_acct->svcnum %>"><% $svc_acct->username %></OPTION>
+          <OPTION VALUE="<% $svc_acct->svcnum %>"><% $svc_acct->email %></OPTION>
 %       }
       </SELECT>
     </TD>
@@ -48,4 +56,17 @@ if ( @pkgparts ) {
   });
 }
 
+# get a list of TimeValue-type custom fields
+my $CurrentUser = RT::CurrentUser->new();
+$CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username);
+die "RT not configured" unless $CurrentUser->id;
+my $CFs = RT::CustomFields->new($CurrentUser);
+
+$CFs->Limit(FIELD => 'LookupType',
+            OPERATOR => 'ENDSWITH',
+            VALUE => 'RT::Transaction');
+
+$CFs->Limit(FIELD => 'Type',
+            VALUE => 'TimeValue');
+
 </%init>