+my $ss_priority = FS::TicketSystem->selfservice_priority;
+if ( $ss_priority ) {
+ use sort 'stable';
+ no warnings 'uninitialized';
+ @tickets = sort {
+ ($b->{'content'} eq $a->{'content'}) &&
+ $b->{'_selfservice_priority'} <=> $a->{'_selfservice_priority'}
+ } @tickets;
+}
+
+my $format = $conf->config('date_format') || '%Y-%m-%d';
+
+my $date_formatter = sub {
+ my $time = str2time($_[0], 'GMT');
+ # exclude times within 24 hours of zero
+ ($time > 86400) ? time2str($format, $time) : '';
+};
+