<%@ Page Language="C#" MasterPageFile="~/2ColMaster.Master" AutoEventWireup="true"
    CodeBehind="ProjectPlans.aspx.cs" Inherits="ProcessDefinition.ProjectPlans" Title="Project plans" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">
    <h2>
        Projects</h2>
    <br />
    <asp:ObjectDataSource ID="odsProjectPlans" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetProjectPlans" TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
        <SelectParameters>
            <asp:Parameter Name="repositoryName" Type="String" />
            <asp:SessionParameter Name="projectId" Type="Int32" SessionField="ProjectId" />
            <asp:Parameter Name="maxReturn" Type="Int32" DefaultValue="1000" />
            <asp:Parameter Name="UserId" Type="Int32" DefaultValue="0" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ListView ID="lvProjectPlans" runat="server" ItemPlaceholderID="itemList" EnableViewState="False"
        DataSourceID="odsProjectPlans">
        <LayoutTemplate>
            <table class='summaryTable'>
                <tr>
                    <th>
                        Projects
                    </th>
                    <th>
                        Created
                    </th>
                    <th>
                        Microsoft Project plan
                    </th>
                </tr>
                <asp:PlaceHolder ID="itemList" runat="server" />
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr class="<%# ((ListViewDataItem)Container).DisplayIndex % 2 == 0 ? "" : "altZebra" %>">
                <td>
                    <asp:HyperLink ID='lnk' runat="server" NavigateUrl='<%#DevProcess.Common.Utils.StringHelper.Format("{1}/Project/{0:scramble,pPl}/Framed",Eval("ProjectPlanId"),pd.R.GetReposRoot()) %>'
                        Text='<%#DevProcess.Common.Utils.StringHelper.Format("{0:multilinenourl}", Eval("ProjectPlanName")) %>' />
                </td>
                <td>
                    <%#DevProcess.Common.Utils.StringHelper.Format("{0:roughtimespan} ago", DateTime.UtcNow - (DateTime)Eval("DateCreated"))%>
                </td>
                <td>
                    <asp:HyperLink ID='lnkPlan' runat="server" NavigateUrl='<%#DevProcess.Common.Utils.StringHelper.Format("{1}/Project/{0:scramble,pPl}/MSProject",Eval("ProjectPlanId"),pd.R.GetReposRoot()) %>'
                        Text='Download' Target="_blank" />
                </td>
            </tr>
        </ItemTemplate>
        <EmptyDataTemplate>
            <p class="hBlurb ui-state-highlight">
                You have no Project Plans. Click 'New project' on the right, or 'Project members' to set up your team.
            </p>
        </EmptyDataTemplate>
    </asp:ListView>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentOptions" runat="server">
    <ul class='ui-widget-content'>
        <li class="btn"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span><a href='<%=pd.R.GetSiteRoot()%>'>
            Back to libraries</a></li>
    </ul>
    <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="../Project/ProjectTailor">
                    New project</a></li>
                <li class="btn"><span class="ui-icon ui-icon-person"></span><a href="../Project/Members">
                    Project members</a></li>
                <li class="btn"><span class="ui-icon ui-icon-note"></span><a href="../ProjectReports/ReportList">
                    Reports</a></li>
                <li class="btn hidePhone" id="deleteProjectLibrary"><span class="ui-icon ui-icon-delete"></span><a href="#">
                    Delete all projects</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 all projects. By deleting all projects the entire project library and all content will be removed.
        This operation is not reversible and all project data and structure will be permanently deleted.  All project members will be removed and 
        their assigned projects and tasks removed. Only delete all projects if you no longer require any project data in this library.<br />
        Click <b>Cancel</b> to close this message without deleting all projects.
    </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 all projects. This is your final warning, by pressing confirm delete below all projects will be permanently deleted.<br />
        Click <b>Cancel</b> to close this message without deleting all projects.
    </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>
