Changeset 916 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
05/01/18 13:29:29 (7 years ago)
Author:
Kris Deugau
Message:

/trunk

Continue adding a generalized block-notice system. See #17 and #23, sort of.
Add a retrieval sub for block notices to IPDB.pm
Wrap the new module sub in a local sub in main.cgi, since the primary

web-UI actions will be called from a number of places

Update the block assignment templates and call the new local sub for

block assignment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r913 r916  
    513513
    514514    my $pinfo = getBlockData($ip_dbh, $webvar{parent});
     515
     516    # retrieve any notices
     517    blocknotices($webvar{parent});
    515518
    516519    my @cities;
     
    770773  $page->param(dnslocal => 1) unless ($pinfo->{revpartial} || $pinfo->{revavail});
    771774
     775  # retrieve any notices
     776  blocknotices($webvar{parent});
     777
    772778  # reserve for expansion
    773779  $page->param(reserve => $webvar{reserve});
     
    17631769
    17641770} # finalDelete
     1771
     1772# Retrive and lightly preprocess any block notices.
     1773sub blocknotices {
     1774  my $blockid = shift;
     1775  # retrieve any notices
     1776  my $nlist = getBlockNotices($ip_dbh, $blockid);
     1777  my @notices;
     1778  foreach (@$nlist) {
     1779    push @notices, $_->{notice} if $_->{notice};
     1780  }
     1781  my $blockmsg = join("<br>\n", @notices);
     1782  $page->param(blockmsg => $blockmsg);
     1783}
Note: See TracChangeset for help on using the changeset viewer.