<!--                                                                  -->
<!--  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="" encoding="utf-8" />

    <xsl:include href="/app/tools/rps/templates/global.xsl"/>
    <xsl:include href="edit.xsl"/>
    <xsl:include href="show.xsl"/>

    <xsl:template name="pickLayout">
        <div class="MainBaseSection">
            <xsl:if test="$cmd = 'edit'">
                <xsl:call-template name="cCompEditLayout"/>
            </xsl:if>
            <xsl:if test="$cmd = 'show'">
                <xsl:call-template name="cCompShowLayout"/>
            </xsl:if>
        </div>
    </xsl:template>

    <xsl:template name="submitButton">
        <xsl:choose>
            <xsl:when test="$cmd = 'edit'">
                <xsl:call-template name="uiButton">
                    <xsl:with-param name="type" select="'primary'" />
                    <xsl:with-param name="elemType" select="'submit'" />
                    <xsl:with-param name="name" select="'submit'" />
                    <xsl:with-param name="id" select="'submitButton'" />
                    <xsl:with-param name="className" select="'Form-button'" />
                    <xsl:with-param name="content">
                        <xsl:if test="normalize-space(Form/ControlledComposition/ControlledCompositionID)">Update</xsl:if>
                        <xsl:if test="not(normalize-space(Form/ControlledComposition/ControlledCompositionID))">Create</xsl:if>
                    </xsl:with-param>
                    <xsl:with-param name="disabled">
                        <xsl:if test="$lockedRecord = 1">true</xsl:if>
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:when>
            <xsl:when test="$cmd = 'show'">
                <xsl:call-template name="uiButton">
                    <xsl:with-param name="type" select="'primary'" />
                    <xsl:with-param name="content" select="'Edit'"/>
                    <xsl:with-param name="className" select="'Form-button'" />
                    <xsl:with-param name="url">ccomp?CCompID=<xsl:value-of select="Form/ArtistContract/ControlledComposition/ControlledCompositionID"/>&amp;c=edit</xsl:with-param>
                </xsl:call-template>
            </xsl:when>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="cancelButton">
        <xsl:call-template name="uiButton">
            <xsl:with-param name="type" select="'default'"/>
            <xsl:with-param name="name" select="'Cancel'"/>
            <xsl:with-param name="content" select="'Return to Contract'"/>
            <xsl:with-param name="className" select="'Form-button'" />
            <xsl:with-param name="url">artist_contract?ArtistContractID=<xsl:value-of select="Form/ArtistContract/ArtistContractID"/>&amp;c=show</xsl:with-param>
        </xsl:call-template>
    </xsl:template>
</xsl:stylesheet>

