﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:include href="GenericTemplates/Item.xslt" />
    <xsl:template match="/">
        <div id="div_UserActions">
            <table class="tableMaster">
                <tr>
                    <td valign="top" width="25%">
                        <table style="border: 1px solid black; padding:10px;" width="100%">
                            <tr onclick='return GetDoIT("CURRENT","div_UserActions", "{normalize-space(UserActions/UserActionSummary/ItemID)}");'>
                                <td>
                                    <img style="margin:2px;display:inline" src="{UserActions/TemplateURL}Web/Icons/Action Not Started/32 Bit Alpha png/Action Not Started 16 n p.png" title="Current" />
                                </td>
                                <td align="right">
                                    <span style='margin:2px;' class="label link">
                                        <xsl:value-of select="normalize-space(UserActions/UserActionSummary/Current)"/>
                                    </span>

                                </td>
                                <td >
                                    <span style='margin:2px;' class="label link">
                                        <xsl:text>Current</xsl:text>
                                    </span>

                                </td>
                            </tr>
                            <tr  onclick='return GetDoIT("INPROGRESS","div_UserActions", "{normalize-space(UserActions/UserActionSummary/ItemID)}");'>
                                <td>
                                    <img style="margin:2px;display:inline"
                                    src="{UserActions/TemplateURL}Web/Icons/Action In Progress/32 Bit Alpha png/Action In Progress 16 n p.png" title="In Progress" />
                                </td>
                                <td align="right">
                                    <span style='margin:2px;' class="label link">
                                        <xsl:value-of select="normalize-space(UserActions/UserActionSummary/InProgress)"/>
                                    </span>
                                </td>
                                <td>
                                    <span style='margin:2px;' class="label link">
                                        <xsl:text>In Progress</xsl:text>
                                    </span>
                                </td>
                            </tr>
                            <tr  onclick='return GetDoIT("PASTDUE","div_UserActions", "{normalize-space(UserActions/UserActionSummary/ItemID)}");'>
                                <td>
                                    <img style="margin:2px;display:inline"
                                     src="{UserActions/TemplateURL}Web/Icons/Action Past Due/32 Bit Alpha png/Action Past Due 16 n p.png" title="Past Due" />
                                </td>
                                <td align="right">
                                    <span style='margin:2px;' class="label link">
                                        <xsl:value-of select="normalize-space(UserActions/UserActionSummary/PastDue)"/>
                                    </span>
                                </td>
                                <td>
                                    <span style='margin:2px;' class="label link">
                                        <xsl:text>PastDue</xsl:text>
                                    </span>
                                </td>
                            </tr>
                        </table>
                        <div >
                        </div>
                    </td>
                    <td valign="top">
                        <xsl:if test ="UserActions/UserActionSummary/Current = 0">
                            <xsl:if test ="UserActions/UserActionSummary/InProgress= 0">
                                <xsl:if test ="UserActions/UserActionSummary/PastDue= 0">
                                    <div class="100%" style="text-align:center; padding-top:10px">
                                        <i>
                                            <div>
                                                <span class="label">You currently have no item assigned to you.</span>
                                            </div>
                                            <div>
                                                <span class="label">Add Actions in your goals and they will appear here.</span>
                                            </div>
                                        </i>
                                    </div>
                                </xsl:if>
                            </xsl:if>
                        </xsl:if>
                        <xsl:for-each select="UserActions/Item">
                            <div  id="div_UserActions_Item_{normalize-space(ID)}_Container" style="margin-top:10px;">
                                <xsl:call-template name="displayAction"></xsl:call-template>
                            </div>
                        </xsl:for-each>
                    </td>
                </tr>
            </table>
        </div>
    </xsl:template>

    <xsl:template name ="displayAction">

        <xsl:variable name="ItemDivPrefix">
            <xsl:text>div_ActionReport_Item_</xsl:text>
            <xsl:value-of select ="normalize-space(ID)"></xsl:value-of>
        </xsl:variable>

        <div id="{normalize-space($ItemDivPrefix)}" style="margin-left:15px; margin-right: 5px; margin-bottom: 10px;">
            <xsl:call-template name="Item">
                <xsl:with-param name="TemplatePathURL" select="../TemplateURL"></xsl:with-param>
                <xsl:with-param name="ItemID" select="normalize-space(ID)"></xsl:with-param>
                <xsl:with-param name="GoalID" select="normalize-space(PrimaryID)"></xsl:with-param>
                <xsl:with-param name="Status" select="normalize-space(Status)"></xsl:with-param>
                <xsl:with-param name="Level" select="normalize-space(Level)"></xsl:with-param>
                <xsl:with-param name="ParentParentID" select="normalize-space(ParentParentID)"></xsl:with-param>
                <xsl:with-param name="ParentID" select="normalize-space(ParentID)"></xsl:with-param>
                <xsl:with-param name="UpperSiblingID" select="normalize-space(UpperSiblingID)"></xsl:with-param>
                <xsl:with-param name="LowerSiblingID" select="normalize-space(LowerSiblingID)"></xsl:with-param>
                <xsl:with-param name="Mode" select="'TaskReport'"></xsl:with-param>

                <xsl:with-param name="PermissionID" select="normalize-space(PermissionID)"></xsl:with-param>
                <xsl:with-param name="LeftDays" select="normalize-space(LeftDays)"></xsl:with-param>
                <xsl:with-param name="DueDate" select="normalize-space(DueDate)"></xsl:with-param>
                <xsl:with-param name="Responsible" select="normalize-space(Responsible)"></xsl:with-param>

                <xsl:with-param name="TotalCount" select="normalize-space(TotalCount)"></xsl:with-param>
                <xsl:with-param name="Completed" select="normalize-space(Completed)"></xsl:with-param>
                <xsl:with-param name="PastDueCount" select="normalize-space(PastDueCount)"></xsl:with-param>
                <xsl:with-param name="Name" select="normalize-space(ItemName)"></xsl:with-param>
                <xsl:with-param name="TypeID" select="normalize-space(TypeID)"></xsl:with-param>
                <xsl:with-param name="TotalChildCount" select="normalize-space(TotalChildCount)"></xsl:with-param>
                <xsl:with-param name="ItemDivPrefix" select ="normalize-space($ItemDivPrefix)"></xsl:with-param>
            </xsl:call-template>
        </div>
    </xsl:template>

</xsl:stylesheet>






