<%@ Page Title="Project Home" Language="C#" MasterPageFile="~/2ColMaster.Master" AutoEventWireup="true" CodeBehind="ProjectPortal.aspx.cs" Inherits="ProcessDefinition.ProjectPortal" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">


<asp:ObjectDataSource ID="odsMyTasks" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyAssignedTasks"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
        <asp:Parameter Name="userId" Type="Int32"/>
    </SelectParameters>
</asp:ObjectDataSource>

<asp:ObjectDataSource ID="odsMyDocsLinks" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyDocsLinks"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
        <asp:Parameter Name="userId" Type="Int32"/>
    </SelectParameters>
</asp:ObjectDataSource>

<asp:ObjectDataSource ID="odsMyLinkedX" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyLinkedComponents"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
        <asp:Parameter Name="userId" Type="Int32"/>
    </SelectParameters>
</asp:ObjectDataSource>

<asp:ObjectDataSource ID="odsUnassigned" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetUnassignedTasks"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>


<asp:ObjectDataSource ID="odsNotifications" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetRaisedNotifications"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
        <asp:Parameter Name="userId" Type="Int32"/>
    </SelectParameters>
</asp:ObjectDataSource>



<asp:ObjectDataSource ID="odsMyComments" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyComments"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
        <asp:Parameter Name="userId" Type="Int32"/>
    </SelectParameters>
</asp:ObjectDataSource>




<asp:ObjectDataSource ID="odsMyRoles" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyAssignedRoles"
    TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
    <SelectParameters>
        <asp:Parameter Name="projectPlanId" Type="Int32" />
        <asp:Parameter Name="userId" Type="Int32"/>
    </SelectParameters>
</asp:ObjectDataSource>


        <h1>'<asp:Literal runat="server" ID="litUserName" />' Project Home</h1>
                       
        <div id="projPortalsList">
            
            <asp:Panel ID="pnlMyTasks" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myTasks">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-circle-arrow-e'></span>My Project Tasks</h3>
                <div class='ui-widget-content  ui-corner-bottom'>
                    <asp:ListView ID="lstMyTasks" runat="server" ItemPlaceholderID="itemList" EnableViewState="False" DataSourceID="odsMyTasks" >
                        <LayoutTemplate>
                        <ul class="projSumAssign">
                            <asp:PlaceHolder id="itemList" runat="server"/>
                            </ul></li>
                        </ul>
                        </LayoutTemplate>

                        <ItemTemplate>
                            <%# AddNewSectionIfChanged() %>
                            <%# DevProcess.Common.Utils.StringHelper.Format("<li><a href='{4}/Project/{1}/Framed/{2}'>{0:multilinenourl}</a>{3}</li>", Eval("TaskName"), GetPlanId(), Eval("ProjectPlanTaskId"), GetTaskInfo(),pd.R.GetReposRoot())%>
                                                
                        </ItemTemplate>

                        <EmptyDataTemplate>
                            <p>You do not have any tasks assigned to you on this project.</p>
                        </EmptyDataTemplate>
                    </asp:ListView>

                </div>
                </div>                        
            </asp:Panel>
            

            <asp:Panel ID="pnlMyDocuments" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myDocs">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-document'></span>My Documents &amp; Links</h3>
                <div class='ui-widget-content  ui-corner-bottom'>
                    <asp:ListView ID="lstMyDocsLinks" runat="server" ItemPlaceholderID="itemList" EnableViewState="False" DataSourceID="odsMyDocsLinks" >
                        <LayoutTemplate>
                        <ul class="projSumAssign">
                            <asp:PlaceHolder id="itemList" runat="server"/>
                            </ul></li>
                        </ul>
                        </LayoutTemplate>

                        <ItemTemplate>                        
                            <%# AddLiIfLinkChanged() %>
       
                            <%#DevProcess.Common.Utils.StringHelper.Format("<li>{0}</li>", GetSectionTaskLink())%>
                        </ItemTemplate>

                        <EmptyDataTemplate>
                            <p>You do not have any documents or links.</p>
                        </EmptyDataTemplate>
                    </asp:ListView>
                </div>
                </div>                        
            </asp:Panel>

            <asp:ListView ID="lstMyLinkedX" runat="server" ItemPlaceholderID="itemList" EnableViewState="False" DataSourceID="odsMyLinkedX" >
                <LayoutTemplate>
                    <asp:PlaceHolder id="itemList" runat="server"/>
                    </ul></li> </div></div></div>
                </LayoutTemplate>

                <ItemTemplate>

                    <%# AddPanelIfTypeChanged() %>

                    <%# AddLiIfProcessChanged() %>

                    <%#DevProcess.Common.Utils.StringHelper.Format("<li><a href='{3}/Project/{1}/Framed/{2}'>{0}</a></li>", GetSectionTaskLink(), GetPlanId(), Eval("ProjectPlanTaskId"),pd.R.GetReposRoot())%>

                </ItemTemplate>

                <EmptyDataTemplate>
                </EmptyDataTemplate>
            </asp:ListView>

                        
            <asp:Panel ID="pnlRoles" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myRoles">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-person'></span>My Project Roles</h3>
                <div class='ui-widget-content  ui-corner-bottom'>
                
                    <asp:ListView ID="lstMyRoles" runat="server" ItemPlaceholderID="itemList" 
                        EnableViewState="False" DataSourceID="odsMyRoles" 
                        ondatabinding="lstMyRoles_DataBinding" >
                        <LayoutTemplate>
                        <ul class="projSumAssign">
                            <asp:PlaceHolder id="itemList" runat="server"/>
                            </ul></li>
                        </ul>
                        </LayoutTemplate>

                        <ItemTemplate>                        
                            <%# AddLiIfProcessChanged() %>
                            <%# DevProcess.Common.Utils.StringHelper.Format("<li><a href='{3}/Project/{1}/Framed/{2}'>{0:multilinenourl}</a></li>", Eval("TaskName"), GetPlanId(), Eval("TaskId"),pd.R.GetReposRoot()) %>
                        </ItemTemplate>

                        <EmptyDataTemplate>
                            <p>You do not have any roles assigned to you on this project.</p>
                        </EmptyDataTemplate>
                    </asp:ListView>

                
                </div>
                </div>                        
            </asp:Panel>


            <asp:Panel ID="pnlUnassignedTasks" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myUnassigned">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-clipboard'></span>Unassigned Tasks</h3>
                <div class='ui-widget-content  ui-corner-bottom'>

                    <asp:ListView ID="lvUnassigned" runat="server" ItemPlaceholderID="itemListUn"
                            EnableViewState="False" DataSourceID="odsUnassigned" >

                        <LayoutTemplate>
                        <ul class="projSumAssign">
                            <asp:PlaceHolder id="itemListUn" runat="server"/>
                        </ul>
                        </LayoutTemplate>

                        <ItemTemplate>
                        <li>
                        <%#DevProcess.Common.Utils.StringHelper.Format("<a href='{3}/{1}/Task/{2}'>{0:multilinenourl}</a>", Eval("TaskName"), Eval("PrettyPostTitle"), Eval("ProjectPlanTaskId"),pd.R.GetReposRoot())%>
                        </li>
                        </ItemTemplate>

                        <EmptyDataTemplate>
                            <p>All tasks have been assigned on this project.</p>
                        </EmptyDataTemplate>
                    </asp:ListView>

                </div>
                </div>                        
            </asp:Panel>
            
            <asp:Panel ID="pnlReports" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myReports">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-note'></span>Reports</h3>
                <div class='ui-widget-content  ui-corner-bottom'>
                    <ul>
                        <li><a href='../../ProjectReports/Report/AssignmentReport'>Assignment report</a></li>
                        <li><a href='../../ProjectReports/Report/OverdueTasks'>Overdue tasks</a></li>
                        <li><a href='../../ProjectReports/Report/TasksDueToStart'>Tasks due to start</a></li>
                        <li><a href='../../ProjectReports/Report/ProjectLibraryMetrics'>Project metrics/data</a></li>
                        <li><a href='../../ProjectReports/Report/StepFidelity'>Step fidelity</a></li>
                        <li><a href='../../ProjectReports/Review/MissingStepDeletionReason'>Mising deletion reason</a></li>
                        <li><a href='../../ProjectReports/Review/MissingSignedOffExceptions'>Missing signed off exception</a></li>
                        <li><a href='../../ProjectReports/Review/TasksThatCanStart'>Tasks that can start now</a></li>
                        <li><a href='../../ProjectReports/Review/TaskShouldNotStarted'>Tasks that shouldn't have started yet</a></li>
                        <li><a href='../../ProjectReports/Report/ProjectActivity'>Recent project activity</a></li>
                    </ul>
                </div>
                </div>                        
            </asp:Panel>
            
            <asp:Panel ID="pnlNotifications" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myNotifications">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-mail-closed'></span>Notifications</h3>
                <div class='ui-widget-content  ui-corner-bottom'>
                    <asp:ListView ID="lstNotifications" runat="server" ItemPlaceholderID="itemListUn"
                            EnableViewState="False" DataSourceID="odsNotifications" >

                        <LayoutTemplate>
                        <ul class="projSumAssign">
                            <asp:PlaceHolder id="itemListUn" runat="server"/>
                        </ul>
                        </LayoutTemplate>

                        <ItemTemplate>
                        <li>
                        
                            <%# GetNotificationLink() %>
                        
                        </li>
                        </ItemTemplate>

                        <EmptyDataTemplate>
                            <p>You do not have any notifications for this project.</p>
                        </EmptyDataTemplate>
                    </asp:ListView>

                </div>
                </div>                        
            </asp:Panel>


            <asp:Panel ID="pnlComments" runat="server" >
                <div class="reposSummary ui-widget ui-corner-all myComments">
                <h3 class='ui-widget-header  ui-corner-top'><span class='whiteHilightedIcon ui-icon-comment'></span>Discussions</h3>
                <div class='ui-widget-content  ui-corner-bottom'>
                
                    <asp:ListView ID="lstMyComments" runat="server" ItemPlaceholderID="itemListUn"
                            EnableViewState="False" DataSourceID="odsMyComments" >

                        <LayoutTemplate>
                        <ul class="projSumAssign">
                            <asp:PlaceHolder id="itemListUn" runat="server"/>
                        </ul>
                        </LayoutTemplate>

                        <ItemTemplate>
                        <li>
                        
                            <%# GetDiscussionLink() %>
                        
                        </li>
                        </ItemTemplate>

                        <EmptyDataTemplate>
                            <p>You do not have any active discussions for this project.</p>
                        </EmptyDataTemplate>
                    </asp:ListView>
                </div>
                </div>                        
            </asp:Panel>

            
        </div>
        <br class="clear" />

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentOptions" runat="server">

                    <ul class='ui-widget-content btnReturnToLibs'>
                        <li class="btn"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span><a href='<%=pd.R.GetSiteRoot() %>'>
                            Back to libraries</a></li>
                    </ul>

    <asp:Panel runat="server" ID="pnlNavProjectRoot">
    <ul class='ui-widget-content'>
        <li class="btn"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span><a href="<%=ProjectRootUrl %>">Navigate project</a></li>
    </ul>
    </asp:Panel>

    <dp:ProjRolePanel ID="ProjRolePanel1" runat="server" MinimumRole="Manager">
      
    <div class="ui-widget-content ui-corner-all">
        <h3><span class="ui-icon ui-icon-person"></span>Assignments</h3>
        <ul>

            <li class="btn"><span class="ui-icon ui-icon-circle-arrow-e"></span><a href="./Roles">Assign roles</a></li>
         
         </ul>
     </div>
   </dp:ProjRolePanel>    

    <dp:ProjRolePanel ID="RRPanel2" runat="server" MinimumRole="Manager">
        <div class="ui-widget-content ui-corner-all">
            <h3>
                Project library admin</h3>
            <ul class=''>
                <li class="btn hidePhone"><span class="ui-icon ui-icon-plusthick"></span><a href="../ProjectTailor">
                    New project</a></li>
                <li class="btn hidePhone" id="deleteProject"><span class="ui-icon ui-icon-delete"></span><a href="#">
                    Delete project</a></li>
                <li class="btn"><span class="ui-icon ui-icon-person"></span><a href="../Members">
                    Project members</a></li>
                <li class="btn"><span class="ui-icon ui-icon-note"></span><a href="../../ProjectReports/ReportList">
                    Reports</a></li>
            </ul>
        </div>
    </dp:ProjRolePanel>

    <div style='display:none;' class='assignTask ui-corner-all' id='deleteProjectDlg'>
    <div class="hBlurb ui-state-highlight">
        WARNING: You have selected to delete this project library. All projects and all project library content will be removed.
        This operation is not reversible and all projects will be permanently deleted.  Only delete the project library
        if you no longer require any of the projects listed in the library.<br />
        Click <b>Cancel</b> to close this message without deleting the project library.
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnDeleteProjectFirst' value="Delete" class="ui-corner-all ui-state-default dpButton"/>
        <input type="button" id='btnCancelDelete' value="Cancel" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
    </p>
    
    </div> 

    <div style='display:none;' class='assignTask ui-corner-all' id='deleteProjectFinalDlg'>
    <div class="hBlurb ui-state-highlight">
        WARNING: You have selected to delete this project library. This is your final warning, by pressing confirm delete below all projects listed will be permanently deleted.<br />
        Click <b>Cancel</b> to close this message without deleting the project library.
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnDeleteProjectFinal' value="Confirm Delete" class="ui-corner-all ui-state-default dpButton"/>
        <input type="button" id='btnCancelDeleteFinal' value="Cancel" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
    </p>
    
    </div> 

</asp:Content>
