- Timestamp:
- 08/24/15 18:10:42 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r765 r766 680 680 } 681 681 682 # split up some linked data for static IPs via guided allocation. needed for breadcrumbs lite.683 ($webvar{alloc_from},$webvar{rdepth}) = split /,/, $webvar{alloc_from} if $webvar{alloc_from} =~ /,/;684 685 682 # $code is "success" vs "failure", $msg contains OK for a 686 683 # successful netblock allocation, the IP allocated for static … … 714 711 ); 715 712 713 my $pinfo = getBlockData($ip_dbh, $webvar{parent}); 714 715 # clean up a minor mess with guided allocation of static IPs 716 if ($webvar{alloctype} =~ /^.i$/) { 717 $insert_args{alloc_from} = $pinfo->{block}; 718 } 719 716 720 my ($code,$msg) = allocateBlock($ip_dbh, %insert_args, iprev => \%iprev); 717 721 718 722 if ($code eq 'OK') { 723 # breadcrumbs lite! provide at least a link to the parent of the block we just allocated. 724 $page->param(parentid => $webvar{parent}); 725 $page->param(parentblock => $pinfo->{block}); 726 719 727 if ($webvar{alloctype} =~ /^.i$/) { 720 728 $msg =~ s|/32||; 721 729 $page->param(staticip => $msg); 722 730 $page->param(custid => $webvar{custid}); 723 $page->param(parent => $webvar{parent}, pool => $webvar{alloc_from});724 731 $page->param(billinguser => $webvar{billinguser}); 725 732 mailNotify($ip_dbh, "a$webvar{alloctype}", "ADDED: $disp_alloctypes{$webvar{alloctype}} allocation", … … 732 739 $page->param(custid => $webvar{custid}); 733 740 734 # breadcrumbs lite! provide at least a link to the parent of the block we just allocated.735 my $binfo = getBlockData($ip_dbh, $webvar{parent});736 $page->param(parentid => $webvar{parent});737 $page->param(parentblock => $binfo->{block});738 739 741 # Full breadcrumbs 740 742 my $crumbs = getBreadCrumbs($ip_dbh, $webvar{parent}); … … 757 759 syslog "err", "Allocation of '$webvar{fullcidr}' to '$webvar{custid}' as ". 758 760 "'$webvar{alloctype}' by $authuser failed: '$msg'"; 759 $page->param(err => "Allocation of $webvar{fullcidr} as '$disp_alloctypes{$webvar{alloctype}}' ".760 " failed:<br>\n$msg\n");761 $page->param(err => "Allocation of $webvar{fullcidr} as '$disp_alloctypes{$webvar{alloctype}}' failed:"); 762 $page->param(errmsg => $msg); 761 763 } 762 764 … … 1429 1431 $page->param(block => $blockinfo->{block}); 1430 1432 $page->param(bdisp => $q->escapeHTML($disp_alloctypes{$blockinfo->{type}})); 1431 $page->param(delparent_id => $blockinfo->{parent_id}); # if $webvar{rdepth};1433 $page->param(delparent_id => $blockinfo->{parent_id}); 1432 1434 if ($pinfo) { 1433 1435 $page->param(delparent => $pinfo->{block}); -
trunk/templates/confirm.tmpl
r692 r766 26 26 <TMPL_IF staticip> 27 27 <td> 28 <select name=" alloc_from">29 <TMPL_LOOP name=poollist> <option value="<TMPL_VAR NAME=pool block>,<TMPL_VAR NAME=poolrdepth>"><TMPL_VAR NAME=poolblock> [<TMPL_VAR NAME=poolfree>] free IP(s) in <TMPL_VAR NAME=poolcit></option>28 <select name="parent"> 29 <TMPL_LOOP name=poollist> <option value="<TMPL_VAR NAME=poolid>"><TMPL_VAR NAME=poolblock> [<TMPL_VAR NAME=poolfree>] free IP(s) in <TMPL_VAR NAME=poolcit></option> 30 30 </TMPL_LOOP></select> 31 31 </td> … … 61 61 </div> 62 62 </TMPL_IF> 63 64 63 </td> 65 64 </tr> … … 120 119 <tr> 121 120 <td class="center" colspan="2"> 122 <TMPL_UNLESS poollist><input type="hidden" name="alloc_from" value="<TMPL_VAR NAME=alloc_from>"></TMPL_UNLESS> 121 <TMPL_UNLESS poollist> 122 <input type="hidden" name="alloc_from" value="<TMPL_VAR NAME=alloc_from>"> 123 123 <input type="hidden" name="parent" value="<TMPL_VAR NAME=parent>"> 124 </TMPL_UNLESS> 124 125 <input type="hidden" name="fbid" value="<TMPL_VAR NAME=fbid>"> 125 126 <TMPL_IF resvblock><input type="hidden" name="reserve" value="<TMPL_VAR NAME=reserve>"></TMPL_IF> -
trunk/templates/insert.tmpl
r633 r766 1 1 <TMPL_IF err> 2 2 <div class="err"> 3 <p><TMPL_VAR NAME=err></p> 3 <div class="heading"><TMPL_VAR NAME=err></div> 4 <p><TMPL_VAR NAME=errmsg></p> 4 5 <input type="button" value="Back" onclick="history.go(-1)"> 5 6 </div> … … 12 13 </TMPL_IF> 13 14 </div> 14 <div class="center">IPs in <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&pool=<TMPL_VAR 15 NAME=parent>"><TMPL_VAR NAME=pool></a></div> 15 <div class="center">IPs in <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&pool=<TMPL_VAR NAME=parentid>"><TMPL_VAR NAME=parentblock></a></div> 16 16 <TMPL_ELSE> 17 17 <div class="center">
Note:
See TracChangeset
for help on using the changeset viewer.