Changeset 438 for trunk


Ignore:
Timestamp:
07/20/10 12:05:09 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix up add-notice process to allow adding new-city and new-node failures.
(Re-) closes #21.

File:
1 edited

Legend:

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

    r436 r438  
    548548<td>Recipients</td><td colspan=3><textarea name=reciplist cols=50 rows=5></textarea></td></tr>
    549549<tr><td>Action</td><td>
    550         <input type=radio name=msgaction value=a>Add &nbsp;
    551         <input type=radio name=msgaction value=u>Update &nbsp;
    552         <input type=radio name=msgaction value=d>Delete
    553         <input type=radio name=msgaction value=s:>Special: <input name=special>(requires code changes)
     550        <table><tr>
     551                <td><input type=radio name=msgaction value=a>Add &nbsp;
     552                <input type=radio name=msgaction value=u>Update &nbsp;
     553                <input type=radio name=msgaction value=d>Delete &nbsp;
     554                <input type=radio name=msgaction value=n>New listitem</td>
     555        </tr><tr>
     556                <td>
     557                <input type=radio name=msgaction value=s:>Special: <input name=special>(requires code changes)
     558        </td></tr></table>
    554559</td>
    555560<td>Failure?</td><td><input type=checkbox name=onfail></td></tr>
    556 <tr><td>Allocation type:</td><td colspan=3>
     561<tr><td>Event/Allocation type:</td><td colspan=3>
    557562        <table>
    558563        <tr>
    559564                <td><input type=radio name=alloctype value=a>All allocations</td>
    560565                <td><input type=radio name=alloctype value=.i>All static IPs</td>
     566                <td><input type=radio name=alloctype value=ci>New city</td>
     567                <td><input type=radio name=alloctype value=no>New node</td>
    561568        </tr>
    562569        <tr>
     
    587594  if ($webvar{msgaction} && $webvar{alloctype} && $webvar{reciplist}) {
    588595    $webvar{reciplist} =~ s/[\r\n]+/,/g;
     596    $webvar{msgaction} = "f:$webvar{msgaction}" if $webvar{onfail};
    589597    print "Adding notice to $webvar{reciplist} for ".dispNoticeCode($webvar{msgaction}.$webvar{alloctype}).":\n";
    590598    $sth = $ip_dbh->prepare("INSERT INTO notify (action, reciplist) VALUES (?,?)");
    591599##fixme:  automagically merge reciplists iff action already exists
    592     $webvar{msgaction} = "f:$webvar{msgaction}" if $webvar{onfail};
    593600    $sth->execute($webvar{msgaction}.$webvar{alloctype}, $webvar{reciplist});
    594601    if ($sth->err) {
     
    816823# this should give an idea of the structure tho
    817824    if ($target eq 'a') { $action_out .= "all"; }
    818     elsif ($target =~ /^\.i$/) {
     825    elsif ($target eq '.i') {
    819826      $action_out .= "all static IPs";
    820827    }
Note: See TracChangeset for help on using the changeset viewer.