Trying to sort the values of a CF

Joop <[email protected]>
Newsgroups gmane.comp.bug-tracking.request-tracker.devel
Message-ID <[email protected]>
Hi All,

I would like to sort the content of a CF of type 'enter multiple values'.
I had a look at the element displaying this but can't make this work.
Probably my very weak perl skills are the problem.
The following is from that element:

% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object,
%               Grouping => $Grouping, ARGSRef => \%ARGS, CustomFields
=> $CustomFields, Table => $Table );
% if ($Table) {
<table>
% }
% while ( my $CustomField = $CustomFields->Next ) {
% my $Values = $Object->CustomFieldValues( $CustomField->Id );
% my $count = $Values->Count;
  <tr id="CF-<%$CustomField->id%>-ShowRow">
    <td class="label"><% $CustomField->Name %>:</td>
    <td class="value">
% unless ( $count ) {
<i><&|/l&>(no value)</&></i>
% } elsif ( $count == 1 ) {
%   $print_value->( $CustomField, $Values->First );
% } else {
<ul>
% while ( my $Value = $Values->Next ) {
<li>
% $print_value->( $CustomField, $Value );
</li>
% }
</ul>
% }
    </td>
% $m->callback( CallbackName => 'AfterCustomFieldValue', CustomField =>
$CustomField,
%               Object => $Object, Grouping => $Grouping, Table => $Table );
  </tr>
% }
% if ($Table) {
</table>
% }
% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object,
%               Grouping => $Grouping, ARGSRef => \%ARGS, Table =>
$Table );


The while $value = $values->next''prints one line at at time the content
of the CF. I would like to sort this content prior to displaying it.

Any help is appreciated,

Joop
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.