[%# 1.0@bugzilla.org %]
[%# 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 Test Runner System.
  #
  # The Initial Developer of the Original Code is Maciej Maczynski.
  # Portions created by Maciej Maczynski are Copyright (C) 2001
  # Maciej Maczynski. All Rights Reserved.
  #
  # Contributor(s): Greg Hendricks <ghendricks@novell.com>
  #%]


[% IF report %]
<form action="tr_caserun_reports.cgi" method="GET"> 
[% PROCESS "testopia/search/report-matrix.html.tmpl" 
   obj = caserun
%]   
[% ELSE %]
<form action="tr_list_caseruns.cgi" method="GET">
[% END %]
  <input type="hidden" name="current_tab" value="[% current_tab FILTER none %]" />
<fieldset>
    <legend><strong>Product</strong></legend>
<table>
  <tr class="bz_row_header">
    <th>Status</th>
    <th>Run Status</th>
    <th>Priority</th>
    <th>Automatic</th>
    <th>Product</th>
  </tr>
  <tr>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name => "case_run_status_id", 
                              list => caserun.get_status_list,
                              elements => 6,
                              mult => 1, }
    %]
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'run_status',
                              accesskey => 's', 
                              list      => run.get_status_list
                              elements  => 5,
                              mult      => 1 } %]
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'priority_id',
                              accesskey => 'p', 
                              list      => case.get_priority_list
                              elements  => 5,
                              mult      => 1 } %]
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'isautomated',
                  accesskey => 'a', 
                  list      => 
                    [   { id => "0", name => "Manual" },
                        { id => "1", name => "Automatic" }  ]
                  elements  => 5,
                  mult      => 1 } %]
    </td>
    <td colspan="3" align="center" >
    [% PROCESS select sel = { name  => 'product_id',
                              accesskey => 'p', 
                              list      => user.get_selectable_products,
                              elements  => 5,
                              mult      => 1  
                              events    => 'onChange="document.getElementById(\'component\').disabled=true;
                                                      document.getElementById(\'version\').disabled=true;
                                                      document.getElementById(\'milestone\').disabled=true;
                                                      document.getElementById(\'category\').disabled=true;
                                                      document.getElementById(\'build\').disabled=true;
                                                      document.getElementById(\'environment\').disabled=true;
                                                      onProductSelection()"' } %]
    </td>
  </tr>
</table>
<table>
  <tr class="bz_row_header">
    <th>Component</th>
    <th>Version</th>
    <th>Milestone</th>
  </tr>
  <tr>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'component',
                              accesskey => 'm', 
                              list      => components
                              elements  => 5,
                              mult      => 1 } %]
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'version',
                              accesskey => 'v', 
                              list      => versions,
                              elements  => 5,
                              mult      => 1 } %]   
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'milestone',
                              accesskey => 'm', 
                              list      => milestones,
                              elements  => 5,
                              mult      => 1 } %] 
    </td>
  <tr class="bz_row_header">
    <th>Category</th>
    <th>Build</th>
    <th>Environment</th>
  </tr>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'category',
                              accesskey => 't', 
                              list      => categories,
                              elements  => 5,
                              mult      => 1 } %]   
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'build',
                              accesskey => 't', 
                              list      => builds,
                              elements  => 5,
                              mult      => 1 } %]   
    </td>
    <td style="padding-right: 30px;">
    [% PROCESS select sel = { name  => 'environment',
                              accesskey => 'e', 
                              list      => environments,
                              elements  => 5,
                              mult      => 1 } %] 
    </td>  

  </tr>
</table>

</fieldset>
<fieldset>
    <legend><strong>Roles</strong></legend>
<table>
  <tr>
    <th align="right">Assignee</th>
    <td>
    [% PROCESS select sel = { name => 'assignee_type',
                              list => email_variants } %]</td>
    <td>
        <input name="assignee">
    </td>
  </tr>
  <tr>
    <th colspan="2"><input type="radio" name="andor" value="1"/>AND
      <input type="radio" name="andor" value="0"  checked="checked"/>OR</th>

  </tr>
  <tr>
    <th align="right">Tested By</th>
    <td>
    [% PROCESS select sel = { name => 'testedby_type',
                              list => email_variants } %]</td>
    <td>
        <input name="testedby">
    </td>
  </tr>
</table>
</fieldset>
<fieldset>
    <legend><strong>Attributes</strong></legend>
<table>

  <tr>
    <th align="right">Case Summary</th>
    <td>
    [% PROCESS select sel = { name => 'case_summary_type',
                              list => query_variants } %]</td>
    <td>
        <input name="case_summary">
    </td>
  </tr>
  <tr>
    <th align="right">Requirement</th>
    <td>
    [% PROCESS select sel = { name => 'requirement_type',
                              list => query_variants } %]</td>
    <td>
        <input name="requirement">
    </td>
  </tr>
  <tr>
    <th align="right">Case Tags</th>
    <td>
    [% PROCESS select sel = { name => 'tags_type',
                              list => tag_variants } %]</td>
    <td>
        <input name="tags">
    </td>
  </tr>
  <tr>
    <th align="right">Notes</th>
    <td>
    [% PROCESS select sel = { name => 'notes_type',
                              list => query_variants } %]</td>
    <td>
        <input name="notes">
    </td>
  </tr>
</table>
</fieldset>

<p style="font-weight: bold;">
  <label for="case_id">
     Include case-runs from cases numbered: 
  </label>
  <input name="case_id" id="case_id">
  <br/><br/>
  <label for="plan_id">
     Include case-runs from plans numbered: 
  </label>
  <input name="plan_id" id="plan_id">
  <br/><br/>
  <label for="run_id">
     Include case-runs in runs numbered: 
  </label>
  <input name="run_id" id="run_id">
  <br/><br/>
  
</p>
<input name="isactive" type="hidden" value="1">
<input type="submit" value="Submit" id="search_submit">
</form>  
