Changeset 313
- Timestamp:
- 04/23/12 23:34:37 (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r311 r313 984 984 } elsif ($webvar{page} eq 'bulkdomain') { 985 985 # Bulk operations on domains. Note all but group move are available on the domain list. 986 ##fixme: do we care about bulk operations on revzones? Move-to-group, activate, deactivate, 987 # and delete should all be much rarer for revzones than for domains. 986 988 987 989 changepage(page => "domlist", errmsg => "You are not permitted to make bulk domain changes") … … 990 992 fill_grouplist("grouplist"); 991 993 992 ##fixme 993 ##fixme push the SQL and direct database fiddling off into a sub in DNSDB.pm 994 ##fixme 995 996 my $sth = $dbh->prepare("SELECT count(*) FROM domains WHERE group_id=?"); 997 $sth->execute($curgroup); 998 my ($count) = ($sth->fetchrow_array); 994 my $count = getZoneCount($dbh, (revrec => 'n', curgroup => $curgroup) ); 999 995 1000 996 $page->param(curpage => $webvar{page}); … … 1003 999 $page->param(perpage => $perpage); 1004 1000 1005 my @domlist; 1006 my $sql = "SELECT domain_id,domain FROM domains". 1007 " WHERE group_id=?". 1008 " ORDER BY domain". 1009 ($offset eq 'all' ? '' : " LIMIT $perpage OFFSET ".$offset*$perpage); 1010 $sth = $dbh->prepare($sql); 1011 $sth->execute($curgroup); 1001 my $domlist = getZoneList($dbh, (revrec => 'n', curgroup => $curgroup) ); 1012 1002 my $rownum = 0; 1013 while (my @data = $sth->fetchrow_array) { 1014 my %row; 1015 $row{domid} = $data[0]; 1016 $row{domain} = $data[1]; 1017 $rownum++; # putting this in the expression below causes failures. *eyeroll* 1018 $row{newrow} = $rownum % 5 == 0; 1019 push @domlist, \%row; 1020 } 1021 $page->param(domtable => \@domlist); 1003 foreach my $dom (@{$domlist}) { 1004 delete $dom->{status}; 1005 delete $dom->{group}; 1006 $dom->{newrow} = (++$rownum) % 5 == 0; 1007 } 1008 1009 $page->param(domtable => $domlist); 1022 1010 # ACLs 1023 1011 $page->param(maymove => ($permissions{admin} || ($permissions{domain_edit} && $permissions{domain_create} && $permissions{domain_delete}))); -
trunk/templates/bulkdomain.tmpl
r207 r313 40 40 <table> 41 41 <tr> 42 <TMPL_LOOP NAME=domtable><td><input type="checkbox" name="dom_<TMPL_VAR NAME=dom id>" value="<TMPL_VAR NAME=domid>" /> <TMPL_VAR NAME=domain></td>42 <TMPL_LOOP NAME=domtable><td><input type="checkbox" name="dom_<TMPL_VAR NAME=domainid>" value="<TMPL_VAR NAME=domainid>" /> <TMPL_VAR NAME=domain></td> 43 43 <TMPL_IF newrow></tr> 44 44 <tr>
Note:
See TracChangeset
for help on using the changeset viewer.