<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<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/bookpub/templates/global.xsl" />

    <xsl:template name="pickLayout">
        <div class="Tracker-basecontainer">
            <xsl:call-template name="helpLink" />
            <xsl:if test="Messages/Message/Type = 'error'">
                <xsl:call-template name="uiWarning">
                    <xsl:with-param name="type" select="'error'" />
                    <xsl:with-param name="description">Period Name must be unique.</xsl:with-param>
                </xsl:call-template>
            </xsl:if>
            <xsl:choose>
                <xsl:when test="Report/Period/PeriodID &gt; 0">
                    <xsl:value-of select="Report/Period/Name" />
                </xsl:when>
                <xsl:otherwise>
                    <form action="/bookpub/tracker" method="post">
                        <input type="hidden" name="c" value="edit_period" />
                        <input type="hidden" name="page" value="{Params/page}" />
                        <input type="hidden" name="redirect" value="{Params/redirect}" />
                        <input type="hidden" name="sub_cmd" value="update" />
                        <input type="hidden" name="period" value="{Report/Period/PeriodID}" />
                        <xsl:if test="Params/redirect">
                            <xsl:call-template name="uiWarning">
                                <xsl:with-param name="type" select="'warning'" />
                                <xsl:with-param name="description">Please provide a name for this period before closing.</xsl:with-param>
                            </xsl:call-template>
                        </xsl:if>
                        <fieldset class="Form-fieldset">
                            <div class="Form-item">
                                <label class="Form-label">
                                    <span class="Form-label-caption">Period Name</span>
                                    <div class="Form-input-wrapper">
                                        <input type="text" class="Input Form-input Tracker-editnote-input" name="period_name" value="{Report/Period/Name}{Params/period_name}" maxlength="25" />
                                    </div>
                                </label>
                            </div>
                        </fieldset>
                        <fieldset class="Form-fieldset Form-fieldset-buttons">
                            <xsl:call-template name="uiButton">
                                <xsl:with-param name="content" select="'Cancel'" />
                                <xsl:with-param name="type" select="'default'"/>
                                <xsl:with-param name="className" select="'Form-button'"/>
                                <xsl:with-param name="url">/bookpub/tracker?period=<xsl:value-of select="Report/Period/PeriodID" /></xsl:with-param>
                            </xsl:call-template>
                            <xsl:call-template name="uiButton">
                                <xsl:with-param name="content" select="'Update'" />
                                <xsl:with-param name="type" select="'primary'"/>
                                <xsl:with-param name="className" select="'Form-button'"/>
                                <xsl:with-param name="elemType" select="'submit'"/>
                            </xsl:call-template>
                        </fieldset>
                    </form>
                </xsl:otherwise>
            </xsl:choose>
        </div>
    </xsl:template>

</xsl:stylesheet>
