aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwicked%sci.fi <>2009-04-06 20:57:13 +0000
committerwicked%sci.fi <>2009-04-06 20:57:13 +0000
commit0665a74437c43e2a7805ba068b1a47ea59124787 (patch)
tree2e158219d1ef98d2ff225b0b3ff629363a6541ed /editwhines.cgi
parentBug 486881: A powerless user can still see a restricted bug when he removes a... (diff)
downloadbugzilla-0665a74437c43e2a7805ba068b1a47ea59124787.tar.gz
bugzilla-0665a74437c43e2a7805ba068b1a47ea59124787.tar.bz2
bugzilla-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-xeditwhines.cgi13
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;