<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">
  <xsl:output method="html" indent="no" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" encoding="utf-8" />

  <xsl:include href="/app/tools/rps/templates/global.xsl" />
  <xsl:include href="/app/tools/rps/templates/statement_settings/settings.xsl" />

  <xsl:template name="pickLayout">
    <form name="artistSettingsEdit" id="artistSettingsEdit" method="post" action="/rps/artist_statement_settings">
      <xsl:call-template name="artistSettingsEdit" />
      <xsl:call-template name="buttons" />
    </form>
  </xsl:template>

  <xsl:template name="submitButton">
    <input name="submit" type="submit" id="submitButton" value="Save">
        <xsl:if test="$openRuns = 1">
            <xsl:attribute name="disabled">disabled</xsl:attribute>
        </xsl:if>
    </input>
  </xsl:template>

  <xsl:template name="cancelButton">
    <input type="button" name="Back" value="Back to Statement Settings" onClick="location.href='/rps/artist_statement_settings'" />
  </xsl:template>

  <xsl:template name="artistSettingsEdit">
    <div class="section">
      <xsl:call-template name="openRunStatusMessage" />
      <input type="hidden" name="formSubmit" value="1" />
      <input type="hidden" name="c" value="edit" />
      <xsl:call-template name="errorMessageGeneral" />
      <xsl:call-template name="column1Edit" />
      <br />
    </div>
  </xsl:template>

  <xsl:template name="column1Edit">
    <div id="artistSettings">
      <p class="formHeader">Artist Payee Statement Settings</p>
      <hr />    

      <!--                                                              -->
      <!-- display date range header so user knows what they're editing -->
      <!--                                                              -->

      <table class="textChart" id="artistSettingsHeader">
        <tr>

          <!-- Display date range that the settings apply to.      -->
          <!-- Note: this will always have a date end of 'Current' -->

          <td class="center">

            <xsl:variable name="dateCreated">
              <xsl:choose>
                <xsl:when test="Form/CurrentSettings/DateCreated = ''">
                  <xsl:value-of select="'Beginning'" />
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="Form/CurrentSettings/DateCreated" />
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>

            <P class="artistStatementSettingsDateRange">
                  <xsl:value-of select="$dateCreated" /> - Current
            </P>
          </td>
        </tr>
      </table>


      <!--                                                                 -->
      <!-- Display the settings table; this may be larger than the browser -->
      <!-- window, so wrap it in a div to allow scrolling if necessary     -->
      <!--                                                                 -->

      <div style="height: 150px; overflow:auto;">

        <table class="artistStatementSettings">

          <!-- Display the artist settings indicated by SettingsHistory/Pagination/CurrentPage -->


          <!-- Display the header row for all settings -->

          <xsl:call-template name="displaySettingsHeaderRow" />

          <!-- Display the option row for all settings -->

          <xsl:call-template name="displaySettingsOptionalRow" />

          <!-- Display the notes row for all settings -->

          <xsl:call-template name="displaySettingsNoteRow" />

          <!-- Display the checkbox row for all settings -->

          <xsl:call-template name="displaySettingsCheckboxRow">
            <xsl:with-param name="showBoxes">1</xsl:with-param>
          </xsl:call-template>

        </table> <!-- end of settings table -->
      </div>

      <P>Add or remove optional fields from your artist payee statements.</P>

    </div><!-- artistSettings -->
  </xsl:template>


</xsl:stylesheet>
