[%# 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): David Koenig <dkoenig@novell.com>
  #%]

[%# Testopia Test Case list XML export template #%]
[% IF NOT header_done %]
    [% PROCESS global/variables.none.tmpl %]
    [% PROCESS testopia/export/xml.header.tmpl %]
    [% SET header_done = 1 %]
[% END %]
    <tr:testplan id="[% plan.id %]">
        <tr:name>[% plan.name FILTER xml %]</tr:name>
        <tr:product id="[% plan.product.id FILTER xml %]">[% plan.product.name FILTER xml %]</tr:product>
        <tr:author id="[% plan.author_id FILTER xml %]">
            <tr:login>[% plan.author.login_name FILTER xml %]</tr:login>
            <tr:name>[% plan.author.realname FILTER xml %]</tr:name>
        </tr:author>
        <tr:plan_type id="[% plan.type_id FILTER xml %]">[% plan.plan_type FILTER xml %]</tr:plan_type>
        <tr:default_product_version>[% plan.default_product_version FILTER xml %]</tr:default_product_version>
        <tr:creation_date>[% plan.creation_date.replace(' ','T') FILTER xml %]</tr:creation_date>
        <tr:last_changed>[% plan.last_changed.replace(' ','T') FILTER xml %]</tr:last_changed>
        <tr:archived>[% plan.isactive ? 'false' : 'true' FILTER xml %]</tr:archived>
        <tr:document version="[% plan.version FILTER xml %]">
            <tr:author>[% plan.text.author FILTER xml %]</tr:author>
            <tr:text><![CDATA[[% plan.text.plan_text FILTER none %]]]></tr:text>
        </tr:document>
        [% FOREACH t = plan.tags %]
        <tr:tag>[% t.name FILTER xml %]</tr:tag>
        [% END %]
        [% FOREACH case = plan.test_cases %]
            [%+ PROCESS testopia/case/show.xml.tmpl %]
        [% END %]
        [% FOREACH run = plan.test_runs %]
            [%+ PROCESS testopia/run/show.xml.tmpl %]
        [% END %]
        [% FOREACH a = plan.attachments %]
            [%+ PROCESS testopia/attachment/show.xml.tmpl %]
        [% END %]
    </tr:testplan>  
[% IF show_footer %]
    [% PROCESS testopia/export/xml.footer.tmpl %]
[% END %]