Changeset 426 for trunk/cgi-bin/admin.cgi
- Timestamp:
- 07/08/10 13:16:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/admin.cgi
r424 r426 534 534 qq(<td><a href="admin.cgi?action=delnotice&code=$notice_code">Delete</a></tr>\n); 535 535 } 536 print "</table>\n"; 536 print qq(<tr><td colspan=2>Known "special" codes:<br> 537 <ul style="margin-top: 0px; margin-bottom: 0px;"> 538 <li>swi: Notify if block being updated has SWIP flag set</li> 539 </ul></td></tr> 540 </table> 541 ); 537 542 538 543 # add new entries from this tangle: … … 581 586 582 587 } elsif ($webvar{action} eq 'addnotice') { 583 $webvar{reciplist} =~ s/[\r\n]+/,/g; 584 print "Adding notice to $webvar{reciplist} for ".dispNoticeCode($webvar{msgaction}.$webvar{alloctype}).":\n"; 585 $sth = $ip_dbh->prepare("INSERT INTO notify (action, reciplist) VALUES (?,?)"); 588 $webvar{alloctype} = $webvar{special} if $webvar{msgaction} eq 's:'; 589 if ($webvar{msgaction} && $webvar{alloctype} && $webvar{reciplist}) { 590 $webvar{reciplist} =~ s/[\r\n]+/,/g; 591 print "Adding notice to $webvar{reciplist} for ".dispNoticeCode($webvar{msgaction}.$webvar{alloctype}).":\n"; 592 $sth = $ip_dbh->prepare("INSERT INTO notify (action, reciplist) VALUES (?,?)"); 586 593 ##fixme: automagically merge reciplists iff action already exists 587 $webvar{msgaction} = "f:$webvar{msgaction}" if $webvar{onfail}; 588 $sth->execute($webvar{msgaction}.$webvar{alloctype}, $webvar{reciplist}); 589 if ($sth->err) { 590 print "Failed: DB error: ".$sth->errstr."\n"; 594 $webvar{msgaction} = "f:$webvar{msgaction}" if $webvar{onfail}; 595 $sth->execute($webvar{msgaction}.$webvar{alloctype}, $webvar{reciplist}); 596 if ($sth->err) { 597 print "Failed: DB error: ".$sth->errstr."\n"; 598 } else { 599 print "OK!<br>\n" 600 } 591 601 } else { 592 print "OK!<br>\n" 602 print "Need to specify at least one recipient, an action, and an allocation type. ". 603 qq{("Special" content is considered an allocation type). Hit the Back button and try again.<br>\n}; 593 604 } 594 605 print qq(<a href="admin.cgi?action=emailnotice">Back to email notice list</a>\n); … … 784 795 my $code = shift; 785 796 my $action_out = ''; 786 # my $code = $notice_code; 797 798 if ($code =~ /^s:/) { 799 $code =~ s/^s:/Special: /; 800 return $code; 801 } 787 802 if ($code =~ /^f:(.+)$/) { 788 803 $code =~ s/^f://;
Note:
See TracChangeset
for help on using the changeset viewer.