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
17b7781c
Commit
17b7781c
authored
Nov 18, 2013
by
Simon Green
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 97956 - Give summary and URL of bugs added or removed from dependencies in bugmail
r=LpSolit, a=sgreen
parent
1cf4971f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
20 deletions
+61
-20
BugMail.pm
Bugzilla/BugMail.pm
+34
-19
bugmail.html.tmpl
template/en/default/email/bugmail.html.tmpl
+18
-1
bugmail.txt.tmpl
template/en/default/email/bugmail.txt.tmpl
+9
-0
No files found.
Bugzilla/BugMail.pm
View file @
17b7781c
...
...
@@ -117,7 +117,10 @@ sub Send {
# A user_id => roles hash to keep track of people.
my
%
recipients
;
my
%
watching
;
# We also record bugs that are referenced
my
@referenced_bug_ids
=
();
# Now we work out all the people involved with this bug, and note all of
# the relationships in a hash. The keys are userids, the values are an
# array of role constants.
...
...
@@ -161,8 +164,17 @@ sub Send {
$recipients
{
$uid
}
->
{
+
REL_ASSIGNEE
}
=
BIT_DIRECT
if
$uid
;
}
}
if
(
$change
->
{
field_name
}
eq
'dependson'
||
$change
->
{
field_name
}
eq
'blocked'
)
{
push
@referenced_bug_ids
,
split
(
/[\s,]+/
,
$change
->
{
old
});
push
@referenced_bug_ids
,
split
(
/[\s,]+/
,
$change
->
{
new
});
}
}
my
$referenced_bugs
=
scalar
(
@referenced_bug_ids
)
?
Bugzilla::
Bug
->
new_from_list
([
uniq
@referenced_bug_ids
])
:
[]
;
# Make sure %user_cache has every user in it so far referenced
foreach
my
$user_id
(
keys
%
recipients
)
{
$user_cache
{
$user_id
}
||=
new
Bugzilla::
User
(
$user_id
);
...
...
@@ -249,16 +261,17 @@ sub Send {
# Email the user if the dep check passed.
if
(
$dep_ok
)
{
my
$sent_mail
=
sendMail
(
{
to
=>
$user
,
bug
=>
$bug
,
comments
=>
$comments
,
date
=>
$date
,
changer
=>
$changer
,
watchers
=>
exists
$watching
{
$user_id
}
?
$watching
{
$user_id
}
:
undef
,
diffs
=>
\
@diffs
,
{
to
=>
$user
,
bug
=>
$bug
,
comments
=>
$comments
,
date
=>
$date
,
changer
=>
$changer
,
watchers
=>
exists
$watching
{
$user_id
}
?
$watching
{
$user_id
}
:
undef
,
diffs
=>
\
@diffs
,
rels_which_want
=>
\%
rels_which_want
,
dep_only
=>
$params
->
{
dep_only
}
dep_only
=>
$params
->
{
dep_only
},
referenced_bugs
=>
$referenced_bugs
,
});
push
(
@sent
,
$user
->
login
)
if
$sent_mail
;
}
...
...
@@ -280,15 +293,16 @@ sub Send {
sub
sendMail
{
my
$params
=
shift
;
my
$user
=
$params
->
{
to
};
my
$bug
=
$params
->
{
bug
};
my
@send_comments
=
@
{
$params
->
{
comments
}
};
my
$date
=
$params
->
{
date
};
my
$changer
=
$params
->
{
changer
};
my
$watchingRef
=
$params
->
{
watchers
};
my
@diffs
=
@
{
$params
->
{
diffs
}
};
my
$relRef
=
$params
->
{
rels_which_want
};
my
$dep_only
=
$params
->
{
dep_only
};
my
$user
=
$params
->
{
to
};
my
$bug
=
$params
->
{
bug
};
my
@send_comments
=
@
{
$params
->
{
comments
}
};
my
$date
=
$params
->
{
date
};
my
$changer
=
$params
->
{
changer
};
my
$watchingRef
=
$params
->
{
watchers
};
my
@diffs
=
@
{
$params
->
{
diffs
}
};
my
$relRef
=
$params
->
{
rels_which_want
};
my
$dep_only
=
$params
->
{
dep_only
};
my
$referenced_bugs
=
$params
->
{
referenced_bugs
};
# Only display changes the user is allowed see.
my
@display_diffs
;
...
...
@@ -350,6 +364,7 @@ sub sendMail {
changer
=>
$changer
,
diffs
=>
\
@display_diffs
,
changedfields
=>
\
@changedfields
,
referenced_bugs
=>
$user
->
visible_bugs
(
$referenced_bugs
),
new_comments
=>
\
@send_comments
,
threadingmarker
=>
build_thread_marker
(
$bug
->
id
,
$user
->
id
,
!
$bug
->
lastdiffed
),
bugmailtype
=>
$bugmailtype
,
...
...
template/en/default/email/bugmail.html.tmpl
View file @
17b7781c
...
...
@@ -29,9 +29,26 @@
</div>
[% END %]
</p>
[% IF referenced_bugs.size %]
<div
id=
"referenced"
>
<hr
style=
"border: 1px dashed #969696"
>
<b>
Referenced [% terms.Bugs %]:
</b>
<ul>
[% FOREACH ref_bug = referenced_bugs %]
<li>
[[% "${terms.Bug} ${ref_bug.id}" FILTER bug_link(ref_bug, {full_url => 1, user => to_user}) FILTER none %]]
[% ref_bug.short_desc FILTER html %]
</li>
[% END %]
</ul>
</div>
<br>
[% END %]
<hr>
<span>
You are receiving this mail because:
</span>
<ul>
[% FOREACH reason = reasons %]
[% IF reason_descs.$reason %]
...
...
template/en/default/email/bugmail.txt.tmpl
View file @
17b7781c
...
...
@@ -22,6 +22,15 @@
[%+ comment.body_full({ is_bugmail => 1, wrap => 1 }) %]
[% END %]
[% IF referenced_bugs.size %]
Referenced [% terms.Bugs %]:
[% FOREACH ref_bug = referenced_bugs %]
[%+ urlbase %]show_bug.cgi?id=[% ref_bug.id %]
[%+ "[" _ terms.Bug _ " " _ ref_bug.id _ "] " _ ref_bug.short_desc FILTER wrap_comment %]
[% END %]
[% END %]
-- [%# Protect the trailing space of the signature marker %]
You are receiving this mail because:
[% SET reason_lines = [] %]
...
...
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