summaryrefslogtreecommitdiffstats
path: root/template/en/default/admin
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-12-04 02:22:49 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2010-12-04 02:22:49 +0100
commit6fac08b94b6cd67d8dd7ae8f7eeb5de5233c59d7 (patch)
tree3125cfcf7eddc39feb0966957bc3d59265fe112b /template/en/default/admin
parent4c2a23f4df1041fe21d534b38654a0d1c911282e (diff)
downloadbugzilla-6fac08b94b6cd67d8dd7ae8f7eeb5de5233c59d7.tar.gz
bugzilla-6fac08b94b6cd67d8dd7ae8f7eeb5de5233c59d7.tar.xz
Bug 529974: Let users with local editcomponents privs manage flags for products they can administer
a=LpSolit (module owner)
Diffstat (limited to 'template/en/default/admin')
-rw-r--r--template/en/default/admin/admin.html.tmpl3
-rw-r--r--template/en/default/admin/flag-type/edit.html.tmpl66
2 files changed, 46 insertions, 23 deletions
diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl
index 145360bfa..98f729b02 100644
--- a/template/en/default/admin/admin.html.tmpl
+++ b/template/en/default/admin/admin.html.tmpl
@@ -76,7 +76,8 @@
<a href="editcomponents.cgi">components</a>, <a href="editversions.cgi">versions</a>
and <a href="editmilestones.cgi">milestones</a> directly.</dd>
- [% class = user.in_group('editcomponents') ? "" : "forbidden" %]
+ [% class = (user.in_group('editcomponents')
+ || user.get_products_by_permission('editcomponents').size) ? "" : "forbidden" %]
<dt id="flags" class="[% class %]"><a href="editflagtypes.cgi">Flags</a></dt>
<dd class="[% class %]">A flag is a custom 4-states attribute of [% terms.bugs %]
and/or attachments. These states are: granted, denied, requested and undefined.
diff --git a/template/en/default/admin/flag-type/edit.html.tmpl b/template/en/default/admin/flag-type/edit.html.tmpl
index eb0211377..13db9fab1 100644
--- a/template/en/default/admin/flag-type/edit.html.tmpl
+++ b/template/en/default/admin/flag-type/edit.html.tmpl
@@ -17,6 +17,7 @@
#
# Contributor(s): Myk Melez <myk@mozilla.org>
# Mark Bickford <markhb@maine.rr.com>
+ # Frédéric Buclin <LpSolit@gmail.com>
#%]
[% PROCESS global/variables.none.tmpl %]
@@ -42,22 +43,24 @@
table#form th { text-align: right; vertical-align: baseline; white-space: nowrap; }
table#form td { text-align: left; vertical-align: baseline; }
"
- onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, '__Any__');"
+ onload="var f = document.forms['flagtype_properties'];
+ selectProduct(f.product, f.component, null, null, '__Any__');"
javascript_urls=["js/productform.js"]
doc_section = doc_section
%]
-<form method="post" action="editflagtypes.cgi">
+<form id="flagtype_properties" method="post" action="editflagtypes.cgi">
<input type="hidden" name="action" value="[% action FILTER html %]">
+ <input type="hidden" name="can_fully_edit" value="[% can_fully_edit FILTER html %]">
<input type="hidden" name="id" value="[% type.id %]">
<input type="hidden" name="token" value="[% token FILTER html %]">
<input type="hidden" name="target_type" value="[% type.target_type FILTER html %]">
<input type="hidden" name="check_clusions" value="[% check_clusions FILTER none %]">
- [% FOREACH category = type.inclusions %]
- <input type="hidden" name="inclusions" value="[% category.value FILTER html %]">
+ [% FOREACH category = inclusions.values %]
+ <input type="hidden" name="inclusions" value="[% category FILTER html %]">
[% END %]
- [% FOREACH category = type.exclusions %]
- <input type="hidden" name="exclusions" value="[% category.value FILTER html %]">
+ [% FOREACH category = exclusions.values %]
+ <input type="hidden" name="exclusions" value="[% category FILTER html %]">
[% END %]
[%# Add a hidden button at the top of the form so that the user pressing "return"
@@ -69,8 +72,8 @@
<th>Name:</th>
<td>
a short name identifying this type.<br>
- <input type="text" name="name" value="[% type.name FILTER html %]"
- size="50" maxlength="50">
+ <input type="text" name="name" value="[% type.name FILTER html %]" size="50"
+ maxlength="50" [%- ' disabled="disabled"' UNLESS can_fully_edit %]>
</td>
</tr>
@@ -83,6 +86,7 @@
minrows = 4
cols = 80
defaultcontent = type.description
+ disabled = !can_fully_edit
%]
</td>
</tr>
@@ -94,6 +98,12 @@
the products/components to which [% type.target_type == "bug" ? terms.bugs : "attachments" %]
must (inclusions) or must not (exclusions) belong in order for users
to be able to set flags of this type for them.
+ [% UNLESS can_fully_edit %]
+ <p class="warning">This flagtype also applies to some products you are not allowed
+ to edit (and so which are not displayed in the lists below). Your limited privileges
+ means you are only allowed to add and remove this flagtype to/from products you can
+ edit, but not to edit other properties of the flagtype.</p>
+ [% END %]
<table>
<tr>
<td style="vertical-align: top;">
@@ -101,17 +111,13 @@
<select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');">
<option value="">__Any__</option>
[% FOREACH prod = products %]
- <option value="[% prod.name FILTER html %]"
- [% "selected" IF type.product.name == prod.name %]>
- [% prod.name FILTER html %]</option>
+ <option value="[% prod.name FILTER html %]">[% prod.name FILTER html %]</option>
[% END %]
</select><br>
<select name="component">
<option value="">__Any__</option>
[% FOREACH comp = components %]
- <option value="[% comp FILTER html %]"
- [% "selected" IF type.component.name == comp %]>
- [% comp FILTER html %]</option>
+ <option value="[% comp FILTER html %]">[% comp FILTER html %]</option>
[% END %]
</select><br>
<input type="submit" name="categoryAction-include" value="Include">
@@ -119,12 +125,12 @@
</td>
<td style="vertical-align: top;">
<b>Inclusions:</b><br>
- [% PROCESS "global/select-menu.html.tmpl" name="inclusion_to_remove" multiple="1" size="7" options=type.inclusions %]<br>
+ [% PROCESS category_select name="inclusion_to_remove" categories = inclusions %]<br>
<input type="submit" name="categoryAction-removeInclusion" value="Remove Inclusion">
</td>
<td style="vertical-align: top;">
<b>Exclusions:</b><br>
- [% PROCESS "global/select-menu.html.tmpl" name="exclusion_to_remove" multiple="1" size="7" options=type.exclusions %]<br>
+ [% PROCESS category_select name="exclusion_to_remove" categories = exclusions %]<br>
<input type="submit" name="categoryAction-removeExclusion" value="Remove Exclusion">
</td>
</tr>
@@ -139,7 +145,8 @@
this type will be sorted when displayed to users in a list; ignore if you
don't care what order the types appear in or if you want them to appear
in alphabetical order.<br>
- <input type="text" name="sortkey" value="[% type.sortkey || 1 %]" size="5" maxlength="5">
+ <input type="text" name="sortkey" value="[% type.sortkey || 1 %]" size="5" maxlength="5"
+ [%- ' disabled="disabled"' UNLESS can_fully_edit %]>
</td>
</tr>
@@ -147,6 +154,7 @@
<th>&nbsp;</th>
<td>
<input type="checkbox" id="is_active" name="is_active"
+ [%- ' disabled="disabled"' UNLESS can_fully_edit %]
[% " checked" IF type.is_active || !type.is_active.defined %]>
<label for="is_active">active (flags of this type appear in the UI and can be set)</label>
</td>
@@ -156,6 +164,7 @@
<th>&nbsp;</th>
<td>
<input type="checkbox" id="is_requestable" name="is_requestable"
+ [%- ' disabled="disabled"' UNLESS can_fully_edit %]
[% " checked" IF type.is_requestable || !type.is_requestable.defined %]>
<label for="is_requestable">requestable (users can ask for flags of this type to be set)</label>
</td>
@@ -172,7 +181,8 @@
<kbd>[% Param('emailsuffix') %]</kbd> will <em>not</em> be appended
to these addresses, so you should add it explicitly if so desired.
[% END %]<br>
- <input type="text" name="cc_list" value="[% type.cc_list FILTER html %]" size="80" maxlength="200">
+ <input type="text" name="cc_list" value="[% type.cc_list FILTER html %]" size="80"
+ maxlength="200" [%- ' disabled="disabled"' UNLESS can_fully_edit %]>
</td>
</tr>
@@ -180,6 +190,7 @@
<th>&nbsp;</th>
<td>
<input type="checkbox" id="is_requesteeble" name="is_requesteeble"
+ [%- ' disabled="disabled"' UNLESS can_fully_edit %]
[% " checked" IF type.is_requesteeble || !type.is_requesteeble.defined %]>
<label for="is_requesteeble">specifically requestable (users can ask specific other users
to set flags of this type as opposed to just asking the wind)</label>
@@ -190,6 +201,7 @@
<th>&nbsp;</th>
<td>
<input type="checkbox" id="is_multiplicable" name="is_multiplicable"
+ [%- ' disabled="disabled"' UNLESS can_fully_edit %]
[% " checked" IF type.is_multiplicable || !type.is_multiplicable.defined %]>
<label for="is_multiplicable">multiplicable (multiple flags of this type can be set on
the same [% type.target_type == "bug" ? terms.bug : "attachment" %])</label>
@@ -201,7 +213,7 @@
<td>
the group allowed to grant/deny flags of this type
(to allow all users to grant/deny these flags, select no group).<br>
- [% PROCESS select selname = "grant_group" %]
+ [% PROCESS group_select selname = "grant_group" %]
</td>
</tr>
@@ -211,7 +223,7 @@
if flags of this type are requestable, the group allowed to request them
(to allow all users to request these flags, select no group).<br>
Note that the request group alone has no effect if the grant group is not defined!<br>
- [% PROCESS select selname = "request_group" %]
+ [% PROCESS group_select selname = "request_group" %]
</td>
</tr>
@@ -233,8 +245,8 @@
[%# Block for SELECT fields #%]
[%############################################################################%]
-[% BLOCK select %]
- <select name="[% selname %]" id="[% selname %]">
+[% BLOCK group_select %]
+ <select name="[% selname %]" id="[% selname %]" [%- ' disabled="disabled"' UNLESS can_fully_edit %]>
<option value="">(no group)</option>
[% FOREACH group = groups %]
<option value="[% group.name FILTER html %]"
@@ -244,3 +256,13 @@
[% END %]
</select>
[% END %]
+
+[% BLOCK category_select %]
+ <select name="[% name FILTER html %]" multiple="multiple" size="7">
+ [% FOREACH option = categories.keys.sort %]
+ <option value="[% categories.$option FILTER html %]">
+ [% option FILTER html %]
+ </option>
+ [% END %]
+ </select>
+[% END %] \ No newline at end of file