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
5b3ea4d4
Commit
5b3ea4d4
authored
Jun 26, 2012
by
Reed Loden
Committed by
Frédéric Buclin
Jun 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 138546: Add a checkbox to add himself to the CC list when creating or editing an attachment
r/a=LpSolit
parent
a4ef21ac
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
20 deletions
+36
-20
Bug.pm
Bugzilla/Bug.pm
+12
-12
attachment.cgi
attachment.cgi
+4
-0
create.html.tmpl
template/en/default/attachment/create.html.tmpl
+9
-0
edit.html.tmpl
template/en/default/attachment/edit.html.tmpl
+10
-2
edit.html.tmpl
template/en/default/bug/edit.html.tmpl
+1
-6
No files found.
Bugzilla/Bug.pm
View file @
5b3ea4d4
...
...
@@ -3614,23 +3614,23 @@ sub user {
return
{}
if
$self
->
{
'error'
};
my
$user
=
Bugzilla
->
user
;
my
$prod_id
=
$self
->
{
'product_id'
};
my
$
unknown_privilege
s
=
$user
->
in_group
(
'editbugs'
,
$prod_id
);
my
$
canedit
=
$unknown_privileges
||
$user
->
id
==
$self
->
{
'assigned_to'
}
||
(
Bugzilla
->
params
->
{
'useqacontact'
}
&&
$self
->
{
'qa_contact'
}
&&
$user
->
id
==
$self
->
{
'qa_contact'
})
;
my
$canconfirm
=
$unknown_privileges
||
$user
->
in_group
(
'canconfirm'
,
$prod_id
)
;
my
$
isreporter
=
$user
->
id
&&
$user
->
id
==
$self
->
{
reporter_id
}
;
my
$
editbug
s
=
$user
->
in_group
(
'editbugs'
,
$prod_id
);
my
$
is_reporter
=
$user
->
id
==
$self
->
{
reporter_id
}
?
1
:
0
;
my
$is_assignee
=
$user
->
id
==
$self
->
{
'assigned_to'
}
?
1
:
0
;
my
$is_qa_contact
=
Bugzilla
->
params
->
{
'useqacontact'
}
&&
$self
->
{
'qa_contact'
}
&&
$user
->
id
==
$self
->
{
'qa_contact'
}
?
1
:
0
;
my
$canedit
=
$editbugs
||
$is_assignee
||
$is_qa_contact
;
my
$
canconfirm
=
$editbugs
||
$user
->
in_group
(
'canconfirm'
,
$prod_id
);
my
$has_any_role
=
$is_reporter
||
$is_assignee
||
$is_qa_contact
;
$self
->
{
'user'
}
=
{
canconfirm
=>
$canconfirm
,
canedit
=>
$canedit
,
isreporter
=>
$isreporter
};
isreporter
=>
$is_reporter
,
has_any_role
=>
$has_any_role
};
return
$self
->
{
'user'
};
}
...
...
attachment.cgi
View file @
5b3ea4d4
...
...
@@ -574,6 +574,8 @@ sub insert {
$owner
=
$bug
->
assigned_to
->
login
;
$bug
->
set_assigned_to
(
$user
);
}
$bug
->
add_cc
(
$user
)
if
$cgi
->
param
(
'addselfcc'
);
$bug
->
update
(
$timestamp
);
$dbh
->
bz_commit_transaction
;
...
...
@@ -686,6 +688,8 @@ sub update {
extra_data
=>
$attachment
->
id
});
}
$bug
->
add_cc
(
$user
)
if
$cgi
->
param
(
'addselfcc'
);
if
(
$can_edit
)
{
my
(
$flags
,
$new_flags
)
=
Bugzilla::
Flag
->
extract_flags_from_cgi
(
$bug
,
$attachment
,
$vars
);
...
...
template/en/default/attachment/create.html.tmpl
View file @
5b3ea4d4
...
...
@@ -92,6 +92,15 @@ TUI_hide_default('attachment_text_field');
cols = constants.COMMENT_COLS
wrap = 'soft'
%]
[% IF NOT bug.cc || NOT bug.cc.contains(user.login) %]
<br>
<input type="checkbox" id="addselfcc" name="addselfcc"
[%~ ' checked="checked"'
IF user.settings.state_addselfcc.value == 'always'
|| (!bug.user.has_any_role
&& user.settings.state_addselfcc.value == 'cc_unless_role') %]>
<label for="addselfcc">Add me to CC list</label>
[% END %]
</td>
</tr>
[% IF user.is_insider %]
...
...
template/en/default/attachment/edit.html.tmpl
View file @
5b3ea4d4
...
...
@@ -253,10 +253,18 @@
minrows = 10
cols = 80
wrap = 'soft'
classes = classNames
classes = classNames
%]
[% IF NOT attachment.bug.cc || NOT attachment.bug.cc.contains(user.login) %]
<input type="checkbox" id="addselfcc" name="addselfcc"
[%~ ' checked="checked"'
IF user.settings.state_addselfcc.value == 'always'
|| (!attachment.bug.user.has_any_role
&& user.settings.state_addselfcc.value == 'cc_unless_role') %]>
<label for="addselfcc">Add me to CC list</label>
[% END %]
</div>
[% END %]
[% END %]
<div id="attachment_flags">
[% IF attachment.flag_types.size > 0 %]
[% PROCESS "flag/list.html.tmpl" flag_types = attachment.flag_types
...
...
template/en/default/bug/edit.html.tmpl
View file @
5b3ea4d4
...
...
@@ -722,15 +722,10 @@
<td>
[% IF user.id %]
[% IF NOT bug.cc || NOT bug.cc.contains(user.login) %]
[% has_role = bug.user.isreporter
|| bug.assigned_to.id == user.id
|| (Param('useqacontact')
&& bug.qa_contact
&& bug.qa_contact.id == user.id) %]
<input type="checkbox" id="addselfcc" name="addselfcc"
[% " checked=\"checked\""
IF user.settings.state_addselfcc.value == 'always'
|| (!
has
_role
|| (!
bug.user.has_any
_role
&& user.settings.state_addselfcc.value == 'cc_unless_role') %]>
<label for="addselfcc">Add me to CC list</label>
<br>
...
...
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