[%# 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 Show Test Case XML export template #%]

[% IF NOT header_done %]
    [% PROCESS global/variables.none.tmpl %]
    [% PROCESS testopia/export/xml.header.tmpl %]
[% END %]

        <tr:testcase id="[% case.id FILTER xml %]">
            <tr:alias>[% case.alias FILTER xml %]</tr:alias>
            <tr:summary>[% case.summary FILTER xml %]</tr:summary>
            <tr:case_status id="[% case.case_status_id FILTER xml %]">[% case.status FILTER xml %]</tr:case_status>
            <tr:priority id="[% case.priority_id FILTER xml %]">[% case.priority FILTER xml %]</tr:priority>
            <tr:category id="[% case.category_id FILTER xml %]">
                <tr:name>[% case.category.name FILTER xml %]</tr:name>
                <tr:product id="[% case.category.product.id FILTER xml %]">[% case.category.product.name FILTER xml %]</tr:product>
            </tr:category>
            <tr:author id="[% case.author_id FILTER xml %]">
                <tr:login>[% case.author.login_name FILTER xml %]</tr:login>
                <tr:name>[% case.author.realname FILTER xml %]</tr:name>
            </tr:author>
            [% IF default_tester %]
            <tr:default_tester id="[% case.default_tester_id FILTER xml %]">
                <tr:login>[% case.default_tester.login_name FILTER xml %]</tr:login>
                <tr:name>[% case.default_tester.realname FILTER xml %]</tr:name>
            </tr:default_tester>
            [% END %]
            <tr:creation_date>[% case.creation_date.replace(' ','T') FILTER xml %]</tr:creation_date>
            <tr:last_changed>[% case.last_changed.replace(' ','T') FILTER xml %]</tr:last_changed>
            <tr:estimated_time>[% case.estimated_time FILTER xml %]</tr:estimated_time>
            <tr:isautomated>[% case.isautomated ? 'true' : 'false' FILTER xml %]</tr:isautomated>
            <tr:script>[% case.sortkey FILTER xml %]</tr:script>
            <tr:arguments>[% case.arguments FILTER xml %]</tr:arguments>
            <tr:sortkey>[% case.sortkey || 0 FILTER xml %]</tr:sortkey>            
            <tr:requirement>[% case.requirement FILTER xml %]</tr:requirement>
            <tr:run_count>[% case.run_count FILTER xml %]</tr:run_count>
            [% FOREACH t = case.tags %]
            <tr:tag>[% t.name FILTER xml %]</tr:tag>
            [% END %]
            <tr:blocks>[% case.blocked_list %]</tr:blocks>
            <tr:dependson>[% case.dependson_list %]</tr:dependson>
            <tr:bugs>[% case.bug_list %]</tr:bugs>
            <tr:linked_plans>[% case.plan_list %]</tr:linked_plans>
            [% FOREACH i = case.components %]
            <tr:component id="[% i.id FILTER xml %]">
                <tr:name>[% i.name FILTER xml %]</tr:name>
                <tr:product id="[% i.product_id FILTER xml %]">[% i.product_name FILTER xml %]</tr:product>
            </tr:component>
            [% END %]
            <tr:text version="[% case.text.version FILTER xml %]">
                <tr:author>[% case.text.author FILTER xml %]</tr:author>
                <tr:action><![CDATA[[% case.text.action FILTER none %]]]></tr:action>
                <tr:expected_result><![CDATA[[% case.text.effect FILTER none %]]]></tr:expected_result>
                <tr:setup><![CDATA[[% case.text.setup FILTER none %]]]></tr:setup>
                <tr:breakdown><![CDATA[[% case.text.breakdown FILTER none %]]]></tr:breakdown>
            </tr:text>
            [% FOREACH a = case.attachments %]
                [%+ PROCESS testopia/attachment/show.xml.tmpl %]
            [% END %]
        </tr:testcase>
[% IF NOT header_done %]
    [% PROCESS testopia/export/xml.footer.tmpl %]
[% END %]