Changeset 627
- Timestamp:
- 10/08/14 17:17:38 (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r625 r627 460 460 # Just In Case 461 461 $args{vrf} = '' if !$args{vrf}; 462 $args{rdepth} = 1 if !$args{rdepth};463 462 464 463 # Snag the allocations for this block 465 my $sth = $dbh->prepare("SELECT cidr,city,type,custid,swip,description ".466 " FROM allocations WHERE parent = ? AND rdepth= ? ORDER BY cidr");467 $sth->execute($args{ block},$args{rdepth});464 my $sth = $dbh->prepare("SELECT cidr,city,type,custid,swip,description,id,master_id". 465 " FROM allocations WHERE parent_id = ? ORDER BY cidr"); 466 $sth->execute($args{parent}); 468 467 469 468 # hack hack hack … … 472 471 473 472 my @blocklist; 474 while (my ($cidr,$city,$type,$custid,$swip,$desc ) = $sth->fetchrow_array()) {473 while (my ($cidr,$city,$type,$custid,$swip,$desc,$id) = $sth->fetchrow_array()) { 475 474 $custsth->execute($custid); 476 475 my ($ncust) = $custsth->fetchrow_array(); … … 484 483 desc => $desc, 485 484 hassubs => ($type eq 'rm' || $type =~ /.c/ ? 1 : 0), 485 id => $id, 486 486 ); 487 487 # $row{subblock} = ($type =~ /^.r$/); # hmf. wonder why these won't work in the hash declaration... -
trunk/cgi-bin/main.cgi
r624 r627 244 244 # Display blocks immediately within a given parent 245 245 sub showSubs { 246 $page->param(block => $webvar{block}); 246 my $pinfo = getBlockData($ip_dbh, $webvar{parent}); 247 248 $page->param(del_id => $webvar{parent}); 249 $page->param(block => $pinfo->{block}); 247 250 $page->param(mayadd => ($IPDBacl{$authuser} =~ /a/)); 248 251 $page->param(maydel => ($IPDBacl{$authuser} =~ /d/)); 249 252 250 my $sublist = listSubs($ip_dbh, block => $webvar{block}, rdepth => $webvar{rdepth}); 251 $page->param(deldepth => $webvar{rdepth} - 1); 252 $page->param(rdepth => $webvar{rdepth}); 253 $page->param(subdepth => $webvar{rdepth} + 1); 253 my $sublist = listSubs($ip_dbh, parent => $webvar{parent}); 254 254 $page->param(sublist => $sublist); 255 255 256 my $flist = listFree($ip_dbh, master => $webvar{block}, rdepth => $webvar{rdepth});256 my $flist = listFree($ip_dbh, parent => $webvar{parent}); 257 257 $page->param(freelist => $flist); 258 258 } # showSubs -
trunk/templates/showsubs.tmpl
r568 r627 19 19 <td> 20 20 <TMPL_IF hassubs> 21 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=showsubs& block=<TMPL_VAR NAME=block>&rdepth=<TMPL_VAR NAME=subdepth>"><TMPL_VAR NAME=block></a>21 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=showsubs&parent=<TMPL_VAR NAME=id>"><TMPL_VAR NAME=block></a> 22 22 <TMPL_ELSE> 23 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=edit& block=<TMPL_VAR NAME=block>&rdepth=<TMPL_VAR NAME=rdepth>"><TMPL_VAR NAME=block></a>24 <TMPL_IF listpool> <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&pool=<TMPL_VAR NAME= block>&rdepth=<TMPL_VAR NAME=rdepth>">List IPs</a></TMPL_IF>23 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=edit&id=<TMPL_VAR NAME=id>&basetype=b"><TMPL_VAR NAME=block></a> 24 <TMPL_IF listpool> <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&pool=<TMPL_VAR NAME=id>">List IPs</a></TMPL_IF> 25 25 </TMPL_IF> 26 26 </td> … … 35 35 <TMPL_ELSE> 36 36 <hr class="w30"> 37 <div class="tbltitle">No allocations in <TMPL_VAR NAME=block> .37 <div class="tbltitle">No allocations in <TMPL_VAR NAME=block> 38 38 <TMPL_IF maydel> 39 39 <br> … … 41 41 <fieldset><legend class="noshow"> </legend> 42 42 <input type=hidden name=action value="delete"> 43 <input type=hidden name=block value="<TMPL_VAR NAME= block>">44 <input type=hidden name= rdepth value="<TMPL_VAR NAME=deldepth>">43 <input type=hidden name=block value="<TMPL_VAR NAME=del_id>"> 44 <input type=hidden name=basetype value="b"> 45 45 <input type=submit value=" Remove this block "> 46 46 </fieldset> … … 68 68 <td> 69 69 <TMPL_IF mayadd> 70 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=assign&block=<TMPL_VAR NAME=fblock>& rdepth=<TMPL_VAR NAME=rdepth>"><TMPL_VAR NAME=fblock></a>70 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=assign&block=<TMPL_VAR NAME=fblock>&fbid=<TMPL_VAR NAME=fbid>&parent=<TMPL_VAR NAME=fbparent>"><TMPL_VAR NAME=fblock></a> 71 71 <TMPL_ELSE> 72 72 <TMPL_VAR NAME=fblock>
Note:
See TracChangeset
for help on using the changeset viewer.