diff options
author | wicked%sci.fi <> | 2009-04-06 20:57:13 +0000 |
---|---|---|
committer | wicked%sci.fi <> | 2009-04-06 20:57:13 +0000 |
commit | 0665a74437c43e2a7805ba068b1a47ea59124787 (patch) | |
tree | 2e158219d1ef98d2ff225b0b3ff629363a6541ed /editwhines.cgi | |
parent | 1633d9835c4ab45d583ba4b6d8b585d66925a5b2 (diff) | |
download | bugs-0665a74437c43e2a7805ba068b1a47ea59124787.tar bugs-0665a74437c43e2a7805ba068b1a47ea59124787.tar.gz bugs-0665a74437c43e2a7805ba068b1a47ea59124787.tar.bz2 bugs-0665a74437c43e2a7805ba068b1a47ea59124787.tar.xz bugs-0665a74437c43e2a7805ba068b1a47ea59124787.zip |
Bug 302420: Allow whining messages to be sent even without any results - Patch by Micheal J. Tosh <michael.j.tosh@lmco.com> r=wicked a=mkanat
Diffstat (limited to 'editwhines.cgi')
-rwxr-xr-x | editwhines.cgi | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/editwhines.cgi b/editwhines.cgi index 06717fe2c..37f52349e 100755 --- a/editwhines.cgi +++ b/editwhines.cgi @@ -143,20 +143,22 @@ if ($cgi->param('update')) { $sth->execute($eventid, $userid); } else { - # check the subject and body for changes + # check the subject, body and mailifnobugs for changes my $subject = ($cgi->param("event_${eventid}_subject") or ''); my $body = ($cgi->param("event_${eventid}_body") or ''); + my $mailifnobugs = $cgi->param("event_${eventid}_mailifnobugs") ? 1 : 0; trick_taint($subject) if $subject; trick_taint($body) if $body; if ( ($subject ne $events->{$eventid}->{'subject'}) + || ($mailifnobugs != $events->{$eventid}->{'mailifnobugs'}) || ($body ne $events->{$eventid}->{'body'}) ) { $sth = $dbh->prepare("UPDATE whine_events " . - "SET subject=?, body=? " . + "SET subject=?, body=?, mailifnobugs=? " . "WHERE id=?"); - $sth->execute($subject, $body, $eventid); + $sth->execute($subject, $body, $mailifnobugs, $eventid); } # add a schedule @@ -438,14 +440,15 @@ sub get_events { my $dbh = Bugzilla->dbh; my $events = {}; - my $sth = $dbh->prepare("SELECT DISTINCT id, subject, body " . + my $sth = $dbh->prepare("SELECT DISTINCT id, subject, body, mailifnobugs " . "FROM whine_events " . "WHERE owner_userid=?"); $sth->execute($userid); - while (my ($ev, $sub, $bod) = $sth->fetchrow_array) { + while (my ($ev, $sub, $bod, $mno) = $sth->fetchrow_array) { $events->{$ev} = { 'subject' => $sub || '', 'body' => $bod || '', + 'mailifnobugs' => $mno || 0, }; } return $events; |