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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
8816b8cb
You need to sign in or sign up before continuing.
Commit
8816b8cb
authored
Nov 09, 2002
by
myk%mozilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 171505: shows disabled flags in the UI
r=bbaetz a=justdave
parent
c39803cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
22 deletions
+29
-22
attachment.cgi
attachment.cgi
+3
-4
bug_form.pl
bug_form.pl
+16
-9
list.html.tmpl
template/en/default/attachment/list.html.tmpl
+3
-6
list.html.tmpl
template/en/default/flag/list.html.tmpl
+7
-3
No files found.
attachment.cgi
View file @
8816b8cb
...
...
@@ -555,12 +555,11 @@ sub edit
SendSQL
(
"SELECT product_id, component_id FROM bugs WHERE bug_id = $bugid"
);
my
(
$product_id
,
$component_id
)
=
FetchSQLData
();
my
$flag_types
=
Bugzilla::FlagType::
match
({
'target_type'
=>
'attachment'
,
'product_id'
=>
$product_id
,
'component_id'
=>
$component_id
,
'is_active'
=>
1
});
'product_id'
=>
$product_id
,
'component_id'
=>
$component_id
});
foreach
my
$flag_type
(
@$flag_types
)
{
$flag_type
->
{
'flags'
}
=
Bugzilla::Flag::
match
({
'type_id'
=>
$flag_type
->
{
'id'
},
'attach_id'
=>
$::FORM
{
'id'
}
});
'attach_id'
=>
$::FORM
{
'id'
}
});
}
$vars
->
{
'flag_types'
}
=
$flag_types
;
...
...
bug_form.pl
View file @
8816b8cb
...
...
@@ -209,8 +209,7 @@ sub show_bug {
my
$flag_types
=
Bugzilla::FlagType::
match
({
'target_type'
=>
'bug'
,
'product_id'
=>
$bug
{
'product_id'
},
'component_id'
=>
$bug
{
'component_id'
},
'is_active'
=>
1
});
'component_id'
=>
$bug
{
'component_id'
});
foreach
my
$flag_type
(
@$flag_types
)
{
$flag_type
->
{
'flags'
}
=
Bugzilla::Flag::
match
({
'bug_id'
=>
$id
,
...
...
@@ -219,13 +218,21 @@ sub show_bug {
}
$vars
->
{
'flag_types'
}
=
$flag_types
;
# The number of types of flags that can be set on attachments
# to this bug. If none, flags won't be shown in the list of attachments.
$vars
->
{
'num_attachment_flag_types'
}
=
Bugzilla::FlagType::
count
({
'target_type'
=>
'a'
,
'product_id'
=>
$bug
{
'product_id'
},
'component_id'
=>
$bug
{
'component_id'
},
'is_active'
=>
1
});
# The number of types of flags that can be set on attachments to this bug
# and the number of flags on those attachments. One of these counts must be
# greater than zero in order for the "flags" column to appear in the table
# of attachments.
my
$num_attachment_flag_types
=
Bugzilla::FlagType::
count
({
'target_type'
=>
'attachment'
,
'product_id'
=>
$bug
{
'product_id'
},
'component_id'
=>
$bug
{
'component_id'
},
'is_active'
=>
1
});
my
$num_attachment_flags
=
Bugzilla::Flag::
count
({
'target_type'
=>
'attachment'
,
'bug_id'
=>
$id
});
$vars
->
{
'show_attachment_flags'
}
=
$num_attachment_flag_types
||
$num_attachment_flags
;
# Dependencies
my
@list
;
...
...
template/en/default/attachment/list.html.tmpl
View file @
8816b8cb
...
...
@@ -19,16 +19,13 @@
# Contributor(s): Myk Melez <myk@mozilla.org>
#%]
[%# Whether or not to include flags. %]
[% display_flags = num_attachment_flag_types > 0 %]
<br>
<table cellspacing="0" cellpadding="4" border="1">
<tr>
<th bgcolor="#cccccc" align="left">Attachment</th>
<th bgcolor="#cccccc" align="left">Type</th>
<th bgcolor="#cccccc" align="left">Created</th>
[% IF
display
_flags %]
[% IF
show_attachment
_flags %]
<th bgcolor="#cccccc" align="left">Flags</th>
[% END %]
<th bgcolor="#cccccc" align="left">Actions</th>
...
...
@@ -55,7 +52,7 @@
<td valign="top">[% attachment.date %]</td>
[% IF
display
_flags %]
[% IF
show_attachment
_flags %]
<td valign="top">
[% IF attachment.flags.size == 0 %]
<i>none</i>
...
...
@@ -85,7 +82,7 @@
[% END %]
<tr>
<td colspan="[%
display
_flags ? 4 : 3 %]">
<td colspan="[%
show_attachment
_flags ? 4 : 3 %]">
<a href="attachment.cgi?bugid=[% bugid %]&action=enter">Create a New Attachment</a> (proposed patch, testcase, etc.)
</td>
<td colspan="1">
...
...
template/en/default/flag/list.html.tmpl
View file @
8816b8cb
...
...
@@ -33,9 +33,13 @@
<td>
<select name="flag-[% flag.id %]">
<option value="X"></option>
<option value="+" [% "selected" IF flag.status == "+" %]>+</option>
<option value="-" [% "selected" IF flag.status == "-" %]>-</option>
<option value="?" [% "selected" IF flag.status == "?" %]>?</option>
[% IF flag.is_active %]
<option value="+" [% "selected" IF flag.status == "+" %]>+</option>
<option value="-" [% "selected" IF flag.status == "-" %]>-</option>
<option value="?" [% "selected" IF flag.status == "?" %]>?</option>
[% ELSE %]
<option value="[% flag.status %]" selected>[% flag.status %]</option>
[% END %]
</select>
</td>
<td>
...
...
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