Changeset 576 for trunk/cgi-bin


Ignore:
Timestamp:
12/21/12 17:49:08 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Work in progress, see #5:
Update templates and calling code for allocation update to pass
around rdepth as needed, and to set some breadcrumbs-lite to
make it easier to get back where you were

Location:
trunk/cgi-bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r574 r576  
    10591059  return ('FAIL', 'No fields to update') if !@fieldlist;
    10601060
    1061   push @vallist, $args{block};
     1061  push @vallist, $args{block}, $args{rdepth}, $args{vrf};
    10621062  my $sql = "UPDATE $updtable SET ";
    10631063  $sql .= join " = ?, ", @fieldlist;
    1064   $sql .= " = ? WHERE $keyfield = ?";
     1064  $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? AND vrf = ?";
    10651065
    10661066  eval {
  • trunk/cgi-bin/main.cgi

    r575 r576  
    621621
    622622  # snag block info from db
    623   my $blockinfo = getBlockData($ip_dbh, $webvar{block});
     623  my $blockinfo = getBlockData($ip_dbh, $webvar{block}, $webvar{rdepth});
    624624
    625625  # Clean up extra whitespace on alloc type.  Mainly a legacy-data cleanup.
     
    627627
    628628  $page->param(block => $webvar{block});
     629  $page->param(rdepth   => $blockinfo->{rdepth});
    629630
    630631  $page->param(custid   => $blockinfo->{custid});
     
    715716        type            => $webvar{alloctype},
    716717        swip            => $webvar{swip},
     718        rdepth          => $webvar{rdepth},
    717719        );
    718720
     
    745747
    746748  # Link back to browse-routed or list-pool page on "Update complete" page.
    747   my $cblock;
     749  my $cblock = getBlockData($ip_dbh, $webvar{block}, $webvar{rdepth});
    748750  if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) {
    749751    $page->param(backpool => 1);
    750     $cblock = ipParent($ip_dbh, $webvar{block});
     752    $page->param(backblock => $cblock->{pool});
    751753  } else {
    752     $cblock = blockParent($ip_dbh, $webvar{block});
    753   }
    754   $page->param(backblock => $cblock->{cidr});
     754    $page->param(backblock => $cblock->{parent});
     755  }
     756  $page->param(backdepth => ($webvar{rdepth}));
    755757
    756758  # Do some HTML fiddling here instead of using ESCAPE=HTML in the template,
Note: See TracChangeset for help on using the changeset viewer.