From fe25108857542f5d7c460ab831bc782f608179fa Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Sat, 16 Jul 2016 15:43:42 -0500 Subject: RT#38973: Bill for time worked on ticket resolution [checkpoint, not ready for backport] --- httemplate/elements/select-rt-customfield.html | 34 ++++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'httemplate/elements/select-rt-customfield.html') diff --git a/httemplate/elements/select-rt-customfield.html b/httemplate/elements/select-rt-customfield.html index 85758d585..488accac3 100644 --- a/httemplate/elements/select-rt-customfield.html +++ b/httemplate/elements/select-rt-customfield.html @@ -1,31 +1,27 @@ -> % while ( @fields ) { - +% my $value = shift @fields; +% my $label = shift @fields; + % } <%init> my %opt = @_; -my $lookuptype = $opt{lookuptype}; -my $valuetype = $opt{valuetype}; -# 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 => $lookuptype) - if $lookuptype; - -$CFs->Limit(FIELD => 'Type', - VALUE => $valuetype) - if $valuetype; +my %curr_value = map { $_ => 1 } split(', ',$opt{'curr_value'}); my @fields; push @fields, '', $opt{empty_label} if exists($opt{empty_label}); -while (my $CF = $CFs->Next) { - push @fields, $CF->Name, ($CF->Description || $CF->Name); +my $conf = new FS::Conf; + +if ($conf->config('ticket_system') eq 'RT_Internal') { + + push @fields, FS::TicketSystem->custom_fields( + lookuptype => $opt{lookuptype}, + valuetype => $opt{valuetype}, + ); + } + -- cgit v1.2.1