edit-multiple.html.tmpl 11.7 KB
[%# 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.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Myk Melez <myk@mozilla.org>
  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
  #                 Frédéric Buclin <LpSolit@gmail.com>
  #%]

[% PROCESS global/variables.none.tmpl %]

[% dontchange = "--do_not_change--" %]
<input type="hidden" name="dontchange" value="[% dontchange FILTER html %]">

<script type="text/javascript">
  var numelements = document.forms.changeform.elements.length;
  function SetCheckboxes(value) {
      var item;
      for (var i=0 ; i<numelements ; i++) {
          item = document.forms.changeform.elements[i];
          item.checked = value;
      }
  }
  document.write(' <input type="button" name="uncheck_all" value="Uncheck All" onclick="SetCheckboxes(false);">');
  document.write(' <input type="button" name="check_all" value="Check All" onclick="SetCheckboxes(true);">');
</script>

<hr>

<p style="font-size:smaller">
 To change multiple [% terms.bugs %]:</p>
<ol style="font-size:smaller">
  <li>Check the [% terms.bugs %] you want to change above.</li>
  <li>Make your changes in the form fields below.  If the change
   you are making requires an explanation, include it in
   the comments box.</li>
  <li>Click the <em>Commit</em> button.</li>
</ol>

<table id="form">
  <tr>

    <th><label for="product">Product:</label></th>
    <td>
      [% PROCESS selectmenu menuname = "product"
                            menuitems = products
                            property = "name" %]
    </td>

    <th><label for="version">Version:</label></th>
    <td>
      [% PROCESS selectmenu menuname = "version"
                            menuitems = versions
                            property = "" %]
    </td>

  </tr>
  <tr>

    <th><label for="component">Component:</label></th>
    <td>
      [% PROCESS selectmenu menuname = "component"
                            menuitems = components %]
    </td>

    <th>
      <label for="priority">
        <a href="page.cgi?id=fields.html#priority">Priority</a>:
      </label>
    </th>
    <td>
      [% PROCESS selectmenu menuname = "priority"
                            menuitems = priorities %]
    </td>

  </tr>
  <tr>

    <th>
      <label for="rep_platform">
        <a href="page.cgi?id=fields.html#rep_platform">Platform</a>:
      </label>
    </th>
    <td>
      [% PROCESS selectmenu menuname = "rep_platform"
                            menuitems = platforms %]
    </td>

    <th>
      <label for="bug_severity">
        <a href="page.cgi?id=fields.html#bug_severity">Severity</a>:
      </label>
    </th>
    <td>
      [% PROCESS selectmenu menuname = "bug_severity"
                            menuitems = severities %]
    </td>

  </tr>

  <tr>
    <th>
      <label for="op_sys">
        <a href="page.cgi?id=fields.html#op_sys">OS</a>:
      </label>
    </th>
    <td [% " colspan=\"3\"" IF !Param("usetargetmilestone") %]>
      [% PROCESS selectmenu menuname = "op_sys"
                            menuitems = op_sys %]
    </td>

    [% IF Param("usetargetmilestone") %]
      <th><label for="target_milestone">Target Milestone:</label></th>
      <td>
        [% PROCESS selectmenu menuname = "target_milestone"
                              menuitems = targetmilestones %]
      </td>
    [% END %]
  </tr>

  [% IF user.in_group(Param("timetrackinggroup")) %]
    <tr>
      <th><label for="estimated_time">Estimated Hours:</label></th>
      <td>
        <input id="estimated_time"
               name="estimated_time"
               value="[% dontchange FILTER html %]"
               size="6">
      </td>
      <th><label for="deadline">Deadline (YYYY-MM-DD):</label></th>
      <td>
        <input id="deadline"
               name="deadline"
               value="[% dontchange FILTER html %]"
               size="10">
      </td>
    </tr>
    <tr>
      <th><label for="remaining_time">Remaining Hours:</label></th>
      <td>
        <input id="remaining_time"
               name="remaining_time"
               value="[% dontchange FILTER html %]"
               size="6">
      </td>
      <th>&nbsp;</th>
      <td>&nbsp;</td>
    </tr>
  [% END %]

  <tr>
    <th><label for="assigned_to">Assignee:</label></th>
    <td colspan="3">
      [% INCLUDE global/userselect.html.tmpl
           id => "assigned_to"
           name => "assigned_to"
           value => dontchange
           do_not_change => dontchange
           size => 32
      %]
      <input type="checkbox" id="set_default_assignee" name="set_default_assignee" value="1">
      <label for="set_default_assignee">Reset Assignee to default</label>
    </td>
  </tr>

  [% IF Param("useqacontact") %]
    <tr>
      <th><label for="qa_contact">QA Contact:</label></th>
      <td colspan="3">
        [% INCLUDE global/userselect.html.tmpl
             id => "qa_contact"
             name => "qa_contact"
             value => dontchange
             do_not_change => dontchange
             size => 32
        %]
        <input type="checkbox" id="set_default_qa_contact" name="set_default_qa_contact" value="1">
        <label for="set_default_qa_contact">Reset QA Contact to default</label>
      </td>
    </tr>
  [% END %]

  <tr>

    <th><label for="masscc">CC List:</label></th>
    <td colspan="3">
      <input id="masscc" name="masscc" size="32">
      <select name="ccaction">
        <option value="add">Add these to the CC List</option>
        <option value="remove">Remove these from the CC List</option>
      </select>
    </td>

  </tr>

  [% IF use_keywords %]
    <tr>

      <th>
        <label for="keywords">
          <a href="describekeywords.cgi">Keywords</a>:
        </label>
      </th>
      <td colspan="3">
        <input id="keywords" name="keywords" size="32" 
               onfocus = "this.chooser.open();">
        <select name="keywordaction">
          <option value="add">Add these keywords</option>
          <option value="delete">Delete these keywords</option>
          <option value="makeexact">Make the keywords be exactly this list</option>
        </select>
      </td>

    </tr>
  [% END %]

  [% IF Param('usestatuswhiteboard') %]
    <tr>
      <td align="right">
        <b>Status Whiteboard:</b>
      </td>
      <td colspan="7">
        <input name="status_whiteboard" 
               value="[% dontchange FILTER html %]" size="60">
      </td>
    </tr>
  [% END %]

  [% USE Bugzilla %]
  [% FOREACH field = Bugzilla.active_custom_fields %]
    <tr>
      [% PROCESS bug/field.html.tmpl value = dontchange
                                     editable = 1
                                     allow_dont_change = 1 %]
    </tr>
  [% END %]

</table>

[% IF use_keywords %]
  [% PROCESS "bug/keyword-chooser.html.tmpl"
    sel_keywords = keywords.split(', ')
  %]
[% END %]

<b><label for="comment">Additional Comments:</label></b><br>
[% INCLUDE global/textarea.html.tmpl
  name    = 'comment'
  id      = 'comment'
  minrows = 5
  maxrows = 25
  cols    = constants.COMMENT_COLS
%]<br>

[% IF groups.size > 0 %]

  <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>
    </tr>

    [% 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">
      </td>
      [% IF group.is_active %]
        <td align="center">
          <input type="radio" name="bit-[% group.id %]" value="1">
        </td>
      [% ELSE %]
        <td>&nbsp;</td>
        [% foundinactive = 1 %]
      [% END %]

      <td>
        [% SET inactive = !group.is_active %]
        [% group.description FILTER html_light FILTER inactive(inactive) %]
      </td>

    </tr>
    [% END %]

  </table>

  [% IF foundinactive %]
    <p style="font-size:smaller">(Note: [% terms.Bugs %] may not be added to [% FILTER inactive %]inactive
    groups[% END %], only removed.)</p>
  [% END %]

[% END %]

[% all_open_bugs = !current_bug_statuses.containsany(closedstates) %]
[% all_closed_bugs = !current_bug_statuses.containsany(openstates) %]
[% display_warning = 0 %]

<input id="knob-none" type="radio" name="knob" value="none" checked="checked">
<label for="knob-none">Do nothing else</label><br>

[% FOREACH bug_status = new_bug_statuses %]
    <input type="radio" id="knob_[% bug_status.id FILTER html %]" name="knob"
           value="[% bug_status.name FILTER html %]">
    <label for="knob_[% bug_status.id FILTER html %]">
      Change status to <b>[% get_status(bug_status.name) FILTER html %]</b>
    </label>
    [%# Closed bugs cannot have their resolution changed this way. %]
    [% IF !bug_status.is_open && !all_closed_bugs %]
      and set the resolution to [% PROCESS select_resolution id = bug_status.id %]
      [%+ "(*)" UNLESS all_open_bugs %]
      [% display_warning = 1 UNLESS all_open_bugs %]
    [% END %]
    <br>
[% END %]

[%# If all the bugs being changed are open, allow the user to clear their resolution. %]
[% IF all_open_bugs %]
  <input id="knob-clearresolution" type="radio" name="knob" value="clearresolution">
  <label for="knob-clearresolution">Clear the resolution</label><br>
[% END %]

[%# If all the bugs being changed are closed, allow the user to change their resolution. %]
[% IF all_closed_bugs %]
  <input type="radio" id="knob_change_resolution" name="knob" value="change_resolution">
  <label for="knob_change_resolution">Change resolution to</label>
  [%+ PROCESS select_resolution id = "change_resolution" %]<br>
[% END %]

[% IF display_warning %]
  <p class="box">
    (*) Note that the resolution will only be applied to open [% terms.bugs %].
    Already closed [% terms.bugs %] will keep their resolution unchanged.
  </p>
[% END %]

<input type="submit" id="commit" value="Commit">

[% IF Param('move-enabled') && user.is_mover %]
  <input type="submit" name="action" id="action" value="[% Param('move-button-text') %]">
[% END %]

[%############################################################################%]
[%# Select Menu Block                                                        #%]
[%############################################################################%]

[% BLOCK selectmenu %]
  <select id="[% menuname %]" name="[% menuname %]">
    <option value="[% dontchange FILTER html %]" selected="selected">
      [% dontchange FILTER html %]
    </option>
    [% FOREACH menuitem = menuitems %]
      [% IF property %][% menuitem = menuitem.$property %][% END %]
      <option value="[% menuitem FILTER html %]">[% menuitem FILTER html %]</option>
    [% END %]
  </select>
[% END %]

[% BLOCK select_resolution %]
  <select id="resolution_knob_[% id FILTER html %]" name="resolution_knob_[% id FILTER html %]"
          onchange="document.forms['changeform'].[% "knob_$id" FILTER html %].checked=true">
    [% FOREACH r = resolutions %]
      [% NEXT IF !r %]
      <option value="[% r FILTER html %]">[% get_resolution(r) FILTER html %]</option>
    [% END %]
  </select>
[% END %]