Changeset 43 for trunk/dns.cgi
- Timestamp:
- 12/09/09 17:08:46 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r42 r43 651 651 $page->param(group => $curgroup); 652 652 $page->param(groupname => groupName($dbh,$curgroup)); 653 $page->param(logingrp => groupName($dbh,$logingroup)); 653 654 654 655 # group tree. should go elsewhere, probably … … 1044 1045 my @cols = ('group','parent','nusers','ndomains'); 1045 1046 1047 my %colnames = (group => 'Group', parent => 'Parent Group', nusers => 'Users', ndomains => 'Domains'); 1048 1049 fill_colheads(\@cols, \%colnames); 1050 1051 if (0) { 1046 1052 my @headings; 1047 1053 1048 1054 $sortorder = $webvar{sortorder} if $webvar{sortorder}; 1049 foreach my $col head(@cols) {1055 foreach my $col (@cols) { 1050 1056 my %coldata; 1051 $coldata{firstcol} = 1 if $col headeq $cols[0];1057 $coldata{firstcol} = 1 if $col eq $cols[0]; 1052 1058 $coldata{sid} = $sid; 1053 1059 $coldata{page} = $webvar{page}; 1054 1060 $coldata{offset} = $webvar{offset} if $webvar{offset}; 1055 $coldata{sortby} = $col head;1056 if ($colhead eq $sortby) {1057 push @debugbits, "$colhead $sortby $sortorder<br>\n"; 1061 $coldata{sortby} = $col; 1062 $coldata{colname} = $colnames{$col}; 1063 if ($col eq $sortby) { 1058 1064 $coldata{order} = ($sortorder eq 'ASC' ? 'DESC' : 'ASC'); 1059 1065 $coldata{sortorder} = $sortorder; … … 1065 1071 1066 1072 $page->param(colheads => \@headings); 1073 1074 } # temp 1067 1075 1068 1076 my @grouplist; … … 1157 1165 $page->param(usertable => \@userlist); 1158 1166 } 1167 1168 # Generate all of the glop necessary to add or not the appropriate marker/flag for 1169 # the sort order and column in domain, user, group, and record lists 1170 # Takes an array ref and hash ref 1171 sub fill_colheads { 1172 my $cols = shift; 1173 my $colnames = shift; 1174 1175 my @headings; 1176 1177 foreach my $col (@$cols) { 1178 my %coldata; 1179 $coldata{firstcol} = 1 if $col eq $cols->[0]; 1180 $coldata{sid} = $sid; 1181 $coldata{page} = $webvar{page}; 1182 $coldata{offset} = $webvar{offset} if $webvar{offset}; 1183 $coldata{sortby} = $col; 1184 $coldata{colname} = $colnames->{$col}; 1185 if ($col eq $sortby) { 1186 $coldata{order} = ($sortorder eq 'ASC' ? 'DESC' : 'ASC'); 1187 $coldata{sortorder} = $sortorder; 1188 } else { 1189 $coldata{order} = 'ASC'; 1190 } 1191 push @headings, \%coldata; 1192 } 1193 1194 $page->param(colheads => \@headings); 1195 1196 } # end gentableheadings
Note:
See TracChangeset
for help on using the changeset viewer.