[freeside-commits] freeside/FS/FS svc_domain.pm,1.47,1.48
Ivan,,,
ivan at wavetail.420.am
Sat Jan 27 18:21:14 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv13001/FS/FS
Modified Files:
svc_domain.pm
Log Message:
pretty up domain zone viewing a little
Index: svc_domain.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_domain.pm,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- svc_domain.pm 29 Dec 2006 08:51:32 -0000 1.47
+++ svc_domain.pm 28 Jan 2007 02:21:11 -0000 1.48
@@ -400,8 +400,25 @@
'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 } );
}
More information about the freeside-commits
mailing list