X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FElements%2FPickCFs;h=604457c78d888c669f463867301a095a7c067db6;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=4b9a88b77893617bb80dc826509162cd60e4e174;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6;p=freeside.git diff --git a/rt/share/html/Search/Elements/PickCFs b/rt/share/html/Search/Elements/PickCFs index 4b9a88b77..604457c78 100644 --- a/rt/share/html/Search/Elements/PickCFs +++ b/rt/share/html/Search/Elements/PickCFs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -49,24 +49,6 @@ <& ConditionRow, Condition => $_ &> % } <%INIT> -my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); -foreach my $id (keys %cfqueues) { - # Gotta load up the $queue object, since queues get stored by name now. my $id - my $queue = RT::Queue->new($session{'CurrentUser'}); - $queue->Load($id); - unless ($queue->id) { - # XXX TODO: This ancient code dates from a former developer - # we have no idea what it means or why cfqueues are so encoded. - $id =~ s/^.'*(.*).'*$/$1/; - - # unescape internal quotes - $id =~ s/(\\(.))/$2 eq "'" ? "'" : $1/eg; - - $queue->Load($id); - } - $CustomFields->LimitToQueue($queue->Id); -} -$CustomFields->LimitToGlobal; $m->callback( CallbackName => 'MassageCustomFields', CustomFields => $CustomFields, @@ -76,7 +58,7 @@ $m->callback( my @lines; while ( my $CustomField = $CustomFields->Next ) { my %line; - $line{'Name'} = "'CF.{" . $CustomField->Name . "}'"; + $line{'Name'} = "$TicketSQLField.{" . $CustomField->Name . "}"; $line{'Field'} = $CustomField->Name; # Op @@ -106,28 +88,21 @@ while ( my $CustomField = $CustomFields->Next ) { } # Value - if ($CustomField->Type =~ /^Date(Time)?$/) { - my $is_datetime = $1 ? 1 : 0; - $line{'Value'} = { - Type => 'component', - Path => '/Elements/SelectDate', - Arguments => { $is_datetime ? (ShowTime => 1) : (ShowTime => 0), }, - }; - } else { - $line{'Value'} = { - Type => 'component', - Path => '/Elements/SelectCustomFieldValue', - Arguments => { CustomField => $CustomField }, - }; - } + $line{'Value'} = { + Type => 'component', + Path => '/Elements/SelectCustomFieldValue', + Arguments => { CustomField => $CustomField }, + }; push @lines, \%line; } -$m->callback( Conditions => \@lines, Queues => \%cfqueues ); +$m->callback( Conditions => \@lines, Queues => \%queues ); <%ARGS> -%cfqueues => undef +%queues => () +$CustomFields +$TicketSQLField => 'CF'