Changeset 331


Ignore:
Timestamp:
05/09/12 17:22:01 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak getChildren() a little with a trailing sort-by-name. This
makes the ordering of groups predictable, and allows indentation
of the list in dropdowns.

This should probably be extended to be able to sort on some other
criteria.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r330 r331  
    21342134    # by definition, group 1 is the Root Of All Groups
    21352135    my $sth = $dbh->prepare("SELECT group_id FROM groups WHERE NOT (group_id=1)".
    2136         ($immed ne 'all' ? " AND parent_group_id=1" : ''));
     2136        ($immed ne 'all' ? " AND parent_group_id=1" : '')." ORDER BY group_name");
    21372137    $sth->execute;
    21382138    while (my @this = $sth->fetchrow_array) {
     
    21402140    }
    21412141  } else {
    2142     my $sth = $dbh->prepare("SELECT group_id FROM groups WHERE parent_group_id=?");
     2142    my $sth = $dbh->prepare("SELECT group_id FROM groups WHERE parent_group_id=? ORDER BY group_name");
    21432143    $sth->execute($rootgroup);
    21442144    return if $sth->rows == 0;
Note: See TracChangeset for help on using the changeset viewer.