Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r67 r72 927 927 ## for order, need to map input to column names 928 928 my $order = shift || 'host'; 929 my $direction = shift || 'ASC'; 929 930 930 931 my $sql = "SELECT record_id,host,type,val,distance,weight,port,ttl FROM "; … … 934 935 $sql .= " records where domain_id=$id"; 935 936 } 936 $sql .= " and not type=$reverse_typemap{SOA} order by $order ";937 $sql .= " and not type=$reverse_typemap{SOA} order by $order $direction"; 937 938 ##fixme: need to set nstart properly (offset is not internally multiplied with limit) 938 939 $sql .= " limit $nrecs offset ".($nstart*$nrecs) if $nstart ne 'all'; -
trunk/dns.cgi
r70 r72 252 252 my ($count) = ($sth->fetchrow_array); 253 253 254 ##work 255 # set up the headers 256 my @cols = ('host', 'type', 'val', 'distance', 'weight', 'port', 'ttl'); 257 my %colheads = (host => 'Name', type => 'Type', val => 'Address', 258 distance => 'Distance', weight => 'Weight', port => 'Port', ttl => 'TTL'); 259 my %custom = (id => $webvar{id}, defrec => $webvar{defrec}); 260 fill_colheads($sortby, $sortorder, \@cols, \%colheads, \%custom); 261 254 262 # fill the page-count and first-previous-next-last-all details 255 263 fill_pgcount($count,"records",domainName($dbh,$webvar{id})); … … 1097 1105 $page->param(minttl => $soa{minttl}); 1098 1106 $page->param(ttl => $soa{ttl}); 1107 1108 $startwith = $session->param($webvar{page}.'startwith'); 1109 $filter = $session->param($webvar{page}.'filter'); 1099 1110 1100 1111 # my @foo2 = getDomRecs($dbh,'def',1); … … 1484 1495 my $cols = shift; 1485 1496 my $colnames = shift; 1497 my $custom = shift; 1486 1498 1487 1499 my @headings; … … 1501 1513 $coldata{order} = 'ASC'; 1502 1514 } 1515 if ($custom) { 1516 foreach my $ckey (keys %$custom) { 1517 $coldata{$ckey} = $custom->{$ckey}; 1518 } 1519 } 1503 1520 push @headings, \%coldata; 1504 1521 } -
trunk/templates/reclist.tmpl
r71 r72 50 50 <TMPL_IF reclist> 51 51 <tr class="darkrowheader"> 52 <td>Name</td> 52 <TMPL_LOOP NAME=colheads> 53 <!-- td class="datahead_<TMPL_IF firstcol>l<TMPL_ELSE>s</TMPL_IF>" --> 54 <td><a href="dns.cgi?sid=<TMPL_VAR 55 NAME=sid>&page=<TMPL_VAR NAME=page><TMPL_IF NAME=offset>&offset=<TMPL_VAR 56 NAME=offset></TMPL_IF>&sortby=<TMPL_VAR NAME=sortby>&order=<TMPL_VAR 57 NAME=order>&id=<TMPL_VAR NAME=id>&defrec=<TMPL_VAR NAME=defrec>"><TMPL_VAR 58 NAME=colname></a><TMPL_IF NAME=sortorder> <img alt="<TMPL_VAR NAME=sortorder>" 59 src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td></TMPL_LOOP> 60 61 <!-- <td>Name</td> 53 62 <td>Type</td> 54 63 <td>Address</td> 55 <td>Distance</td><td>Weight</td><td>Port</td><td>TTL</td><td>Delete</td></tr> 64 <td>Distance</td><td>Weight</td><td>Port</td><td>TTL</td> --> 65 66 <td>Delete</td> 67 </tr> 56 68 <TMPL_LOOP NAME=reclist> 57 69 <tr class="row<TMPL_VAR NAME=row>">
Note:
See TracChangeset
for help on using the changeset viewer.