Changeset 420
- Timestamp:
- 10/10/12 13:24:53 (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r418 r420 3377 3377 # sort reverse zones on IP, correctly 3378 3378 # do other fiddling with $args{sortby} while we're at it. 3379 $args{sortby} = "r.$args{sortby}"; 3380 $args{sortby} = 'CAST (r.val AS inet)' 3381 if $args{revrec} eq 'y' && $args{defrec} eq 'n' && $args{sortby} eq 'r.val'; 3382 $args{sortby} = 't.alphaorder' if $args{sortby} eq 'r.type'; 3379 # whee! multisort means just passing comma-separated fields in sortby! 3380 my $newsort = ''; 3381 foreach my $sf (split /,/, $args{sortby}) { 3382 $sf = "r.$sf"; 3383 $sf =~ s/r\.val/CAST (r.val AS inet)/ 3384 if $args{revrec} eq 'y' && $args{defrec} eq 'n'; 3385 $sf =~ s/r\.type/t.alphaorder/; 3386 $newsort .= ",$sf"; 3387 } 3388 $newsort =~ s/^,//; 3383 3389 3384 3390 my $sql = "SELECT r.record_id,r.host,r.type,r.val,r.ttl"; … … 3391 3397 $sql .= " AND NOT r.type=$reverse_typemap{SOA}"; 3392 3398 $sql .= " AND host ~* ?" if $args{filter}; 3393 $sql .= " ORDER BY $ args{sortby}$args{sortorder}";3399 $sql .= " ORDER BY $newsort $args{sortorder}"; 3394 3400 # ensure consistent ordering by sorting on record_id too 3395 3401 $sql .= ", record_id $args{sortorder}"; -
trunk/templates/reclist.tmpl
r397 r420 40 40 </tr> 41 41 <tr class="darkrowheader"> 42 <td colspan="4">Records</td> 42 <td colspan="3">Records</td> 43 <td align="center"><a href="textrecs.cgi?sid=<TMPL_VAR NAME=sid>&id=<TMPL_VAR NAME=id>&defrec=<TMPL_VAR NAME=defrec>&revrec=<TMPL_VAR NAME=revrec>">Plain text</a></td> 43 44 <TMPL_IF record_create> <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&page=record&parentid=<TMPL_VAR NAME=id>&defrec=<TMPL_VAR NAME=defrec>&revrec=<TMPL_VAR NAME=revrec>&recact=new">Add record</a></td></TMPL_IF> 44 45 <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&page=log&id=<TMPL_VAR NAME=id><TMPL_IF logdom>&ltype=dom</TMPL_IF><TMPL_IF logrdns>&ltype=rdns</TMPL_IF>">View log</a></td>
Note:
See TracChangeset
for help on using the changeset viewer.