[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # Contributor(s): Jack Nerad     <jnerad@bellsouth.net>
  #                 Tiago R. Mello <tiago@async.com.br>
  #                 Gabriel S. Oliveira <gabriel@async.com.br>
  #%]

[%# INTERFACE:
  # product: Bugzilla::Product object; The product
  #
  # classification: Bugzilla::Classifiation object; classification product is in.
  #%]

[% IF Bugzilla.get_field('classification').enabled %]
  <tr>
    <th align="left"><b>Classification:</b></th>
    <td><select name="classification">
      [% FOR c = classifications %]
      <option value="[% c.name | html %]" [% "selected" IF classification.id == c.id %]>[% c.name | html %]</option>
      [% END %]
    </select></td>
  </tr>
[% END %]

<tr>
  <th align="left"><label for="product">Product:</label></th>
  <td><input size="64" maxlength="64" name="product" id="product" value="[% product.name | html %]" /></td>
</tr>

<tr valign="top">
  <th align="left"><label for="description">Description:</label></th>
  <td><textarea rows="4" cols="64" wrap="virtual" name="description" id="description">[% product.description | html %]</textarea></td>
</tr>

<tr valign="top">
  <th align="left"><label for="entryheaderhtml">HTML code to display<br /> above the bug form:</label></th>
  <td><textarea rows="4" cols="64" wrap="virtual" name="entryheaderhtml" id="entryheaderhtml">[% product.entryheaderhtml | html %]</textarea></td>
</tr>

<tr>
  <th align="left"><label for="is_active">Open for [% terms.bug %] entry:</label></th>
  <td><input type="checkbox" name="is_active" id="is_active" value="1" [% ' checked="checked"' IF product.is_active %] /></td>
</tr>

<tr>
  <th align="left"><label for="allows_unconfirmed">Allow unconfirmed:</label></th>
  <td>
    <input type="checkbox" id="allows_unconfirmed" name="allows_unconfirmed"
      [% ' checked="checked"' IF product.allows_unconfirmed %]
      [% IF Bugzilla.get_field('votes').enabled %]
        onchange="toggleClass('votes_to_confirm_container', 'bz_default_hidden')"
      [% END %] />
    [% IF Bugzilla.get_field('votes').enabled %]
    <span id="votes_to_confirm_container" [% ' class="bz_default_hidden"' IF !product.allows_unconfirmed %]>
      ...and automatically confirm [% terms.bugs %] if they get
      <input size="3" maxlength="5" name="votestoconfirm"
        id="votestoconfirm"
        value="[% product.votes_to_confirm | html %]" />
      votes. (Setting this to 0 disables auto-confirming [% terms.bugs %] by vote.)
    </span>
    [% END %]
  </td>
</tr>

<tr>
  <th align="left"><label for="wiki_url">Wiki URL prefix:</label></th>
  <td>
    <input size="64" maxlength="64" name="wiki_url" value="[% product.wiki_url | html %]" />
    <br /><em>Empty means use default setting.</em>
  </td>
</tr>

<tr>
  <th align="left"><label for="notimetracking">Prefer no timetracking:</th>
  <td>
    <input type="checkbox" id="notimetracking" name="notimetracking" value="1"
      [% IF product.notimetracking %] checked="checked"[% END %] />
  </td>
</tr>

<tr>
  <th align="left"><label for="extproduct">External product:</label></th>
  <td>
    <select name="extproduct" id="extproduct">
      <option value="">---</option>
      [% FOREACH prod = Bugzilla.user.get_editable_products %]
      <option value="[% prod.id %]" [% ' selected="selected"' IF prod.id == product.extproduct %]>[% prod.name | html %]</option>
      [% END %]
    </select>
  </td>
</tr>

<tr valign="top">
  <th align="left">CC group:</th>
  <td>
    <select name="cc_group">
      <option value="">---</option>
      [% FOREACH group = all_groups %]
      <option value="[% group.name | html %]"[% ' selected="selected"' IF group.id == product.cc_group %]>[% group.name | html %]</option>
      [% END %]
    </select>
    <br />
    <i>
      Disallow users not in this group to be Assignee, QA or CC in this product.<br />
      They will still be allowed to see this product bugs or even report new ones if group
      permissions allow them to do so though.
    </i>
  </td>
</tr>

[% IF Bugzilla.get_field('votes').enabled %]
  <tr>
    <th align="left">Maximum votes:</label></th>
    <td>
      <label for="votesperuser">per user:</label>
      <input size="5" maxlength="5" name="votesperuser" id="votesperuser"
        value="[% product.votesperuser | html %]" />
      <label for="maxvotesperbug">per user, per single [% terms.bug %]:</label>
      <input size="5" maxlength="5" name="maxvotesperbug" id="maxvotesperbug" value="[% product.maxvotesperbug | html %]" />
    </td>
  </tr>
[% END %]
