]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 275608: The group selection when editing flag types should be a listbox with...
authorlpsolit%gmail.com <>
Tue, 30 Aug 2005 23:47:25 +0000 (23:47 +0000)
committerlpsolit%gmail.com <>
Tue, 30 Aug 2005 23:47:25 +0000 (23:47 +0000)
editflagtypes.cgi
template/en/default/admin/flag-type/edit.html.tmpl
template/en/default/filterexceptions.pl

index a7c1a55415ce61b33fdc565531bb753dfa6bccc0..ed3743a43d529e0035d686ff4395710c01795dce 100755 (executable)
@@ -36,6 +36,7 @@ use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Flag;
 use Bugzilla::FlagType;
+use Bugzilla::Group;
 use Bugzilla::User;
 use Bugzilla::Util;
 
@@ -153,7 +154,9 @@ sub edit {
         $vars->{'type'} = { 'target_type' => scalar $cgi->param('target_type'),
                             'inclusions'  => \%inclusions };
     }
-    
+    # Get a list of groups available to restrict this flag type against.
+    my @groups = Bugzilla::Group::get_all_groups();
+    $vars->{'groups'} = \@groups;
     # Return the appropriate HTTP response headers.
     print $cgi->header();
 
@@ -203,7 +206,8 @@ sub processCategoryChange {
     $vars->{'products'} = \@::legal_product;
     $vars->{'components'} = \@::legal_components;
     $vars->{'components_by_product'} = \%::components;
-    
+    my @groups = Bugzilla::Group::get_all_groups();
+    $vars->{'groups'} = \@groups;
     $vars->{'action'} = $cgi->param('action');
     my $type = {};
     foreach my $key ($cgi->param()) { $type->{$key} = $cgi->param($key) }
index 8491a1e7fa1bd6bf84d273fb6818b4593ed60c08..6016fcfaef1c641612c563cd04210ed72173be62 100644 (file)
       <th>Grant Group:</th>
       <td>
         the group allowed to grant/deny flags of this type
-        (to allow all users to grant/deny these flags, leave this empty)<br>
-        <input type="text" name="grant_gid" value="[% type.grant_gid FILTER html %]" size="50" maxlength="255">
+        (to allow all users to grant/deny these flags, select no group)<br>
+        [% PROCESS select selname = "grant_gid" %]
       </td>
     </tr>
 
       <th>Request Group:</th>
       <td>
         if flags of this type are requestable, the group allowed to request them
-        (to allow all users to request these flags, leave this empty)<br>
+        (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>
-        <input type="text" name="request_gid" value="[% type.request_gid FILTER html %]" size="50" maxlength="255">
+        [% PROCESS select selname = "request_gid" %]
       </td>
     </tr>
 
 </form>
 
 [% PROCESS global/footer.html.tmpl %]
+
+
+[%############################################################################%]
+[%# Block for SELECT fields                                                  #%]
+[%############################################################################%]
+
+[% BLOCK select %]
+  <select name="[% selname %]" id="[% selname %]">
+    <option value="">(no group)</option>
+    [% FOREACH group = groups %]
+      <option value="[% group.name FILTER html %]"
+        [% " selected" IF type.${selname} == group.name %]>[% group.name FILTER html %]
+      </option>
+    [% END %]
+  </select>
+[% END %]
index 8ec9a3f3f1a6c91e182555d4147546a23e5fed75..5d70380ca134132cbf069242701b6a72ea05a16a 100644 (file)
   'type.sortkey || 1',
   'typeLabelLowerPlural',
   'typeLabelLowerSingular',
+  'selname',
 ],
 
 'admin/flag-type/list.html.tmpl' => [