1 <% include('/elements/header.html', 'Time worked summary report criteria' ) %>
3 <FORM ACTION="rt_ticket.html" METHOD="GET">
7 <% include ( '/elements/tr-input-beginning_ending.html' ) %>
9 <& /elements/tr-td-label.html, label => 'Time category:' &>
11 <& /elements/select-rt-customfield.html,
13 lookuptype => 'RT::Transaction',
14 valuetype => 'TimeValue',
15 empty_label => 'Worked',
19 <% include ( '/elements/tr-select-otaker.html' ) %>
22 <TD ALIGN="right">Account:</TD>
24 <SELECT NAME="svcnum">
25 <OPTION VALUE="">(all)
26 % foreach my $svc_acct (@svc_acct) {
27 <OPTION VALUE="<% $svc_acct->svcnum %>"><% $svc_acct->username %></OPTION>
36 <INPUT TYPE="submit" VALUE="Search">
40 <% include('/elements/footer.html') %>
44 unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
46 my $conf = new FS::Conf;
48 my @pkgparts = $conf->config('support_packages');
53 'table' => 'svc_acct',
54 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
55 ' LEFT JOIN cust_pkg USING ( pkgnum ) ',
56 'extra_sql' => 'WHERE pkgpart IN ('. join(',', @pkgparts). ')',
57 'order_by' => 'ORDER BY username',
61 # get a list of TimeValue-type custom fields
62 my $CurrentUser = RT::CurrentUser->new();
63 $CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username);
64 die "RT not configured" unless $CurrentUser->id;
65 my $CFs = RT::CustomFields->new($CurrentUser);
67 $CFs->Limit(FIELD => 'LookupType',
68 OPERATOR => 'ENDSWITH',
69 VALUE => 'RT::Transaction');
71 $CFs->Limit(FIELD => 'Type',
72 VALUE => 'TimeValue');
74 my @time_fields = ('', 'Worked');
75 while (my $CF = $CFs->Next) {
76 push @time_fields, $CF->Name, ($CF->Description || $CF->Name);