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

    <xsl:template name="onHoldCheckBox">
        <xsl:variable name="url">/support/job_queue?c=togglehold&amp;job_id=<xsl:value-of select="JobID" /></xsl:variable>
        <xsl:choose>
		    <xsl:when test="ParentPaused = 1">
                <td class="error">PAUSED</td>
		    </xsl:when>
		    <xsl:otherwise>
                <td>
    		        <input type="checkbox" name="onHold" id="onHold">
                        <xsl:attribute name="onclick">ajaxRequest( '<xsl:value-of select="$url" />' );</xsl:attribute>
                        <xsl:if test="OnHold = 1">
                            <xsl:attribute name="checked">checked</xsl:attribute>
                        </xsl:if>
                    </input>
                </td>
		    </xsl:otherwise>
	    </xsl:choose>
<!--		    <xsl:if test="OnHold = 1"><td class="error">ON HOLD</td></xsl:if>
		    <xsl:if test="OnHold = 0"><td> </td></xsl:if> -->
    </xsl:template>

	<xsl:template name="pauseCheckBox">
    <xsl:variable name="pauseurl">/support/job_queue?c=togglepaused&amp;job_id=<xsl:value-of select="JobID" /></xsl:variable>
    <td>
        <xsl:if test="ChildCount &gt; 0" >
		  <input type="checkbox" name="paused" id="paused">
            <xsl:attribute name="onclick">ajaxRequest( '<xsl:value-of select="$pauseurl" />' );</xsl:attribute>
              <xsl:if test="Paused = 1">
                  <xsl:attribute name="checked">checked</xsl:attribute>
              </xsl:if>
          </input>
          ( <xsl:value-of select="WaitingChildCount" /> / <xsl:value-of select="ChildCount" /> )
        </xsl:if>
    </td>
    </xsl:template>


	<xsl:template name="clientIDToName">
		<xsl:param name="clientID" />
        <xsl:value-of select="/Root/Clients/Client[ClientID = $clientID]/ClientName" />
	</xsl:template>

  <xsl:template name="jobDetailLink">
    <xsl:param name="job_id" />
    <a href="/support/job_queue?c=show_job&amp;JobID={$job_id}" >
      <xsl:value-of select="$job_id" />
    </a>
  </xsl:template>

</xsl:stylesheet>
