diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-06-25 23:16:27 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-06-25 23:16:27 +0200 |
commit | 0d39e7b417190ad672219768eab41d627cc68bb9 (patch) | |
tree | 6cf83f87c52613161665338d942cc08904b0cb8c /template/en | |
parent | ed5c3b391a381d363e1b9070554d11c2b4881e3f (diff) | |
download | bugzilla-0d39e7b417190ad672219768eab41d627cc68bb9.tar.gz bugzilla-0d39e7b417190ad672219768eab41d627cc68bb9.tar.xz |
Bug 573173: Make Bugzilla::Bug's add_group and remove_group take group
names instead of ids
r=dkl, a=mkanat
Diffstat (limited to 'template/en')
-rw-r--r-- | template/en/default/bug/edit.html.tmpl | 9 | ||||
-rw-r--r-- | template/en/default/bug/process/verify-new-product.html.tmpl | 33 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 8 | ||||
-rw-r--r-- | template/en/default/list/edit-multiple.html.tmpl | 23 |
4 files changed, 43 insertions, 30 deletions
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 479e67c1e..0ef3cba8f 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -654,14 +654,15 @@ [% END %] [% IF group.ingroup %] - <input type="hidden" name="defined_bit-[% group.bit %]" value="1"> + <input type="hidden" name="defined_groups" + value="[% group.name FILTER html %]"> [% END %] - <input type="checkbox" value="1" name="bit-[% group.bit %]" - id="bit-[% group.bit %]" + <input type="checkbox" value="[% group.name FILTER html %]" + name="groups" id="group_[% group.bit %]" [% ' checked="checked"' IF group.ison %] [% ' disabled="disabled"' IF NOT group.ingroup %]> - <label for="bit-[% group.bit %]"> + <label for="group_[% group.bit %]"> [%- group.description FILTER html_light %]</label> <br> [% END %] diff --git a/template/en/default/bug/process/verify-new-product.html.tmpl b/template/en/default/bug/process/verify-new-product.html.tmpl index 1cc186c44..20270c0aa 100644 --- a/template/en/default/bug/process/verify-new-product.html.tmpl +++ b/template/en/default/bug/process/verify-new-product.html.tmpl @@ -40,7 +40,7 @@ [% SET exclude_items = ['version', 'component', 'target_milestone'] %] [% IF verify_bug_groups %] - [% exclude_items.push('bit-\d+') %] + [% exclude_items.push('groups', 'defined_groups') %] [% END %] [% Hook.process('exclude') %] @@ -124,9 +124,10 @@ [%+ terms.Bugs %] will no longer be restricted to these groups and may become public if no other group applies:<br> [% FOREACH group = old_groups %] - <input type="checkbox" id="bit-[% group.id FILTER html %]" - name="bit-[% group.id FILTER html %]" disabled="disabled" value="1"> - <label for="bit-[% group.id FILTER html %]"> + <input type="checkbox" id="group_[% group.group.id FILTER html %]" + name="groups" disabled="disabled" + value="[% group.group.name FILTER html %]"> + <label for="group_[% group.group.id FILTER html %]"> [% group.name FILTER html %]: [% group.description FILTER html %] </label> <br> @@ -154,16 +155,15 @@ <p>These groups are optional. You can decide to restrict [% terms.bugs %] to one or more of the following groups:<br> [% FOREACH group = optional_groups %] - <input type="hidden" name="defined_bit-[% group.group.id FILTER html %]" - value="1"> - <input type="checkbox" id="bit-[% group.group.id FILTER html %]" - name="bit-[% group.group.id FILTER html %]" - [%+ ((group.membercontrol == constants.CONTROLMAPDEFAULT && user.in_group(group.group.name)) + <input type="hidden" name="defined_groups" + value="[% group.group.name FILTER html %]"> + <input type="checkbox" id="group_[% group.group.id FILTER html %]" + name="groups" + [% ' checked="checked"' IF ((group.membercontrol == constants.CONTROLMAPDEFAULT && user.in_group(group.group.name)) || (group.othercontrol == constants.CONTROLMAPDEFAULT && !user.in_group(group.group.name)) - || cgi.param("bit-$group.group.id") == 1) ? - 'checked="checked"' : '' - %] value="1"> - <label for="bit-[% group.group.id FILTER html %]"> + || cgi.param("groups").contains(group.group.name)) %] + %] value="[% group.group.name FILTER html %]"> + <label for="group_[% group.group.id FILTER html %]"> [% group.group.name FILTER html %]: [% group.group.description FILTER html %] </label> <br> @@ -175,9 +175,10 @@ <p>These groups are mandatory and [% terms.bugs %] will be automatically restricted to these groups:<br> [% FOREACH group = mandatory_groups %] - <input type="checkbox" id="bit-[% group.group.id FILTER html %]" checked="checked" - name="bit-[% group.group.id FILTER html %]" value="1" disabled="disabled"> - <label for="bit-[% group.group.id FILTER html %]"> + <input type="checkbox" id="group_[% group.group.id FILTER html %]" + checked="checked" disabled="disabled" + name="groups" value="[% group.group.name FILTER html %]"> + <label for="group_[% group.group.id FILTER html %]"> [% group.group.name FILTER html %]: [% group.group.description FILTER html %] </label> <br> diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 373a9dc31..91211d56b 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -701,7 +701,7 @@ [% ELSIF error == "group_change_denied" %] [% title = "Cannot Add/Remove That Group" %] - You tried to add or remove group id [% group_id FILTER html %] + You tried to add or remove the '[% group.name FILTER html %]' group from [% terms.bug %] [%+ bug.id FILTER html %], but you do not have permissions to do so. @@ -726,13 +726,13 @@ [% ELSIF error == "group_invalid_removal" %] You tried to remove [% terms.bug %] [%+ bug.id FILTER html %] - from group id [% group_id FILTER html %], but [% terms.bugs %] in the - '[% product FILTER html %]' product can not be removed from that + from the '[% group.name FILTER html %]' group, but [% terms.bugs %] + in the '[% product FILTER html %]' product can not be removed from that group. [% ELSIF error == "group_invalid_restriction" %] You tried to restrict [% terms.bug %] [%+ bug.id FILTER html %] to - to group id [% group_id FILTER html %], but [% terms.bugs %] in the + to the '[% group.name FILTER html %]' group, but [% terms.bugs %] in the '[% product FILTER html %]' product can not be restricted to that group. diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index c6bfbd336..619afe8dd 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -309,10 +309,18 @@ [% IF groups.size > 0 %] + <script type="text/javascript"> + function turn_off(myself, id) { + var other_checkbox = document.getElementById(id); + if (myself.checked && other_checkbox) { + other_checkbox.checked = false; + } + } + </script> + <b>Groups:</b><br> <table border="1"> <tr> - <th>Don't<br>change<br>this group<br>restriction</th> <th>Remove<br>[% terms.bugs %]<br>from this<br>group</th> <th>Add<br>[% terms.bugs %]<br>to this<br>group</th> <th>Group Name:</th> @@ -321,14 +329,17 @@ [% FOREACH group = groups %] <tr> <td align="center"> - <input type="radio" name="bit-[% group.id %]" value="-1" checked="checked"> - </td> - <td align="center"> - <input type="radio" name="bit-[% group.id %]" value="0"> + <input type="checkbox" name="defined_groups" + id="defined_group_[% group.id %]" + value="[% group.name FILTER html %]" + onchange="turn_off(this, 'group_[% group.id %]')"> </td> [% IF group.is_active %] <td align="center"> - <input type="radio" name="bit-[% group.id %]" value="1"> + <input type="checkbox" name="groups" + id="group_[% group.id FILTER html %]" + value="[% group.name FILTER html %]" + onchange="turn_off(this, 'defined_group_[% group.id %]')"> </td> [% ELSE %] <td> </td> |