<%@ Page Title="Process Director" Language="C#" MasterPageFile="~/MasterPage.Master"
    AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ProcessDefinition.Default" %>

<%@ Register Src="Controls/RepositorySummary.ascx" TagName="RepositorySummary" TagPrefix="ctl" %>
<%@ Register Src="Controls/ProjectHomePage.ascx" TagName="ProjectHomePage" TagPrefix="ctl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentBody" runat="server">
    <asp:Panel ID="pnlNotAuthorized" runat="server" Visible="false">
        <div class="slideContainer">
            <p class='hBlurb ui-state-highlight hidePhone'>
                Easily define your processes, get them in front of the team, capture process usage
                and continuously improve.</p>
            <table class="hidePhone">
                <tr>
                    <td>
                        <ul class="slideIndex" style="background-position: left 2px;">
                            <li><span class="siP">process</span>Libraries</li>
                            <li><span class="siP">maturity</span>Dashboard</li>
                            <li><span class="siP">simple</span>Browsing</li>
                            <li><span class="siP">powerful</span>Searching</li>
                            <li><span class="siP">process</span>Export</li>
                            
                            <li><span class="siP">dependency</span>Charts</li>
                            <li><span class="siP">process</span>Visualization</li>
                            <li><span class="siP">structural</span>Context</li>
                            <li><span class="siP">process</span>Push</li>
                            <li><span class="siP">online</span>Editing</li>
                            <li><span class="siP">editting</span>Integration</li>
                            <li><span class="siP">process</span>Modeling</li>
                            <li><span class="siP">definable</span>Metrics</li>
                            <li><span class="siP">metadata</span>Collection</li>
                            <li><span class="siP">offline</span>Forms</li>
                            <li><span class="siP">process</span>Analytics</li>
                            <li><span class="siP">automatic</span>Versioning</li>
                        </ul>
                    </td>
                    <td>
                        <div class="slidePhoto ui-corner-all">
                            <div class="slideCur">
                                <img src="App_Themes/Default/Images/pdhome/pd1.png" />
                                <div class="paneInfo">Multiple process libraries, for process baselines and project specific processes.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd2.png" />
                                <div class="paneInfo">Process dashboard for process users and process maturity dashboard for authors.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd3.png" />
                                <div class="paneInfo">Quickly browse processes by tags.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd4.png" />
                                <div class="paneInfo">Full text searching of process libraries.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd5.png" />
                                <div class="paneInfo">Export processes to Microsoft Word for use offline.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd6.png" />
                                <div class="paneInfo">Calculated process structure and dependency maps.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd7.png" />
                                <div class="paneInfo">Automatic generation of process visualization.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd8.png" />
                                <div class="paneInfo">Automatic generation of dependencies.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd9.png" />
                                <div class="paneInfo">Send processes to colleagues.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd10.png" />
                                <div class="paneInfo">Online editing of processes.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd11.png" />
                                <div class="paneInfo">Edit and publish processes directly in Microsoft Word and other editors.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd12.png" />
                                <div class="paneInfo">Drag and drop modeling of processes.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd13.png" />
                                <div class="paneInfo">Define the process metadata you want to collect.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd14.png" />
                                <div class="paneInfo">Simple metric collection embedded in process.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd15.png" />
                                <div class="paneInfo">Metric collection forms exported to Microsoft Word for offline use.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd16.png" />
                                <div class="paneInfo">Process supply and demand analytics.</div>
                                <img src="App_Themes/Default/Images/pdhome/pd17.png" />
                                <div class="paneInfo">Automatic process versioning for process improvement.</div>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
            <p class='hBlurb ui-state-highlight '>
                Do you already have an account? <a href="Signin.aspx">Sign in</a> to access your
                processes.</p>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnlSelectRepos" runat="server" Visible="false">
        <table style="width: 100%;">
            <tr class="tblContentMainRow">
                <td>
    
        <h1 class="pt">Process libraries</h1>
        <asp:ObjectDataSource ID="odsItems" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetAllUserProjects" TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
            <SelectParameters>
                <asp:SessionParameter Name="userId" Type="Int32" SessionField="UserId" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <div>
            <asp:Panel ID="pnlIPhone" runat="server" Visible="false">
                <div class="reposSummary ui-widget ui-corner-all iPhoneAccess">
                </div>                        
            </asp:Panel>
        <asp:ListView ID="lstItems" runat="server" ItemPlaceholderID="itemList" EnableViewState="False"
            DataSourceID="odsItems">
            <LayoutTemplate>
                    <asp:PlaceHolder ID="itemList" runat="server" />
            </LayoutTemplate>
            <ItemTemplate>
                <ctl:RepositorySummary ID="repos" runat="server" RepositoryName='<%#Eval("RepositoryName")%>' MemberRole='<%#Eval("MemberRole")%>'  ProjectId='<%#Eval("ProjectId")%>' ProjectName='<%#Eval("ProjectName")%>' ProjMemberRole='<%#Eval("ProjectMemberRole")%>' Visible='<%#Eval("ProjectId")!=null || (int)Eval("MemberRole")>=2 %>' IsPinned='<%#Eval("IsPinned")%>'  />
            </ItemTemplate>
            <EmptyDataTemplate>
            </EmptyDataTemplate>
        </asp:ListView>
        </div>
        <br class="clear" />
        
        
        </td>
        <td class="tblContentMainOpt" style="width: 300px;padding-top:50px;">
            <div class="tblContentMainOptToggle" style="display:none;"></div>
            <div class="tblContentMainOptMenu">
            <asp:Panel ID="pnlNewLibrary" runat="server" Visible="false">
            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn"><span class="ui-icon ui-icon-play"></span><a href="./library/NewLibrary">
                    New library</a></li>
            </ul>
            </asp:Panel>
            <ul class='ui-widget-content ui-corner-all'>
                <li class="btn"><span class="ui-icon ui-icon-key"></span><a href="./Auth/Profile.aspx">
                    Account settings</a></li>
            </ul>
            <ul class='ui-widget-content ui-corner-all'>
                <li class="btn"><span class="ui-icon ui-icon-key"></span>
                    <asp:LinkButton ID="btnSignOut" runat="server" Text="Sign out" OnClick="btnSignOut_Click" />
                </li>
            </ul>
            
            <asp:Panel ID="pnlEmailTemplates" runat="server" Visible="false">
            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn"><span class="ui-icon ui-icon-mail-closed"></span><a href="./SiteAdmin/Emails.aspx">
                    Email templates</a></li>
            </ul>
            </asp:Panel>
            
                        
            <asp:Panel ID="pnlLicensing" runat="server" Visible="false">
            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn"><span class="ui-icon ui-icon-locked"></span><a href="./SiteAdmin/Licensing.aspx">
                    Licensing</a></li>
            </ul>
                                    
            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn"><span class="ui-icon ui-icon-person"></span><a href="./SiteAdmin/ManageUsers">
                    Manage site admins</a></li>
            </ul>
            
            </asp:Panel>
            </div>
        </td>
        </tr>
        </table>
        
        
    </asp:Panel>
    <asp:Panel ID="pnlProj" runat="server" Visible="false">
        <table style="width: 100%;">
            <tr class="tblContentMainRow">
                <td id="tblProjHomePage">
        <ctl:ProjectHomePage id="projHomePage" runat="server" />
                </td>
                <td class="tblContentMainOpt" style="width: 300px;">
                    <div class="tblContentMainOptToggle" style="display:none;"></div>
                    <div class="tblContentMainOptMenu">
                    <ul class='ui-widget-content btnReturnToLibs'>
                        <li class="btn"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span><a href='<%=pd.R.CurrentScheme+pd.R.Site %>' target="_top">
                            Back to libraries</a></li>
                    </ul><ul class='ui-widget-content btnReturnToLibs'>
                        <li class="btn"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span><a href='<%=String.Format("/Project/{0}/SelectProject",CurrentProjectId) %>' target="_top">
                            Back to projects</a></li>
                    </ul>
                    </div>
                </td>
           </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="pnlRepos" runat="server" Visible="false">
        <table style="width: 100%;">
            <tr  class="tblContentMainRow">
                <td id="taggedProcessesCell">
                    <h1 class="pt">
                        <span id="homeProcTitle"><span class="ui-icon ui-icon-home"></span> </span></h1>
                    <div id="homeProcList">
                    </div>
                </td>
                <td class="tblContentMainOpt tblContentMainOptUnfixed" style="width: 300px;">
                    <div class="tblContentMainOptToggle" style="display:none;"></div>
                    <div class="tblContentMainOptMenu">
                    <ul class='ui-widget-content btnReturnToLibs'>
                        <li class="btn"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span><a href='<%=pd.R.CurrentScheme+pd.R.Site %>' target="_top">
                            Back to libraries</a></li>
                    </ul>
                    <dp:ProcessLibPanel ID="ProcessLibPanel1" runat="server">
                        <dp:RRPanel ID="RRPanel3" runat="server" MinimumRole="Author">
                            <ul  class='ui-widget-content ui-corner-all hidePhone'>
                                <li class="btn"><span class="ui-icon ui-icon-pencil"></span><a href='<%=pd.R.GetReposRoot()+"/-/New" %>'>New definition</a></li>
                            </ul>
                        </dp:RRPanel>
                    </dp:ProcessLibPanel>                    
                    <div  class='ui-widget-content ui-corner-all'><h3>Browse</h3>
                    <ul>
                        <dp:DpPanel ID="pnlHomeBtn" runat="server" PanelTagKey="" Visible="false">
                        <li class="btn"><span class="ui-icon ui-icon-home"></span><a href="#$Home" id='ldHome'>
                            Home</a></li>
                        </dp:DpPanel>
                        <li class="btn"><span class="ui-icon ui-icon-home"></span><a href="#$Summary" id='ldSummary'>
                            Library summary</a></li>
                        <dp:RRPanel ID="RRPanel4" runat="server" MinimumRole="Author">
                        <li class="btn"><span class="ui-icon ui-icon-heart"></span><a href="#$Recent" id='ldRecent'>
                            Recently viewed<asp:Label ID="lblRecent" runat="server" CssClass="rec" /></a></li>
                        <li class="btn"><span class="ui-icon ui-icon-plusthick"></span><a href="#$New" id='ldNew'>New
                            definitions<asp:Label ID="lblNew" runat="server" CssClass="rec" /></a></li>
                        <li class="btn"><span class="ui-icon ui-icon-signal-diag"></span><a href="#$Updated" id='ldUpdated'>
                            Updated definitions<asp:Label ID="lblUpdated" runat="server" CssClass="rec" /></a></li>
                        </dp:RRPanel>
                        <li class="btn"><span class="ui-icon ui-icon-shuffle"></span><a href="#$Explorer" id='ldExplorer'>
                            Library structure</a></li>
<!--                        <li class="btn"><span class="ui-icon ui-icon-shuffle"></span><a href="#$Relations" id='ldRelations'>
                            Library relationships</a></li> -->
                    </ul>
                    </div>
                    <div class="ui-widget-content ui-corner-all">
                        <h3>
                            <span class="ui-icon ui-icon-tag"></span>Browse by tags</h3>
                        <dp:ProcessTagCloud ID="tg" runat="server" />
                    </div>
                <dp:ProcessLibPanel ID="pnlNpl" runat="server">
                    <dp:RRPanel ID="RRPanel1" runat="server" MinimumRole="Author">
                    <div  class='ui-widget-content ui-corner-all'>
                    <h3>Author</h3>
                        <ul>
                            <li class="btn"><span class="ui-icon ui-icon-note"></span><a href="<%=pd.R.GetReposRoot()+"/Reports/ReportList" %>">Reports</a></li>
                            <li class="btn hidePhone"><span class="ui-icon ui-icon-gear"></span><a href="<%=pd.R.GetReposRoot()+"/Library/ProcessBuilderHelpers/" %>">Process building helpers</a></li>
                        </ul>
                     </div>
                    </dp:RRPanel>
                    
                    <dp:RRPanel ID="rrAdmin" runat="server" MinimumRole="Admin">
                        <div class="ui-widget-content ui-corner-all hidePhone">
                            <h3>Admin</h3>
                            <ul>
                                    <li class="btn"><span class="ui-icon ui-icon-clipboard"></span><a href="<%=pd.R.GetReposRoot()+"/Project/NewProject" %>">
                                        New project library</a></li>
                                    <li class="btn"><span class="ui-icon ui-icon-person"></span><a href="<%=pd.R.GetReposRoot()+"/Admin/ManageUsers" %>">
                                        Manage users</a></li>
                                    <li class="btn"><span class="ui-icon ui-icon-document-b"></span><a href="<%=pd.R.GetReposRoot()+"/Library/ProcessTypes" %>">
                                        Process library types</a></li>
                                    <li class="btn"><span class="ui-icon ui-icon-wrench"></span><a href="<%=pd.R.GetReposRoot()+"/Admin/Settings" %>">
                                        Process library settings</a></li>
                                    <li class="btn"><span class="ui-icon ui-icon-tag"></span><a href="<%=pd.R.GetReposRoot()+"/Library/Tags" %>">
                                        Manage tags</a></li>
                                    <li class="btn"><span class="ui-icon ui-icon-transferthick-e-w"></span><a href="<%=pd.R.GetReposRoot()+"/Admin/Database" %>">
                                        Library import/export</a></li>
                                    <li class="btn"><span class="ui-icon ui-icon-play"></span><a href="<%=pd.R.GetReposRoot()+"/Admin/Publish" %>">
                                        Publish library</a></li>
                                       
                                    <asp:Panel ID="pnlDeleteLibrary" runat="server" Visible="false">
                                    <li class="btn" id="deleteProcessLibrary"><span class="ui-icon ui-icon-delete"></span><a href="#">
                                        Delete process library</a></li>
                                    </asp:Panel>
                                        
                            </ul>
                        </div>
                    </dp:RRPanel>
                     </dp:ProcessLibPanel>
                    <dp:ProjRolePanel ID="RRPanel2" runat="server" MinimumRole="Manager">
                        <div class="ui-widget-content ui-corner-all hidePhone">
                            <h3>Project library admin</h3>
                            <ul class=''>
                                    <li class="btn"><span class="ui-icon ui-icon-person"></span><a href="<%=pd.R.GetReposRoot()+"/Project/Members" %>">Project members</a></li>
                     
                            </ul>
                          </div>
                    </dp:ProjRolePanel>
                        </div>
                </td>
            </tr>
        </table>
        

    <div style='display:none;' class='assignTask ui-corner-all' id='deleteProcessDlg'>
    <div class="hBlurb ui-state-highlight">
        WARNING: You have selected to delete the process library. By deleting the process library all process library content, all project libraries 
        based on this process library and all projects within those project libraries will also be removed.
        This operation is not reversible and all data and structure will be permanently deleted.  
        Only delete a process library if you no longer require any process and/or related project data.  We recommend you have a SQL backup of the database
        before performing any process library deletions.<br />
        Click <b>Cancel</b> to close this message without deleting the process library including all related project data.
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnDeleteProcessFirst' 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='deleteProcessFinalDlg'>
    <div class="hBlurb ui-state-highlight">
        WARNING: You have selected to delete the process library. This is your final warning, by pressing confirm delete below 
        all process library content, all project libraries based on this process library and all projects within those project libraries will be permanently deleted.<br />
        Click <b>Cancel</b> to close this message without deleting the process library including all related project data.
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnDeleteProcessFinal' 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:Panel>
</asp:Content>
