<!--                                                                  -->
<!--  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="section" id="auditReport">

		    <div class="reportNavWrapper">
			    <h2>
				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>  
					<xsl:if test="Access/rps/report/inactive_licenses and Access/rps/report/ca_inactive_licenses">
					    <xsl:call-template name="mechReportSwitcher" />
					</xsl:if>  									
			    </h2>
			    <xsl:if test="Report/License">
    			    <xsl:call-template name="reportHeading" />
    			    <xsl:call-template name="reportNav" />
			    </xsl:if>
			</div>
			<xsl:if test="Report/License">
      		    <xsl:call-template name="inactiveLicensesTable" />
      		    <xsl:call-template name="reportNav" />
    			<br class="superBreak" />
    			<br />	
		    </xsl:if>
		    
			<xsl:if test="not(Report/License)">
				<p>No inactive licenses were found.</p>
			</xsl:if>

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


	<xsl:template name="inactiveLicensesTable">
        <table class="textChart hiOn">
            <tr>
      	        <th>Label</th>
              	<th>Catalog&#160;#</th>
              	<th>Album&#160;Title</th>
              	<th>Artist</th>
              	<th class="amount">Track&#160;#</th>
                <th>Track&#160;Name</th>
                <th>Product&#160;Type</th>
                <th>Region</th>
                <th class="amount">Share&#160;%</th>
                <th>Publisher</th>
                <th>Administrator</th>
                <th>Agency</th>
            </tr>
            <xsl:for-each select="Report/License">
                <tr class="row{position() mod 2}">
        	        <td><xsl:value-of select="LabelName" /></td>
                    <td><xsl:value-of select="CatalogNumber" /></td>
					<td>
						<a href="/rps/catalog?c=show&amp;AlbumID={AlbumID}"><xsl:value-of select="AlbumTitle" /></a>
					</td>
					<td><xsl:value-of select="TrackArtistName" /></td>
					<td class="amount"><xsl:value-of select="TrackNumber" /></td>
					<td>
						<a href="/rps/track?c=show&amp;TrackID={TrackID}"><xsl:value-of select="TrackTitle" /></a>
					</td>
					<td>
						<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><xsl:value-of select="RegionName" /></td>
					<td class="amount">
						<a href="/rps/{$licenseArea}?c=show&amp;TrackLicenseID={TrackLicenseID}"><xsl:value-of select="Share" />%</a>
					</td>
					<td>
						<a href="/rps/{$publisherArea}?c=show&amp;PublisherID={PublisherID}"><xsl:value-of select="PublisherName" /></a>
					</td>
					<td>
						<a href="/rps/{$publisherArea}?c=show&amp;PublisherID={AdminID}"><xsl:value-of select="Administrator" /></a>
					</td>
					<td>
						<a href="/rps/{$publisherArea}?c=show&amp;PublisherID={AgentID}"><xsl:value-of select="Agency" /></a>
					</td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>


</xsl:stylesheet>
