Changeset 424


Ignore:
Timestamp:
07/06/10 17:59:43 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

checkpoint, email notice management. See #21.
Completed delete notice entry.

Still need to add custom code to support legacy notify-on-SWIP.

File:
1 edited

Legend:

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

    r423 r424  
    537537
    538538# add new entries from this tangle:
    539   print "Add new notification:<br>\n";
     539  print "<h4>Add new notification:</h4>\n".
     540        "Note:  Failure notices on most conditions are not yet supported.\n";
    540541
    541542  print qq(<table border=1><form action=admin.cgi method="POST">
     
    547548        <input type=radio name=msgaction value=u>Update &nbsp;
    548549        <input type=radio name=msgaction value=d>Delete
     550        <input type=radio name=msgaction value=s:>Special: <input name=special>(requires code changes)
    549551</td>
    550552<td>Failure?</td><td><input type=checkbox name=onfail></td></tr>
     
    579581
    580582} elsif ($webvar{action} eq 'addnotice') {
    581 ##work
    582583  $webvar{reciplist} =~ s/[\r\n]+/,/g;
    583584  print "Adding notice to $webvar{reciplist} for ".dispNoticeCode($webvar{msgaction}.$webvar{alloctype}).":\n";
     
    586587  $webvar{msgaction} = "f:$webvar{msgaction}" if $webvar{onfail};
    587588  $sth->execute($webvar{msgaction}.$webvar{alloctype}, $webvar{reciplist});
     589  if ($sth->err) {
     590    print "Failed:  DB error: ".$sth->errstr."\n";
     591  } else {
     592    print "OK!<br>\n"
     593  }
     594  print qq(<a href="admin.cgi?action=emailnotice">Back to email notice list</a>\n);
     595
     596} elsif ($webvar{action} eq 'delnotice') {
     597  print "Deleting notices on ".dispNoticeCode($webvar{code}.$webvar{alloctype}).":\n";
     598  $sth = $ip_dbh->prepare("DELETE FROM notify WHERE action=?");
     599  $sth->execute($webvar{code});
    588600  if ($sth->err) {
    589601    print "Failed:  DB error: ".$sth->errstr."\n";
Note: See TracChangeset for help on using the changeset viewer.