Changeset 572


Ignore:
Timestamp:
12/30/13 17:42:06 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix bug with reverse zones not activating/deactivating properly. This
changes the return from getZoneList slightly, for consistency.

Update the bulk domain change page to match.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r571 r572  
    23072307  if ($args{revrec} eq 'n') {
    23082308    $args{sortby} = 'domain' if !$args{sortby} || !grep /^$args{sortby}$/, ('domain','group','status');
    2309     $sql = "SELECT domain_id,domain,status,groups.group_name AS group FROM domains".
     2309    $sql = "SELECT domain_id AS zoneid,domain AS zone,status,groups.group_name AS group FROM domains".
    23102310        " INNER JOIN groups ON domains.group_id=groups.group_id".
    23112311        " WHERE domains.group_id IN ($args{curgroup}".($args{childlist} ? ",$args{childlist}" : '').")".
     
    23152315##fixme:  arguably startwith here is irrelevant.  depends on the UI though.
    23162316    $args{sortby} = 'revnet' if !$args{sortby} || !grep /^$args{sortby}$/, ('revnet','group','status');
    2317     $sql = "SELECT rdns_id,revnet,status,groups.group_name AS group FROM revzones".
     2317    $sql = "SELECT rdns_id AS zoneid,revnet AS zone,status,groups.group_name AS group FROM revzones".
    23182318        " INNER JOIN groups ON revzones.group_id=groups.group_id".
    23192319        " WHERE revzones.group_id IN ($args{curgroup}".($args{childlist} ? ",$args{childlist}" : '').")".
     
    23252325        ($args{offset} eq 'all' ? '' : " LIMIT $self->{perpage}".
    23262326        " OFFSET ".$args{offset}*$self->{perpage});
    2327   my $sth = $dbh->prepare($sql);
    2328   $sth->execute(@filterargs);
    2329   my $rownum = 0;
    2330 
    2331   while (my @data = $sth->fetchrow_array) {
    2332     my %row;
    2333     $row{domain_id} = $data[0];
    2334     $row{domain} = $data[1];
    2335     $row{status} = $data[2];
    2336     $row{group} = $data[3];
    2337     push @zonelist, \%row;
    2338   }
    2339 
    2340   return \@zonelist;
     2327
     2328  my $ret = $dbh->selectall_arrayref($sql, { Slice => {} }, @filterargs);
     2329  return $ret;
    23412330} # end getZoneList()
    23422331
  • trunk/templates/bulkdomain.tmpl

    r493 r572  
    3838<table>
    3939<tr>
    40 <TMPL_LOOP NAME=domtable><td><input type="checkbox" name="dom_<TMPL_VAR NAME=domain_id>" value="<TMPL_VAR NAME=domain_id>" /> <TMPL_VAR NAME=domain></td>
     40<TMPL_LOOP NAME=domtable><td><input type="checkbox" name="dom_<TMPL_VAR NAME=zoneid>" value="<TMPL_VAR NAME=zoneid>" /> <TMPL_VAR NAME=zone></td>
    4141<TMPL_IF newrow></tr>
    4242<tr>
  • trunk/templates/domlist.tmpl

    r538 r572  
    3939<TMPL_LOOP name=domtable>
    4040<tr class="row<TMPL_IF __odd__>0<TMPL_ELSE>1</TMPL_IF>">
    41         <td align="left"><a href="<TMPL_VAR NAME=script_self>&amp;page=reclist&amp;id=<TMPL_VAR NAME=domain_id>&amp;defrec=n<TMPL_UNLESS domlist>&amp;revrec=y</TMPL_UNLESS>"><TMPL_VAR NAME=domain></a></td>
     41        <td align="left"><a href="<TMPL_VAR NAME=script_self>&amp;page=reclist&amp;id=<TMPL_VAR NAME=zoneid>&amp;defrec=n<TMPL_UNLESS domlist>&amp;revrec=y</TMPL_UNLESS>"><TMPL_VAR NAME=zone></a></td>
    4242        <td><TMPL_IF status>Active<TMPL_ELSE>Inactive</TMPL_IF></td>
    4343        <td><TMPL_VAR name=group></td>
    44 <TMPL_IF domain_edit>   <td align="center"><a href="<TMPL_VAR NAME=script_self>&amp;page=<TMPL_VAR NAME=curpage><TMPL_IF NAME=offset>&amp;offset=<TMPL_VAR NAME=offset></TMPL_IF>&amp;id=<TMPL_VAR NAME=domainid>&amp;zonestatus=<TMPL_IF status>domoff<TMPL_ELSE>domon</TMPL_IF>"><TMPL_IF status>deactivate<TMPL_ELSE>activate</TMPL_IF></a></td></TMPL_IF>
     44<TMPL_IF domain_edit>   <td align="center"><a href="<TMPL_VAR NAME=script_self>&amp;page=<TMPL_VAR NAME=curpage><TMPL_IF NAME=offset>&amp;offset=<TMPL_VAR NAME=offset></TMPL_IF>&amp;id=<TMPL_VAR NAME=zoneid>&amp;zonestatus=<TMPL_IF status>domoff<TMPL_ELSE>domon</TMPL_IF>"><TMPL_IF status>deactivate<TMPL_ELSE>activate</TMPL_IF></a></td></TMPL_IF>
    4545<TMPL_IF domain_delete> <td align="center"><a href="<TMPL_VAR NAME=script_self>&amp;page=<TMPL_IF domlist>deldom<TMPL_ELSE>delrevzone</TMPL_IF>&amp;id=<TMPL_VAR NAME=domain_id>"><img src="images/trash2.png" alt="[ Delete ]" /></a></td></TMPL_IF>
    4646</tr>
Note: See TracChangeset for help on using the changeset viewer.