diff options
author | Mark Wells <mark@freeside.biz> | 2012-04-10 16:01:59 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-04-10 16:02:46 -0700 |
commit | 36b042b1f07afccc028121eef918fb3985e76eaa (patch) | |
tree | 60ca0a4bd4b92c3e1c61992c67a0f19083e07b89 /httemplate/search/report_rt_ticket.html | |
parent | 85ae8035888f10fd8075be3234f8e981f5004557 (diff) |
time worked reports for RT custom fields, #17230
Diffstat (limited to 'httemplate/search/report_rt_ticket.html')
-rw-r--r-- | httemplate/search/report_rt_ticket.html | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/httemplate/search/report_rt_ticket.html b/httemplate/search/report_rt_ticket.html index 79a601b4b..f0d7a4200 100644 --- a/httemplate/search/report_rt_ticket.html +++ b/httemplate/search/report_rt_ticket.html @@ -6,10 +6,20 @@ <% include ( '/elements/tr-input-beginning_ending.html' ) %> + <& /elements/tr-td-label.html, label => 'Time category:' &> + <TD> + <& /elements/select-rt-customfield.html, + name => 'cfname', + lookuptype => 'RT::Transaction', + valuetype => 'TimeValue', + empty_label => 'Worked', + &> + </TD></TR> + <% include ( '/elements/tr-select-otaker.html' ) %> <TR> - <TD>Account</TD> + <TD ALIGN="right">Account:</TD> <TD> <SELECT NAME="svcnum"> <OPTION VALUE="">(all) @@ -48,4 +58,24 @@ if ( @pkgparts ) { }); } +# get a list of TimeValue-type custom fields +RT::Init(); +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'); + +my @time_fields = ('', 'Worked'); +while (my $CF = $CFs->Next) { + push @time_fields, $CF->Name, ($CF->Description || $CF->Name); +} + + </%init> |