From 80206c4958e70b809ff1205a0d8322b5ca2d7fa8 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 28 Jan 2007 02:21:12 +0000 Subject: pretty up domain zone viewing a little --- FS/FS/svc_domain.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'FS') diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index 157f9e0ca..529127158 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -400,8 +400,25 @@ sub domain_record { 'PTR' => 7, ); - sort { $order{$a->rectype} <=> $order{$b->rectype} } - qsearch('domain_record', { svcnum => $self->svcnum } ); + my %sort = ( + #'SOA' => sub { $_[0]->recdata cmp $_[1]->recdata }, #sure hope not though +# 'SOA' => sub { 0; }, +# 'NS' => sub { 0; }, + 'MX' => sub { my( $a_weight, $a_name ) = split(/\s+/, $_[0]->recdata); + my( $b_weight, $b_name ) = split(/\s+/, $_[1]->recdata); + $a_weight <=> $b_weight or $a_name cmp $b_name; + }, + 'CNAME' => sub { $_[0]->reczone cmp $_[1]->reczone }, + 'A' => sub { $_[0]->reczone cmp $_[1]->reczone }, + +# 'TXT' => sub { 0; }, + 'PTR' => sub { $_[0]->reczone <=> $_[1]->reczone }, + ); + + sort { $order{$a->rectype} <=> $order{$b->rectype} + or &{ $sort{$a->rectype} || sub { 0; } }($a, $b) + } + qsearch('domain_record', { svcnum => $self->svcnum } ); } -- cgit v1.2.1