Skip to content

Commit

Permalink
add config option ticket.<prop>.sort-undef-last
Browse files Browse the repository at this point in the history
Sometimes, like with, for example due dates, we may want items with no set
value to sort *after* any tickets with existing due dates.
  • Loading branch information
spang committed Feb 21, 2011
1 parent cec7534 commit 639d4e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/App/SD/CLI/Command/Ticket/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ override run => sub {
if ( $self->has_arg('sort') && $self->arg('sort')
&& ( $self->arg('sort') ne 'none' ) ) {

my $sort_prop = $self->arg('sort');

my $sort_undef_last = $self->app_handle->config->get(
key => $self->type . ".$sort_prop.sort-undef-last" );

$self->sort_routine(
sub {
my $records = shift;
return $self->sort_by_prop( $self->arg('sort') => $records );
return $self->sort_by_prop( $sort_prop, $records,
$sort_undef_last );
}
);
}
Expand Down

0 comments on commit 639d4e5

Please sign in to comment.