From: ivan Date: Sun, 28 Jan 2007 02:21:12 +0000 (+0000) Subject: pretty up domain zone viewing a little X-Git-Tag: TRIXBOX_2_6~719 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=80206c4958e70b809ff1205a0d8322b5ca2d7fa8 pretty up domain zone viewing a little --- 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 } ); } diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index 44390bf8b..ff336f394 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -59,26 +59,45 @@ Service #<% $svcnum %> return confirm("Remove all records and slave from " + document.SlaveForm.recdata.value + "?"); } + % my @records; if ( @records = $svc_domain->domain_record ) { - <% ntable("",2) %> - ZoneTypeData + <% include('/elements/table-grid.html') %> + +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = $bgcolor2; + + + Zone + Type + Data + + % foreach my $domain_record ( @records ) { % my $type = $domain_record->rectype eq '_mstr' % ? "(slave)" % : $domain_record->recaf. ' '. $domain_record->rectype; -% - <% $domain_record->reczone %> - <% $type %> - <% $domain_record->recdata %> -% unless ( $domain_record->rectype eq 'SOA' ) { + + <% $domain_record->reczone %> + <% $type %> + <% $domain_record->recdata %> +% unless ( $domain_record->rectype eq 'SOA' ) { (delete) % } + + + + +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } - % }