avoid corrupt attachments, #13209 and #13877
[freeside.git] / httemplate / view / cust_main / tickets.html
index 0c48d21..863c66b 100644 (file)
@@ -122,7 +122,7 @@ my $open_link = FS::TicketSystem->href_customer_tickets($cust_main->custnum);
 my $openlabel = join('/', FS::TicketSystem->statuses );
 
 my $res_link  = FS::TicketSystem->href_customer_tickets(
-                  $cust_main->Custnum,
+                  $cust_main->custnum,
                   { 'statuses' => [ 'resolved' ] }
                 );
 
@@ -132,6 +132,14 @@ my( $new_base, %new_param ) =
 my $new_link = FS::TicketSystem->href_new_ticket( $cust_main );
 
 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';