<SELECT NAME="<%$Name%>">
% foreach my $field (@sortfields) {
<OPTION VALUE="<%$field%>" <%$field eq $Default && 'SELECTED'%>><%$field%></OPTION>
% }
</SELECT>

<%INIT>
my $tickets = new RT::Tickets($session{'CurrentUser'});
my @sortfields = $tickets->SortFields();

</%INIT>
<%ARGS>
$Name => 'SortTicketsBy'
$Default => 'id'
</%ARGS>
