]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 297213: Submit button appears without having anything to submit
authorSunil Joshi <joshi_sunil@in.com>
Fri, 12 Oct 2012 17:39:38 +0000 (19:39 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 12 Oct 2012 17:39:38 +0000 (19:39 +0200)
r/a=LpSolit

template/en/default/admin/products/groupcontrol/edit.html.tmpl

index cd738960e6b649c20a534c1fbc4ca8b9f9cca14a..889647e7e267c114635d96c01f01185bd3f6f3d6 100644 (file)
    title = title 
 %]
 
-<form method="post" action="editproducts.cgi">
-  <input type="hidden" name="action" value="updategroupcontrols">
-  <input type="hidden" name="product" value="[% product.name FILTER html %]">
-  <input type="hidden" name="token" value="[% token FILTER html %]">
+[% display_headers = 1 %]
+[% FOREACH group = product.group_controls(1).values.sort("name") %]
+  [% NEXT UNLESS group.group.isactive OR group.bug_count %]
+  [% IF display_headers %]
+    [% display_headers = 0 %]
+    <form method="post" action="editproducts.cgi">
+      <input type="hidden" name="action" value="updategroupcontrols">
+      <input type="hidden" name="product" value="[% product.name FILTER html %]">
+      <input type="hidden" name="token" value="[% token FILTER html %]">
 
-  <table id="form" cellspacing="0" cellpadding="4" border="1">
-    <tr bgcolor="#6666ff">
-      <th>Group</th>
-      <th>Entry</th>
-      <th>MemberControl</th>
-      <th>OtherControl</th>
-      <th>Canedit</th>
-      <th>editcomponents</th>
-      <th>canconfirm</th>
-      <th>editbugs</th>
-      <th>[% terms.Bugs %]</th>
-    </tr>
-    [% FOREACH group = product.group_controls(1).values.sort("name") %]
-      [% IF !group.group.isactive AND group.bug_count %]
-        <tr bgcolor="#bbbbbb">
-          <td>
-            [% group.group.name FILTER html %]
-          </td>
-          <td align="center" colspan=7>
-            Disabled
-          </td>
-          <td>
-            [% group.bug_count FILTER html %]
-          </td>
-        <tr>
-      [% ELSIF group.group.is_active %]
-        <tr>
-          <td>
-            [% group.group.name FILTER html %]
-          </td>
-          <td>
-            <input type=checkbox value=1 name=entry_[% group.id %]
-            [% " checked=\"checked\"" IF group.entry %]>
-          </td>
-          <td>
-            <select name="membercontrol_[% group.id %]">
-              <option value=[% constants.CONTROLMAPNA %]
-                [% " selected=\"selected\""
-                  IF group.membercontrol == constants.CONTROLMAPNA %]
-                >NA
-              </option>
-              <option value=[% constants.CONTROLMAPSHOWN %]
-                [% " selected=\"selected\""
-                  IF group.membercontrol == constants.CONTROLMAPSHOWN %]
-                >Shown
-              </option>
-              <option value=[% constants.CONTROLMAPDEFAULT %]
-                [% " selected=\"selected\""
-                  IF group.membercontrol == constants.CONTROLMAPDEFAULT %]
-                >Default
-              </option>
-              <option value=[% constants.CONTROLMAPMANDATORY %]
-                [% " selected=\"selected\""
-                  IF group.membercontrol == constants.CONTROLMAPMANDATORY %]
-                >Mandatory
-              </option>
-            </select>
-          </td>
-          <td>
-            <select name="othercontrol_[% group.id %]">
-              <option value=[% constants.CONTROLMAPNA %]
-                [% " selected=\"selected\""
-                  IF group.othercontrol == constants.CONTROLMAPNA %]
-                >NA
-              </option>
-              <option value=[% constants.CONTROLMAPSHOWN %]
-                [% " selected=\"selected\""
-                  IF group.othercontrol == constants.CONTROLMAPSHOWN %]
-                >Shown
-              </option>
-              <option value=[% constants.CONTROLMAPDEFAULT %]
-                [% " selected=\"selected\""
-                  IF group.othercontrol == constants.CONTROLMAPDEFAULT %]
-                >Default
-              </option>
-              <option value=[% constants.CONTROLMAPMANDATORY %]
-                [% " selected=\"selected\""
-                  IF group.othercontrol == constants.CONTROLMAPMANDATORY %]
-                >Mandatory
-              </option>
-            </select>
-          </td>
-          <td>
-            <input type=checkbox value=1 name=canedit_[% group.id %]
-            [% " checked=\"checked\"" IF group.canedit %]>
-          </td>
-          <td>
-            <input type=checkbox value=1 name=editcomponents_[% group.id %]
-            [% " checked=\"checked\"" IF group.editcomponents %]>
-          </td>
-          <td>
-            <input type=checkbox value=1 name=canconfirm_[% group.id %]
-            [% " checked=\"checked\"" IF group.canconfirm %]>
-          </td>
-          <td>
-            <input type=checkbox value=1 name=editbugs_[% group.id %]
-            [% " checked=\"checked\"" IF group.editbugs %]>
-          </td>
-          <td>
-            [% group.bug_count || 0 FILTER html %]
-          </td>
+      <table id="form" cellspacing="0" cellpadding="4" border="1">
+        <tr bgcolor="#6666ff">
+          <th>Group</th>
+          <th>Entry</th>
+          <th>MemberControl</th>
+          <th>OtherControl</th>
+          <th>Canedit</th>
+          <th>editcomponents</th>
+          <th>canconfirm</th>
+          <th>editbugs</th>
+          <th>[% terms.Bugs %]</th>
         </tr>
-      [% END %]
-    [% END %]
-
-  </table>
-  <br>
-  <input type=submit name="submit" value="submit">
-  <br>
-</form>
+  [% END %]
+  [% IF !group.group.isactive %]
+    <tr bgcolor="#bbbbbb">
+      <td>[% group.group.name FILTER html %]</td>
+      <td align="center" colspan="7">Disabled</td>
+      <td>[% group.bug_count FILTER html %]</td>
+    </tr>
+  [% ELSE %]
+    <tr>
+      <td>[% group.group.name FILTER html %]</td>
+      <td>
+        <input type=checkbox value=1 name=entry_[% group.id %]
+          [% " checked='checked'" IF group.entry %]>
+      </td>
+      <td>
+        <select name="membercontrol_[% group.id %]">
+          <option value=[% constants.CONTROLMAPNA %]
+            [% " selected='selected'" IF group.membercontrol == constants.CONTROLMAPNA %]
+            >NA
+          </option>
+          <option value=[% constants.CONTROLMAPSHOWN %]
+            [% " selected='selected'" IF group.membercontrol == constants.CONTROLMAPSHOWN %]
+            >Shown
+          </option>
+          <option value=[% constants.CONTROLMAPDEFAULT %]
+            [% " selected='selected'" IF group.membercontrol == constants.CONTROLMAPDEFAULT %]
+            >Default
+          </option>
+          <option value=[% constants.CONTROLMAPMANDATORY %]
+            [% " selected='selected'" IF group.membercontrol == constants.CONTROLMAPMANDATORY %]
+            >Mandatory
+          </option>
+        </select>
+      </td>
+      <td>
+        <select name="othercontrol_[% group.id %]">
+          <option value=[% constants.CONTROLMAPNA %]
+            [% " selected='selected'" IF group.othercontrol == constants.CONTROLMAPNA %]
+            >NA
+          </option>
+          <option value=[% constants.CONTROLMAPSHOWN %]
+            [% " selected='selected'" IF group.othercontrol == constants.CONTROLMAPSHOWN %]
+            >Shown
+          </option>
+          <option value=[% constants.CONTROLMAPDEFAULT %]
+            [% " selected='selected'" IF group.othercontrol == constants.CONTROLMAPDEFAULT %]
+            >Default
+          </option>
+          <option value=[% constants.CONTROLMAPMANDATORY %]
+            [% " selected='selected'" IF group.othercontrol == constants.CONTROLMAPMANDATORY %]
+            >Mandatory
+          </option>
+        </select>
+      </td>
+      <td>
+        <input type=checkbox value=1 name=canedit_[% group.id %]
+        [% " checked='checked'" IF group.canedit %]>
+      </td>
+      <td>
+        <input type=checkbox value=1 name=editcomponents_[% group.id %]
+        [% " checked='checked'" IF group.editcomponents %]>
+      </td>
+      <td>
+        <input type=checkbox value=1 name=canconfirm_[% group.id %]
+        [% " checked='checked'" IF group.canconfirm %]>
+      </td>
+      <td>
+        <input type=checkbox value=1 name=editbugs_[% group.id %]
+        [% " checked='checked'" IF group.editbugs %]>
+      </td>
+      <td>[% group.bug_count || 0 FILTER html %]</td>
+    </tr>
+  [% END %]
+[% END %]
 
+[% IF display_headers %]
+  <p>No groups are available for products.
+  [% IF user.in_group('creategroups') %]
+    <a href="editgroups.cgi?action=add">Create a new group</a>
+  [% END %]
+  </p>
+[% ELSE %]
+    </table>
+    <br>
+    <input type=submit name="submit" value="submit">
+  </form>
+[% END %]
 
 <p>
 These settings control the relationship of the groups to this