Changeset 324 for trunk


Ignore:
Timestamp:
05/02/12 13:23:13 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Add consistency to log entry and record list sorts by adding
secondary sort on log_id or record_id respectively

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r323 r324  
    27232723  # use alphaorder column for "correct" ordering of sort-by-type instead of DNS RR type number
    27242724  $sql .= " ORDER BY ".($order eq 'type' ? 't.alphaorder' : "r.$order")." $direction";
     2725  # ensure consistent ordering by sorting on record_id too
     2726  $sql .= ", record_id $direction";
    27252727
    27262728  my @bindvars = ($id);
     
    31333135  $args{offset} = 0 if !$args{offset};
    31343136
    3135   my %sortmap = (fname => 'name', username => 'email', entry => 'entry', stamp => 'stamp,log_id');
     3137  my %sortmap = (fname => 'name', username => 'email', entry => 'entry', stamp => 'stamp');
    31363138  $args{sortby} = $sortmap{$args{sortby}};
    31373139
     
    31413143        "WHERE $id_col{$args{logtype}}=?".
    31423144        ($args{filter} ? " AND entry ~* ?" : '').
    3143         " ORDER BY $args{sortby} $args{sortorder}".
     3145        " ORDER BY $args{sortby} $args{sortorder}, log_id $args{sortorder}".
    31443146        ($args{offset} eq 'all' ? '' : " LIMIT $config{perpage} OFFSET ".$args{offset}*$config{perpage});
    31453147  my $loglist = $dbh->selectall_arrayref($sql, { Slice => {} }, ($args{id}, @filterargs) );
Note: See TracChangeset for help on using the changeset viewer.