Changeset 426
- Timestamp:
- 07/08/10 13:16:24 (14 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r422 r426 847 847 my @reciplist; 848 848 foreach (@actionsets) { 849 $sth->execute($ action);849 $sth->execute($_); 850 850 ##fixme - need to handle db errors 851 851 my ($recipsub) = $sth->fetchrow_array; -
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://; -
trunk/cgi-bin/main.cgi
r420 r426 1230 1230 ##fixme: need to wedge something in to allow "update:field" notifications 1231 1231 ## hmm. how to tell what changed? O_o 1232 mailNotify($ip_dbh, ' ua', "SWIPed: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",1232 mailNotify($ip_dbh, 's:swi', "SWIPed: $disp_alloctypes{$webvar{alloctype}} $webvar{block}", 1233 1233 "$webvar{block} had SWIP status changed to \"Yes\" by $authuser") if $webvar{swip} eq 'on'; 1234 1234 open (HTML, "../updated.html")
Note:
See TracChangeset
for help on using the changeset viewer.