Changeset 916


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

Location:
trunk
Files:
3 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}
  • trunk/templates/assign.tmpl

    r892 r916  
    11<div class="indent">
     2
     3<TMPL_IF blockmsg><br><div class="strongwarning blockcenter w70"><TMPL_VAR NAME=blockmsg></div><br></TMPL_IF>
    24
    35<form method="post" action="main.cgi" class="regular">
  • trunk/templates/confirm.tmpl

    r878 r916  
    1212</div>
    1313</TMPL_IF>
     14
     15<TMPL_IF blockmsg><br><div class="strongwarning blockcenter w70"><TMPL_VAR NAME=blockmsg></div><br></TMPL_IF>
     16
    1417<form method="POST" action="main.cgi" class="regular">
    1518<fieldset><legend class="noshow">&nbsp;</legend>
Note: See TracChangeset for help on using the changeset viewer.