Changeset 603 for trunk


Ignore:
Timestamp:
03/28/14 15:31:55 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak record type dropdown list sub to include an entry for the type
passed in, even if that type would not normally be listed (typically
for reverse zones, which have a more limited type list). See #53.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r602 r603  
    43784378  $sth->execute;
    43794379  my @typelist;
     4380  # track whether the passed type is in the list at all.  allows you to edit a record
     4381  # that wouldn't otherwise be generally available in that zone (typically, reverse zones)
     4382  # without changing its type (accidentally or otherwise)
     4383  my $selflag = 0;
    43804384  while (my ($rval,$rname) = $sth->fetchrow_array()) {
    43814385    my %row = ( recval => $rval, recname => $rname );
    4382     $row{tselect} = 1 if $rval == $type;
     4386    if ($rval == $type) {
     4387      $row{tselect} = 1;
     4388      $selflag = 1;
     4389    }
     4390    push @typelist, \%row;
     4391  }
     4392
     4393  # add the passed type if it wasn't in the list
     4394  if (!$selflag) {
     4395    my %row = ( recval => $type, recname => $typemap{$type}, tselect => 1 );
    43834396    push @typelist, \%row;
    43844397  }
Note: See TracChangeset for help on using the changeset viewer.