Index: trunk/cgi-bin/IPDB.pm
===================================================================
--- trunk/cgi-bin/IPDB.pm	(revision 626)
+++ trunk/cgi-bin/IPDB.pm	(revision 627)
@@ -460,10 +460,9 @@
   # Just In Case
   $args{vrf} = '' if !$args{vrf};
-  $args{rdepth} = 1 if !$args{rdepth};
 
   # Snag the allocations for this block
-  my $sth = $dbh->prepare("SELECT cidr,city,type,custid,swip,description".
-	" FROM allocations WHERE parent = ? AND rdepth = ? ORDER BY cidr");
-  $sth->execute($args{block},$args{rdepth});
+  my $sth = $dbh->prepare("SELECT cidr,city,type,custid,swip,description,id,master_id".
+	" FROM allocations WHERE parent_id = ? ORDER BY cidr");
+  $sth->execute($args{parent});
 
   # hack hack hack
@@ -472,5 +471,5 @@
 
   my @blocklist;
-  while (my ($cidr,$city,$type,$custid,$swip,$desc) = $sth->fetchrow_array()) {
+  while (my ($cidr,$city,$type,$custid,$swip,$desc,$id) = $sth->fetchrow_array()) {
     $custsth->execute($custid);
     my ($ncust) = $custsth->fetchrow_array();
@@ -484,4 +483,5 @@
 	desc => $desc,
 	hassubs => ($type eq 'rm' || $type =~ /.c/ ? 1 : 0),
+	id => $id,
 	);
 #    $row{subblock} = ($type =~ /^.r$/);         # hmf.  wonder why these won't work in the hash declaration...
Index: trunk/cgi-bin/main.cgi
===================================================================
--- trunk/cgi-bin/main.cgi	(revision 626)
+++ trunk/cgi-bin/main.cgi	(revision 627)
@@ -244,15 +244,15 @@
 # Display blocks immediately within a given parent
 sub showSubs {
-  $page->param(block => $webvar{block});
+  my $pinfo = getBlockData($ip_dbh, $webvar{parent});
+
+  $page->param(del_id => $webvar{parent});
+  $page->param(block => $pinfo->{block});
   $page->param(mayadd => ($IPDBacl{$authuser} =~ /a/));
   $page->param(maydel => ($IPDBacl{$authuser} =~ /d/));
 
-  my $sublist = listSubs($ip_dbh, block => $webvar{block}, rdepth => $webvar{rdepth});
-  $page->param(deldepth => $webvar{rdepth} - 1);
-  $page->param(rdepth => $webvar{rdepth});
-  $page->param(subdepth => $webvar{rdepth} + 1);
+  my $sublist = listSubs($ip_dbh, parent => $webvar{parent});
   $page->param(sublist => $sublist);
 
-  my $flist = listFree($ip_dbh, master => $webvar{block}, rdepth => $webvar{rdepth});
+  my $flist = listFree($ip_dbh, parent => $webvar{parent});
   $page->param(freelist => $flist);
 } # showSubs
Index: trunk/templates/showsubs.tmpl
===================================================================
--- trunk/templates/showsubs.tmpl	(revision 626)
+++ trunk/templates/showsubs.tmpl	(revision 627)
@@ -19,8 +19,8 @@
 <td>
 <TMPL_IF hassubs>
-<a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=showsubs&amp;block=<TMPL_VAR NAME=block>&amp;rdepth=<TMPL_VAR NAME=subdepth>"><TMPL_VAR NAME=block></a>
+<a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=showsubs&amp;parent=<TMPL_VAR NAME=id>"><TMPL_VAR NAME=block></a>
 <TMPL_ELSE>
-<a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=edit&amp;block=<TMPL_VAR NAME=block>&amp;rdepth=<TMPL_VAR NAME=rdepth>"><TMPL_VAR NAME=block></a>
-<TMPL_IF listpool> &nbsp; <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&amp;pool=<TMPL_VAR NAME=block>&amp;rdepth=<TMPL_VAR NAME=rdepth>">List IPs</a></TMPL_IF>
+<a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=edit&amp;id=<TMPL_VAR NAME=id>&amp;basetype=b"><TMPL_VAR NAME=block></a>
+<TMPL_IF listpool> &nbsp; <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&amp;pool=<TMPL_VAR NAME=id>">List IPs</a></TMPL_IF>
 </TMPL_IF>
 </td>
@@ -35,5 +35,5 @@
 <TMPL_ELSE>
 <hr class="w30">
-<div class="tbltitle">No allocations in <TMPL_VAR NAME=block>.
+<div class="tbltitle">No allocations in <TMPL_VAR NAME=block>
 <TMPL_IF maydel>
 <br>
@@ -41,6 +41,6 @@
 <fieldset><legend class="noshow">&nbsp;</legend>
 <input type=hidden name=action value="delete">
-<input type=hidden name=block value="<TMPL_VAR NAME=block>">
-<input type=hidden name=rdepth value="<TMPL_VAR NAME=deldepth>">
+<input type=hidden name=block value="<TMPL_VAR NAME=del_id>">
+<input type=hidden name=basetype value="b">
 <input type=submit value=" Remove this block ">
 </fieldset>
@@ -68,5 +68,5 @@
 <td>
 <TMPL_IF mayadd>
-<a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=assign&amp;block=<TMPL_VAR NAME=fblock>&amp;rdepth=<TMPL_VAR NAME=rdepth>"><TMPL_VAR NAME=fblock></a>
+<a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=assign&amp;block=<TMPL_VAR NAME=fblock>&amp;fbid=<TMPL_VAR NAME=fbid>&amp;parent=<TMPL_VAR NAME=fbparent>"><TMPL_VAR NAME=fblock></a>
 <TMPL_ELSE>
 <TMPL_VAR NAME=fblock>
