Changeset 42


Ignore:
Timestamp:
12/07/09 17:33:42 (15 years ago)
Author:
Kris Deugau
Message:

/trunk

checkpoint - start coding support for filter/search on groups

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r41 r42  
    656656  $page->param(grptree => $tmpgrplist);
    657657
     658  $page->param(inlogingrp => $curgroup == $logingroup);
     659
    658660  # stuff for menu group change.  nb: this is icky.
    659661  fill_grouplist("grouplist");
     
    664666  $tmp_ruri =~ s/\&action=[^&]+//g;
    665667# and any bits from the "starts with" letter block - (ab)using this widget
    666 # to fill the bulk of the URI so the template doesn't grow to insanity
     668# to fill the bulk of the URI so various templates don't grow to insanity
    667669  $tmp_ruri =~ s/\&startwith=[a-z09-]+//g;
    668670#  $page->param(whereami => $ENV{REQUEST_URI});
     
    9991001  fill_fpnla($count);
    10001002
     1003  $sortby = 'group';
     1004# sort/order
     1005  $sortby = $webvar{sortby} if $webvar{sortby};
     1006  $sortorder = $webvar{order} if $webvar{order};
     1007
     1008if (0){
     1009##fixme: yick
     1010  if ($sortby eq 'group') {
     1011    $page->param(grporder => ($sortorder eq 'ASC' ? 'DESC' : 'ASC'));
     1012    $page->param(parentorder => 'ASC');
     1013    $page->param(nusersorder => 'ASC');
     1014    $page->param(ndomainsorder => 'ASC');
     1015    $page->param(sortgrp => 1);
     1016  } elsif ($sortby eq 'parent') {
     1017    $page->param(grporder => 'ASC');
     1018    $page->param(parentorder => ($sortorder eq 'ASC' ? 'DESC' : 'ASC'));
     1019    $page->param(nusersorder => 'ASC');
     1020    $page->param(ndomainsorder => 'ASC');
     1021    $page->param(sortparent => 1);
     1022  } elsif ($sortby eq 'nusers') {
     1023    $page->param(grporder => 'ASC');
     1024    $page->param(parentorder => 'ASC');
     1025    $page->param(nusersorder => ($sortorder eq 'ASC' ? 'DESC' : 'ASC'));
     1026    $page->param(ndomainsorder => 'ASC');
     1027    $page->param(sortnusers => 1);
     1028  } elsif ($sortby eq 'ndomains') {
     1029    $page->param(grporder => 'ASC');
     1030    $page->param(parentorder => 'ASC');
     1031    $page->param(nusersorder => 'ASC');
     1032    $page->param(ndomainsorder => ($sortorder eq 'ASC' ? 'DESC' : 'ASC'));
     1033    $page->param(sortndomains => 1);
     1034  } else {
     1035    $page->param(grporder => 'ASC');
     1036    $page->param(parentorder => 'ASC');
     1037    $page->param(nusersorder => 'ASC');
     1038    $page->param(ndomainsorder => 'ASC');
     1039  }
     1040
     1041  $page->param(sortorder => $sortorder);
     1042}
     1043
     1044my @cols = ('group','parent','nusers','ndomains');
     1045
     1046my @headings;
     1047
     1048  $sortorder = $webvar{sortorder} if $webvar{sortorder};
     1049foreach my $colhead (@cols) {
     1050  my %coldata;
     1051  $coldata{firstcol} = 1 if $colhead eq $cols[0];
     1052  $coldata{sid} = $sid;
     1053  $coldata{page} = $webvar{page};
     1054  $coldata{offset} = $webvar{offset} if $webvar{offset};
     1055  $coldata{sortby} = $colhead;
     1056  if ($colhead eq $sortby) {
     1057push @debugbits, "$colhead $sortby $sortorder<br>\n";
     1058    $coldata{order} = ($sortorder eq 'ASC' ? 'DESC' : 'ASC');
     1059    $coldata{sortorder} = $sortorder;
     1060  } else {
     1061    $coldata{order} = 'ASC';
     1062  }
     1063  push @headings, \%coldata;
     1064}
     1065
     1066$page->param(colheads => \@headings);
     1067
    10011068  my @grouplist;
    10021069  $sth = $dbh->prepare("SELECT g.group_id, g.group_name, g2.group_name, ".
  • trunk/templates/dns.css

    r41 r42  
    134134        margin-left: 10px;
    135135        padding: 0px;
     136        list-style: none outside none;
    136137}
    137138/* F*** ME BUT THIS LOOKS LIKE CRAP! */
    138139/* Need to find a way to vertically centre the plus image on the text.  >:(  */
    139 li.hassub {
     140/*li.hassub {
    140141        list-style: none outside url('../images/plus.gif');
    141142}
    142143li.leaf {
    143144        list-style: none outside none;
    144 }
     145} */
     146
    145147#grptree {
    146         margin-left: 15px;
     148        //margin-left: 15px;
    147149}
    148150/* general classes */
  • trunk/templates/grpman.tmpl

    r41 r42  
    2424<table width="98%" border="0" cellspacing="4" cellpadding="3">
    2525<tr>
    26         <td class="datahead_l"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=group&amp;order=<TMPL_VAR NAME=grporder>">Domain</a><TMPL_IF NAME=sortgrp>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>" src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
    27         <td class="datahead_s"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=parent&amp;order=<TMPL_VAR NAME=parentorder>">Parent Group</a><TMPL_IF NAME=sortparent>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>" src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
    28         <td class="datahead_s"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=nusers&amp;order=<TMPL_VAR NAME=nusersorder>">Users</a><TMPL_IF NAME=sortnusers>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>" src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
    29         <td class="datahead_s"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=ndomains&amp;order=<TMPL_VAR NAME=ndomainsorder>">Domains</a><TMPL_IF NAME=sortndomains>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>" src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
     26<TMPL_IF foobarbaz>
     27        <td class="datahead_l"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF
     28NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=group&amp;order=<TMPL_VAR
     29NAME=grporder>">Group</a><TMPL_IF NAME=sortgrp>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>" src="images/<TMPL_VAR
     30NAME=sortorder>.png" /></TMPL_IF></td>
     31        <td class="datahead_s"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF
     32NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=parent&amp;order=<TMPL_VAR
     33NAME=parentorder>">Parent Group</a><TMPL_IF NAME=sortparent>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>"
     34src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
     35        <td class="datahead_s"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF
     36NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=nusers&amp;order=<TMPL_VAR
     37NAME=nusersorder>">Users</a><TMPL_IF NAME=sortnusers>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>"
     38src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
     39        <td class="datahead_s"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman&amp;<TMPL_IF
     40NAME=offset>offset=<TMPL_VAR NAME=offset>&amp;</TMPL_IF>sortby=ndomains&amp;order=<TMPL_VAR
     41NAME=ndomainsorder>">Domains</a><TMPL_IF NAME=sortndomains>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>"
     42src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
     43<TMPL_ELSE>
     44<TMPL_LOOP NAME=colheads>
     45<td class="datahead_<TMPL_IF firstcol>l<TMPL_ELSE>s</TMPL_IF>"><a href="dns.cgi?sid=<TMPL_VAR
     46NAME=sid>&amp;page=<TMPL_VAR NAME=page><TMPL_IF NAME=offset>&amp;offset=<TMPL_VAR
     47NAME=offset></TMPL_IF>&amp;sortby=<TMPL_VAR NAME=sortby>&amp;order=<TMPL_VAR NAME=order>"><TMPL_VAR
     48NAME=colname><TMPL_VAR NAME=sortby></a><TMPL_IF NAME=sortorder>&nbsp;<img alt="<TMPL_VAR NAME=sortorder>"
     49src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
     50</TMPL_LOOP>
     51</TMPL_IF>
    3052        <td class="datahead_s">Delete</td>
    3153</tr>
  • trunk/templates/menu.tmpl

    r41 r42  
    2222<hr />
    2323<a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=grpman">Manage groups</a><br />
    24 <div id="grptree"><TMPL_VAR NAME=grptree></div>
     24<div id="grptree"><ul><TMPL_IF inlogingrp><b><TMPL_VAR NAME=groupname></b><TMPL_ELSE><TMPL_VAR NAME=groupname></TMPL_IF><TMPL_VAR NAME=grptree></ul></div>
    2525<!-- hmm:  <TMPL_VAR NAME=groupname> -->
    2626<hr />
Note: See TracChangeset for help on using the changeset viewer.