<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">


    <xsl:template name="inactiveLicensesLayout">
        <div class="AuditReport" id="auditReport">

            <h2 class="AuditReport-header">
                Inactive Licenses
                <xsl:call-template name="helpIcon">
                    <xsl:with-param name="tip">
                        Lists all inactive licenses in the system
                    </xsl:with-param>
                </xsl:call-template>
            </h2>

            <xsl:call-template name="reportHeading">
                <xsl:with-param name="showMechSwitcher" select="'true'" />
                <xsl:with-param name="showDownloadLink">
                    <xsl:choose>
                        <xsl:when test="Report/License">
                            <xsl:text>true</xsl:text>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:text>false</xsl:text>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:with-param>
            </xsl:call-template>
            <xsl:choose>
                <xsl:when test="Report/License">
                    <xsl:call-template name="inactiveLicensesTable" />
                    <xsl:call-template name="reportFooter" />
                </xsl:when>
                <xsl:otherwise>
                    <section class="Table-empty-results Table-empty-results-no-header">
                        <p>No inactive licenses were found.</p>
                    </section>
                </xsl:otherwise>
            </xsl:choose>

            <xsl:call-template name="backToStatementsHome" />
        </div>

    </xsl:template>

    <xsl:template name="inactiveLicensesTable">
        <table class="Table Table-with-highlight">
            <thead>
                <tr class="Table-row Table-row-header">
                    <th class="Table-col">Label</th>
                    <th class="Table-col">Catalog&#160;#</th>
                    <th class="Table-col">Album&#160;Title</th>
                    <th class="Table-col">Artist</th>
                    <th class="Table-col Table-col-amount">Track&#160;#</th>
                    <th class="Table-col">Track&#160;Name</th>
                    <th class="Table-col">Product&#160;Type</th>
                    <th class="Table-col">Region</th>
                    <th class="Table-col Table-col-amount">Share&#160;%</th>
                    <th class="Table-col">Publisher</th>
                    <th class="Table-col">Administrator</th>
                    <th class="Table-col">Agency</th>
                </tr>
            </thead>
            <tbody>
                <xsl:for-each select="Report/License">
                    <tr class="Table-row Table-row-data">
                        <td class="Table-col"><xsl:value-of select="LabelName" /></td>
                        <td class="Table-col"><xsl:value-of select="CatalogNumber" /></td>
                        <td class="Table-col">
                            <a href="/rps/catalog?c=show&amp;AlbumID={AlbumID}"><xsl:value-of select="AlbumTitle" /></a>
                        </td>
                        <td class="Table-col"><xsl:value-of select="TrackArtistName" /></td>
                        <td class="Table-col Table-col-amount"><xsl:value-of select="TrackNumber" /></td>
                        <td class="Table-col">
                            <a href="/rps/track?c=show&amp;TrackID={TrackID}"><xsl:value-of select="TrackTitle" /></a>
                        </td>
                        <td class="Table-col">
                            <xsl:choose>
                                <xsl:when test="normalize-space(ProductTypeID)">
                                    <xsl:variable name="productTypeID" select="ProductTypeID" />
                                    <xsl:value-of select="/Root/TypeList/Type[ProductTypeID = $productTypeID]/Description" />
                                </xsl:when>
                                <xsl:otherwise>All</xsl:otherwise>
                            </xsl:choose>
                        </td>
                        <td class="Table-col"><xsl:value-of select="RegionName" /></td>
                        <td class="Table-col Table-col-amount">
                            <a href="/rps/{$licenseArea}?c=show&amp;TrackLicenseID={TrackLicenseID}"><xsl:value-of select="Share" />%</a>
                        </td>
                        <td class="Table-col">
                            <a href="/rps/{$publisherArea}?c=show&amp;PublisherID={PublisherID}"><xsl:value-of select="PublisherName" /></a>
                        </td>
                        <td class="Table-col">
                            <a href="/rps/{$publisherArea}?c=show&amp;PublisherID={AdminID}"><xsl:value-of select="Administrator" /></a>
                        </td>
                        <td class="Table-col">
                            <a href="/rps/{$publisherArea}?c=show&amp;PublisherID={AgentID}"><xsl:value-of select="Agency" /></a>
                        </td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>


</xsl:stylesheet>
