Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
b4c91ada
Commit
b4c91ada
authored
May 06, 2010
by
Reed Loden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 395451 - "Bugzilla::BugMail needs to use Bug objects internally instead of direct SQL"
[r=mkanat a=mkanat]
parent
2ca283e7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
42 additions
and
34 deletions
+42
-34
Bug.pm
Bugzilla/Bug.pm
+8
-1
BugMail.pm
Bugzilla/BugMail.pm
+0
-0
User.pm
Bugzilla/User.pm
+1
-1
Bug.pm
Bugzilla/WebService/Bug.pm
+3
-3
attachment.cgi
attachment.cgi
+3
-3
sendbugmail.pl
contrib/sendbugmail.pl
+4
-3
editusers.cgi
editusers.cgi
+1
-1
email_in.pl
email_in.pl
+1
-1
Extension.pm
extensions/Voting/Extension.pm
+2
-2
importxml.pl
importxml.pl
+1
-1
post_bug.cgi
post_bug.cgi
+1
-1
process_bug.cgi
process_bug.cgi
+4
-4
sanitycheck.cgi
sanitycheck.cgi
+1
-1
newchangedmail.txt.tmpl
template/en/default/email/newchangedmail.txt.tmpl
+12
-12
No files found.
Bugzilla/Bug.pm
View file @
b4c91ada
...
...
@@ -90,6 +90,7 @@ sub DB_COLUMNS {
delta_ts
estimated_time
everconfirmed
lastdiffed
op_sys
priority
product_id
...
...
@@ -2612,6 +2613,11 @@ sub blocked {
# Even bugs in an error state always have a bug_id.
sub
bug_id
{
$_
[
0
]
->
{
'bug_id'
};
}
sub
bug_group
{
my
(
$self
)
=
@_
;
return
join
(
', '
,
(
map
{
$_
->
name
}
@
{
$self
->
groups_in
}));
}
sub
related_bugs
{
my
(
$self
,
$relationship
)
=
@_
;
return
[]
if
$self
->
{
'error'
};
...
...
@@ -3586,7 +3592,8 @@ sub _validate_attribute {
qw(error groups product_id component_id
comments milestoneurl attachments isopened
flag_types num_attachment_flag_types
show_attachment_flags any_flags_requesteeble)
,
show_attachment_flags any_flags_requesteeble
lastdiffed)
,
# Bug fields.
Bugzilla::
Bug
->
fields
...
...
Bugzilla/BugMail.pm
View file @
b4c91ada
This diff is collapsed.
Click to expand it.
Bugzilla/User.pm
View file @
b4c91ada
...
...
@@ -1427,7 +1427,7 @@ sub wants_bug_mail {
#
# We do them separately because if _any_ of them are set, we don't want
# the mail.
if
(
$wants_mail
&&
$changer
&&
(
$self
->
login
eq
$changer
))
{
if
(
$wants_mail
&&
$changer
&&
(
$self
->
id
==
$changer
->
id
))
{
$wants_mail
&=
$self
->
wants_mail
([
EVT_CHANGED_BY_ME
],
$relationship
);
}
...
...
Bugzilla/WebService/Bug.pm
View file @
b4c91ada
...
...
@@ -430,7 +430,7 @@ sub create {
Bugzilla
->
login
(
LOGIN_REQUIRED
);
$params
=
Bugzilla::Bug::
map_fields
(
$params
);
my
$bug
=
Bugzilla::
Bug
->
create
(
$params
);
Bugzilla::BugMail::
Send
(
$bug
->
bug_id
,
{
changer
=>
$bug
->
reporter
->
login
});
Bugzilla::BugMail::
Send
(
$bug
->
bug_id
,
{
changer
=>
$bug
->
reporter
});
return
{
id
=>
$self
->
type
(
'int'
,
$bug
->
bug_id
)
};
}
...
...
@@ -520,7 +520,7 @@ sub add_comment {
$dbh
->
bz_commit_transaction
();
# Send mail.
Bugzilla::BugMail::
Send
(
$bug
->
bug_id
,
{
changer
=>
Bugzilla
->
user
->
login
});
Bugzilla::BugMail::
Send
(
$bug
->
bug_id
,
{
changer
=>
Bugzilla
->
user
});
return
{
id
=>
$self
->
type
(
'int'
,
$new_comment_id
)
};
}
...
...
@@ -566,7 +566,7 @@ sub update_see_also {
$changes
{
$bug
->
id
}
->
{
see_also
}
=
{
added
=>
[]
,
removed
=>
[]
};
}
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
changer
=>
$user
->
login
});
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
changer
=>
$user
});
}
return
{
changes
=>
\%
changes
};
...
...
attachment.cgi
View file @
b4c91ada
...
...
@@ -538,7 +538,7 @@ sub insert {
$vars
->
{
'header_done'
}
=
1
;
$vars
->
{
'contenttypemethod'
}
=
$cgi
->
param
(
'contenttypemethod'
);
my
$recipients
=
{
'changer'
=>
$user
->
login
,
'owner'
=>
$owner
};
my
$recipients
=
{
'changer'
=>
$user
,
'owner'
=>
$owner
};
$vars
->
{
'sent_bugmail'
}
=
Bugzilla::BugMail::
Send
(
$bugid
,
$recipients
);
print
$cgi
->
header
();
...
...
@@ -666,7 +666,7 @@ sub update {
$vars
->
{
'bugs'
}
=
[
$bug
];
$vars
->
{
'header_done'
}
=
1
;
$vars
->
{
'sent_bugmail'
}
=
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
'changer'
=>
$user
->
login
});
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
'changer'
=>
$user
});
print
$cgi
->
header
();
...
...
@@ -739,7 +739,7 @@ sub delete_attachment {
$vars
->
{
'header_done'
}
=
1
;
$vars
->
{
'sent_bugmail'
}
=
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
'changer'
=>
$user
->
login
});
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
'changer'
=>
$user
});
$template
->
process
(
"attachment/updated.html.tmpl"
,
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
...
...
contrib/sendbugmail.pl
View file @
b4c91ada
...
...
@@ -56,13 +56,14 @@ if ($changer !~ /$match/) {
print
STDERR
"Changer \"$changer\" doesn't match email regular expression.\n"
;
usage
();
}
if
(
!
login_to_id
(
$changer
))
{
print
STDERR
"\"$changer\" is not a login ID.\n"
;
my
$changer_user
=
new
Bugzilla::
User
({
name
=>
$changer
});
unless
(
$changer_user
)
{
print
STDERR
"\"$changer\" is not a valid user.\n"
;
usage
();
}
# Send the email.
my
$outputref
=
Bugzilla::BugMail::
Send
(
$bugnum
,
{
'changer'
=>
$changer
});
my
$outputref
=
Bugzilla::BugMail::
Send
(
$bugnum
,
{
'changer'
=>
$changer
_user
});
# Report the results.
my
$sent
=
scalar
(
@
{
$outputref
->
{
sent
}});
...
...
editusers.cgi
View file @
b4c91ada
...
...
@@ -647,7 +647,7 @@ if ($action eq 'search') {
# Send mail about what we've done to bugs.
# The deleted user is not notified of the changes.
foreach
(
keys
(
%
updatedbugs
))
{
Bugzilla::BugMail::
Send
(
$_
,
{
'changer'
=>
$user
->
login
}
);
Bugzilla::BugMail::
Send
(
$_
,
{
'changer'
=>
$user
}
);
}
###########################################################################
...
...
email_in.pl
View file @
b4c91ada
...
...
@@ -422,7 +422,7 @@ handle_attachments($bug, $attachments, $comment);
# to wait for $bug->update() to be fully used in email_in.pl first. So
# currently, process_bug.cgi does the mail sending for bugs, and this does
# any mail sending for attachments after the first one.
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
changer
=>
Bugzilla
->
user
->
login
});
Bugzilla::BugMail::
Send
(
$bug
->
id
,
{
changer
=>
Bugzilla
->
user
});
debug_print
(
"Sent bugmail"
);
...
...
extensions/Voting/Extension.pm
View file @
b4c91ada
...
...
@@ -619,7 +619,7 @@ sub _update_votes {
foreach
my
$bug_id
(
@updated_bugs
)
{
$vars
->
{
'id'
}
=
$bug_id
;
$vars
->
{
'sent_bugmail'
}
=
Bugzilla::BugMail::
Send
(
$bug_id
,
{
'changer'
=>
$user
->
login
});
Bugzilla::BugMail::
Send
(
$bug_id
,
{
'changer'
=>
$user
});
$template
->
process
(
"bug/process/results.html.tmpl"
,
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
...
...
@@ -729,7 +729,7 @@ sub _modify_bug_votes {
# And send out emails about changed bugs
foreach
my
$bug_id
(
@updated_bugs
)
{
my
$sent_bugmail
=
Bugzilla::BugMail::
Send
(
$bug_id
,
{
changer
=>
Bugzilla
->
user
->
login
});
$bug_id
,
{
changer
=>
Bugzilla
->
user
});
$changes
->
{
'confirmed_bugs_sent_bugmail'
}
->
{
$bug_id
}
=
$sent_bugmail
;
}
}
...
...
importxml.pl
View file @
b4c91ada
...
...
@@ -1285,7 +1285,7 @@ sub process_bug {
}
Debug
(
$log
,
OK_LEVEL
);
push
(
@logs
,
$log
);
Bugzilla::BugMail::
Send
(
$id
,
{
'changer'
=>
$exporter
_login
}
)
if
(
$mail
);
Bugzilla::BugMail::
Send
(
$id
,
{
'changer'
=>
$exporter
}
)
if
(
$mail
);
# done with the xml data. Lets clear it from memory
$twig
->
purge
;
...
...
post_bug.cgi
View file @
b4c91ada
...
...
@@ -245,7 +245,7 @@ if ($token) {
(
"createbug:$id"
,
$token
));
}
my
$recipients
=
{
changer
=>
$user
->
login
};
my
$recipients
=
{
changer
=>
$user
};
my
$bug_sent
=
Bugzilla::BugMail::
Send
(
$id
,
$recipients
);
$bug_sent
->
{
type
}
=
'created'
;
$bug_sent
->
{
id
}
=
$id
;
...
...
process_bug.cgi
View file @
b4c91ada
...
...
@@ -469,7 +469,7 @@ if ($move_action eq Bugzilla->params->{'move-button-text'}) {
# Now send emails.
foreach
my
$bug
(
@bug_objects
)
{
$vars
->
{
'mailrecipients'
}
=
{
'changer'
=>
$user
->
login
};
$vars
->
{
'mailrecipients'
}
=
{
'changer'
=>
$user
};
$vars
->
{
'id'
}
=
$bug
->
id
;
$vars
->
{
'type'
}
=
"move"
;
send_results
(
$bug
->
id
,
$vars
);
...
...
@@ -589,7 +589,7 @@ foreach my $bug (@bug_objects) {
cc
=>
[
split
(
/[\s,]+/
,
$old_cc
)],
owner
=>
$old_own
,
qacontact
=>
$old_qa
,
changer
=>
Bugzilla
->
user
->
login
};
changer
=>
Bugzilla
->
user
};
$vars
->
{
'id'
}
=
$bug
->
id
;
$vars
->
{
'type'
}
=
"bug"
;
...
...
@@ -602,7 +602,7 @@ foreach my $bug (@bug_objects) {
# other bug of any changes to that bug.
my
$new_dup_id
=
$changes
->
{
'dup_id'
}
?
$changes
->
{
'dup_id'
}
->
[
1
]
:
undef
;
if
(
$new_dup_id
)
{
$vars
->
{
'mailrecipients'
}
=
{
'changer'
=>
Bugzilla
->
user
->
login
};
$vars
->
{
'mailrecipients'
}
=
{
'changer'
=>
Bugzilla
->
user
};
$vars
->
{
'id'
}
=
$new_dup_id
;
$vars
->
{
'type'
}
=
"dupe"
;
...
...
@@ -614,7 +614,7 @@ foreach my $bug (@bug_objects) {
my
%
all_dep_changes
=
(
%
notify_deps
,
%
changed_deps
);
foreach
my
$id
(
sort
{
$a
<=>
$b
}
(
keys
%
all_dep_changes
))
{
$vars
->
{
'mailrecipients'
}
=
{
'changer'
=>
Bugzilla
->
user
->
login
};
$vars
->
{
'mailrecipients'
}
=
{
'changer'
=>
Bugzilla
->
user
};
$vars
->
{
'id'
}
=
$id
;
$vars
->
{
'type'
}
=
"dep"
;
...
...
sanitycheck.cgi
View file @
b4c91ada
...
...
@@ -248,7 +248,7 @@ if ($cgi->param('rescanallBugMail')) {
# and so choosing this user as being the last one having done a change
# for the bug may be problematic. So the best we can do at this point
# is to choose the currently logged in user for email notification.
$vars
->
{
'changer'
}
=
Bugzilla
->
user
->
login
;
$vars
->
{
'changer'
}
=
Bugzilla
->
user
;
foreach
my
$bugid
(
@$list
)
{
Bugzilla::BugMail::
Send
(
$bugid
,
$vars
);
...
...
template/en/default/email/newchangedmail.txt.tmpl
View file @
b4c91ada
...
...
@@ -23,26 +23,26 @@
From: [% Param('mailfrom') %]
To: [% to_user.email %]
Subject: [[% terms.Bug %] [%+ bug
id %]] [% 'New: ' IF isnew %][%+ summary
%]
Subject: [[% terms.Bug %] [%+ bug
.id %]] [% 'New: ' IF isnew %][%+ bug.short_desc
%]
X-Bugzilla-Reason: [% reasonsheader %]
X-Bugzilla-Type: [% isnew ? 'new' : 'changed' %]
X-Bugzilla-Watch-Reason: [% reasonswatchheader %]
[% IF Param('useclassification') %]
X-Bugzilla-Classification: [% classification %]
X-Bugzilla-Classification: [%
bug.
classification %]
[% END %]
X-Bugzilla-Product: [% product %]
X-Bugzilla-Component: [%
comp
%]
X-Bugzilla-Keywords: [% keywords %]
X-Bugzilla-Severity: [% severity %]
X-Bugzilla-Who: [% changer %]
X-Bugzilla-Status: [% status %]
X-Bugzilla-Priority: [% priority %]
X-Bugzilla-Assigned-To: [%
assignedto
%]
X-Bugzilla-Target-Milestone: [%
target
milestone %]
X-Bugzilla-Product: [%
bug.
product %]
X-Bugzilla-Component: [%
bug.component
%]
X-Bugzilla-Keywords: [%
bug.
keywords %]
X-Bugzilla-Severity: [%
bug.bug_
severity %]
X-Bugzilla-Who: [% changer
.login
%]
X-Bugzilla-Status: [%
bug.bug_
status %]
X-Bugzilla-Priority: [%
bug.
priority %]
X-Bugzilla-Assigned-To: [%
bug.assigned_to.login
%]
X-Bugzilla-Target-Milestone: [%
bug.target_
milestone %]
X-Bugzilla-Changed-Fields: [% changedfields %]
[%+ threadingmarker %]
[%+ urlbase %]show_bug.cgi?id=[% bugid %]
[%+ urlbase %]show_bug.cgi?id=[% bug
.
id %]
[%- IF diffs %]
[%+ diffs %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment