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

<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">
    <h1 class='ui-widget-header processHead <%=TaskTypeClass %>'>
        <span class="pProcName"><asp:Literal ID="litTitle" runat="server" /></span> <span class="pTypeName"><asp:Literal ID="litTypeName" runat="server" /></span> </h1>
    <div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all  <%=TaskTypeClass %>">
        <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
            <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active viewTab"><a href="#tabsDesc">View</a></li>
            <dp:ProcessLibPanel ID="ProcessLibPanel2" runat="server">
            <dp:DpPanel ID="pnlLinksHere" runat="server" Visible="false" PanelTagKey="">
                <li class="ui-state-default ui-corner-top  notProject"><a href="#tabsDet">Relationships</a></li>
            </dp:DpPanel>
            <dp:DpPanel ID="pnlStruct" runat="server" Visible="false" PanelTagKey="">
            <li class="ui-state-default ui-corner-top notProject hidePhone"><a href="#tabsStructure" strtab="1">Structure</a></li>
            </dp:DpPanel>
            <dp:DpPanel ID="pnlUsage" runat="server" Visible="false" PanelTagKey="">
                <li class="ui-state-default ui-corner-top hidePhone"><a href="#tabsUsage">Usage Properties</a></li>
            </dp:DpPanel>
            <dp:DpPanel ID="pnlMetrics" runat="server" Visible="false" PanelTagKey="">
                <li class="ui-state-default ui-corner-top hidePhone"><a href="#tabsMetrics">Project Metadata</a></li>
            </dp:DpPanel>
            </dp:ProcessLibPanel>
            <li id="ifMetadataTabs" style="display:none;" ></li>
            
            <li class="ui-state-default ui-corner-top"><a href="#tabsDiscussion">Discuss</a></li>

            <dp:DpPanel ID="pnlBpmn" runat="server" Visible="false" PanelTagKey="">
                        <li class="ui-state-default ui-corner-top bpmnTab hidePhone"><a href="#tabsBpmn">BPMN View</a></li>
            </dp:DpPanel>
        </ul>
                
        <div id="tabsDesc" class="ui-tabs-panel ui-widget-content ui-corner-bottom">            
            <div class="postBody">
                <div id="autoLinkProperties">
                    <asp:Literal ID="litBody" runat="server" EnableViewState="false" />
                    <br class="clear" />
                    <dp:StepList ID="steps" runat="server" />
                    <asp:Literal ID="litStepUpgradeHistory" runat="server" EnableViewState="false" />
                </div>
            </div>
        </div>

    <dp:DpPanel ID="pnlUsageDetail" runat="server" Visible="false" PanelTagKey="">
        <div id="tabsUsage" class="ui-tabs-hide">
            <dp:ProcessLibPanel runat="server" ID="pnlProcessUsageOnly">        
                <dp:Metadata ID="processSpecificUsageProps" runat="server" ForeignType="19" MetadataForeignType="19" ShowEditButtons="false" 
                    ViewMode="Edit" Enabled="false"  MetadataName="data" />       
            </dp:ProcessLibPanel>
        </div>
    </dp:DpPanel>
        
    <dp:DpPanel ID="pnlMetricsDetail" runat="server" Visible="false" PanelTagKey="">
        <div id="tabsMetrics" class="ui-tabs-hide">
            <dp:ProcessLibPanel runat="server" ID="pnlProcessMetadataOnly">        
                <dp:Metadata ID="processCommonMetadata" runat="server" ForeignType="18" MetadataForeignType="18" ShowEditButtons="false" 
                    ViewMode="Edit" Enabled="false"  MetadataName="data" />
                <dp:Metadata ID="processSpecificMetadata" runat="server" ForeignType="16" MetadataForeignType="16" ShowEditButtons="false" 
                    ViewMode="Edit" Enabled="false"  MetadataName="data" />       
            </dp:ProcessLibPanel>
        </div>
    </dp:DpPanel>

    <div id="tabsProjectMetadata"  class="ui-tabs-hide">
        <iframe id="ifLinkedMetadata" src='<%=pd.R.GetReposRoot()+"/metadataloading.htm" %>' frameborder="0" scrolling="no" width="100%" height='500px' style="height:500px;"></iframe>
    </div>
    
    <div id="tabsDet" class="ui-tabs-hide">
        <dp:LinkUsage ID="procLinkUsage" runat="server" />
    </div>
    
    
    <div id="tabsStructure" class="ui-tabs-hide">
        <div id="pstructure"><div class="pstructureLoading">Loading...</div></div>
    </div>


    <div id="tabsDiscussion" class="ui-tabs-hide">
        <p class="infoBlurb ui-state-highlight">Discussions are visible across projects.<br />Avoid posting project sensitive information in these discussions.</p>
        <div id="discussionText">
        <dp:JqTextBox ID="txtDiscussion" runat="server" TextBoxMode="MultiLine" Columns="80" /><br />
        <input type="button" id='btnPostDiscussion' value="Post comment" class="ui-corner-all ui-state-default dpButton" />
        <div id="prevDiscussions">Loading...</div></div>
    </div>

    <div id="tabsBpmn" class="ui-tabs-hide">
    <asp:Literal ID="litBpmnOptions" runat="server" />
        <div id="bpmnContent"></div>
        <div class="bpmnLoading">Loading...</div>
    </div>
    
    </div>
    
    <div id="dialogDeleteGraphConfirmation" title="Delete relationship graph">
        <p>
            <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
            Are you sure you want to delete this relationship graph?</p>
    </div>
    
</asp:Content>
<asp:Content ID="Content1" 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.GetReposRoot() %>">Back to library</a></li>
    </ul>

    <dp:DpPanel ID="pnlTaskProgress" runat="server" PanelTagKey="" Visible="false">
    <ul class='ui-widget-content ui-corner-all  hidePhone'>
        <li class="btn" id="taskProgress"><span class="ui-icon ui-icon-play"></span><a href="#">
            Task progress</a></li>
    </ul>
    </dp:DpPanel>
    

    <dp:ProcessLibPanel ID="ProcessLibPanel1" runat="server">
    <ul class='ui-widget-content hidePhone'>
        <li class="btn" id="showNavigation"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span><a href="javascript: top.location.href = '<%=pd.R.GetReposRoot()+"/"+PrettyTitle %>/framed'">Show navigation</a></li>
    </ul>
    </dp:ProcessLibPanel>

    <ul class='ui-widget-content ui-corner-all'>
        <li class="btn"><span class="ui-icon ui-icon-newwin"></span><a href="<%=ExportDocumentUrl %>/Pdf" target="_blank">
            Download PDF</a></li>
        <li class="btn"><span class="ui-icon ui-icon-newwin"></span><a href="<%=ExportDocumentUrl %>/MSWord" target="_blank">
            Download MS Word</a></li>
    </ul>

    <dp:ActiveProjectOnlyPanel ID="pnlAssign" runat="server">

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

                <li class="btn" id="assignTask"><span class="ui-icon ui-icon-circle-arrow-e"></span><a href="#">Assign task</a></li>
             
             </ul>
             <ul id='selAssignedTo'>
             
             </ul>
         </div>
       </dp:ProjRolePanel>    
    </dp:ActiveProjectOnlyPanel>

    <div id="showAssignedRoles" style="display: none"></div>
    
   <dp:ActiveProjectOnlyPanel ID="pnlUpgradeOptions" runat="server" Visible="false">
        <dp:ProjRolePanel ID="ProjRolePanel2" runat="server" MinimumRole="Manager">
          
        <div class="ui-widget-content ui-corner-all hidePhone">
            <h3><span class="ui-icon ui-icon-circle-arrow-n"></span>Upgrade</h3>
            <ul>
                <li class="btn"><span class="ui-icon ui-icon-search"></span><a href='<%=pd.R.GetReposRoot() +"/UpgradePreview/"+TaskId.Value.ToString() %>' target="_blank">View upgrade</a></li>
                <li class="btn" id="upgradeProcess" visible="false"><span class="ui-icon ui-icon-circle-arrow-n"></span><a href="#">Upgrade</a></li>                    
            </ul>
         </div>
         
        </dp:ProjRolePanel>    
    </dp:ActiveProjectOnlyPanel>

    
    <dp:ProcessLibPanel ID="pnlProcessEditOptions" runat="server">

        <dp:RRPanel ID="rrAdmin" runat="server" MinimumRole="Author">
            <ul class='ui-widget-content ui-corner-all'>
                <li class="btn"><span class="ui-icon ui-icon-clock"></span><a href="<%=PrettyTitle %>/Revisions">Revision history</a></li>
            </ul>

            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn"><span class="ui-icon ui-icon-pencil"></span><a href="<%=PrettyTitle %>/Edit">Edit</a></li>
            </ul>
            
            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn" id="freezeProcess"><span class="ui-icon ui-icon-pause"></span><a href="#">Freeze</a></li>
            </ul>

            <ul class='ui-widget-content ui-corner-all hidePhone'>
                <li class="btn" id="deleteProcess"><span class="ui-icon ui-icon-delete"></span><a href="#">Delete</a></li>
            </ul>
            
        </dp:RRPanel>    

    
    <asp:ObjectDataSource ID="odsTags" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetAssignedTags" TypeName="DevProcess.BusComp.Notes.Service.TagManager">
        <SelectParameters>
            <asp:Parameter Name="ForeignId" Type="Int32" />
            <asp:Parameter Name="ForeignType" Type="Int32" DefaultValue="144021" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ListView ID="lstItems" runat="server" ItemPlaceholderID="itemList" EnableViewState="False"
        DataSourceID="odsTags">
        <LayoutTemplate>
        <div class="ui-widget-content ui-corner-all">
            <h3><span class="ui-icon ui-icon-tag"></span>Tags</h3>
            <ul>
                <asp:PlaceHolder ID="itemList" runat="server" />
            </ul>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <li><a href='<%#String.Format("{1}/#{0}",Eval("TagName"),pd.R.GetReposRoot()) %>'>
                <%#Eval("TagName")%></a> </li>
        </ItemTemplate>
        <EmptyDataTemplate>
        </EmptyDataTemplate>
    </asp:ListView>
    
    </dp:ProcessLibPanel>

    <div style="display:none;">
    <dp:DateTextBox ID="dummy" runat="server" IsRequired="false" ValidationGroup="dummy" />
    </div>
    
    <div style='display:none;' class='assignTask ui-corner-all' id='assignTaskDlg'>
    <dp:JqTextBox runat="server" ID="txtSendTo" AddLineBreak="true" Columns="42" LabelText="Assign to"/>
    <ul id='selSendTo'></ul>
    <br class='clear' />
    <dp:JqTextBox runat="server" ID="txtComments" AddLineBreak="true" Columns="42" TextBoxMode="MultiLine" LabelText="Comments" Watermark="Enter notes on how this task is to to be performed." />
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnAssignTaskOk' value="Assign" class="ui-corner-all ui-state-default dpButton" style='display:none;' />
        <input type="button" id='btnAssignTaskCancel' 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='freezeProcessDlg'>
    <div class="hBlurb ui-state-highlight">
        By freezing a process you will prevent any further updates to this process being made available
        to project based process users.  All newly created projects and project upgrades will use this 
        version of the process.
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnFreezeProcess' value="Freeze" class="ui-corner-all ui-state-default dpButton"/>
        <input type="button" id='btnCancelFreeze' 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='deleteProcessDlg'>
    <div class="hBlurb ui-state-highlight">
        WARNING: You have selected to delete this process. By deleting a process you will prevent the process being available
        in the process library.  You should first check if this process is in use before deleting a process.
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnDeleteProcess' 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='upgradeProcessDlg'>
    <div class="hBlurb ui-state-highlight">
        By upgrading a process you will update the description definition and all associated data entry fields.  We will leave your tasks intact. 
        If you require the latest version of tasks you should manually update them using the edit tasks button.        
    </div>
    <p style="text-align:right;margin-right:10px;margin-top:5px;">
        <input type="button" id='btnUpgradeProcess' value="Upgrade" class="ui-corner-all ui-state-default dpButton"/>
        <input type="button" id='btnCancelUpgrade' 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='taskProgressDlg'>
        <div id="progressLoading" style="display:none;">
            <div class="hBlurb ui-state-highlight">
                Loading...
            </div>
        </div>
    
        <div id="progressNotStarted" style="display:none;">
            <div class="hBlurb ui-state-highlight">
                <dp:DateTextBox ID="dtEstimatedStart" runat="server" LabelText="Estimated start" UseGeneratedId="false" AddLineBreak="true"  />
                <dp:DateTextBox ID="dtEstimatedFinish" runat="server" LabelText="Estimated finish" UseGeneratedId="false" AddLineBreak="true" />
            </div>
            <p style="text-align:right;margin-right:10px;margin-top:5px;">
                <input type="button" id='btnUpdateStartVals' value="Update" class="ui-corner-all ui-state-default dpButton"/>
                <input type="button" id='btnStartProgress' value="Start task" class="ui-corner-all ui-state-default dpButton"/>
                <input type="button" id='btnCancelProgress' value="Cancel" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
            </p>
        </div>

        <div id="progressStarted" style="display:none;">
            <div class="hBlurb ui-state-highlight">
                <label for="tActualStart">Started:</label><span id="tActualStart"></span><br />
                <dp:DateTextBox ID="dtStartedEstimatedFinish" runat="server" LabelText="Estimated finish" UseGeneratedId="false" AddLineBreak="true" />
                <div><label for="progressAmount">Progress:</label> <span id="progressAmount">0</span>%</div>
                <div id="progressSlider"></div>
            </div>
            <p style="text-align:right;margin-right:10px;margin-top:5px;">
                <input type="button" id='btnUpdateStartedVals' value="Update" class="ui-corner-all ui-state-default dpButton"/>
                <input type="button" id='btnFinishProgress' value="Finished task" class="ui-corner-all ui-state-default dpButton"/>
                <input type="button" id='btnRollback1' value="Rollback" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
                <input type="button" id='btnCancelStartedProgress' value="Cancel" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
            </p>
        </div>

        <div id="progressFinished" style="display:none;">
            <div class="hBlurb ui-state-highlight">
                <label for="chSuccess">Completed successfully?</label><span class="dpCheckbox" ><input id="chSuccess" type="checkbox" /></span><br />
                <div id="exceptionReason">
                <dp:JqTextBox ID="txtException" runat="server" AddLineBreak="true" TextBoxMode="MultiLine" LabelText="Reason" Columns="40" />
                </div>
            </div>
            <p style="text-align:right;margin-right:10px;margin-top:5px;">
                <input type="button" id='btnSaveFinished' value="Save" class="ui-corner-all ui-state-default dpButton"/>
                <input type="button" id='btnCancelFinished' value="Cancel" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
            </p>    
        </div>

        <div id="progressFinishedStatus" style="display:none;">
            <div class="hBlurb ui-state-highlight">
                <label for="tFinishStatus">Completed:</label><span id="tFinishStatus" class="dpVal"></span><br />
                <div id="failedReason"></div>
                <label for="tActualStartFinished">Started:</label><span id="tActualStartFinished"></span><br />
                <label for="tActualEndFinished">Finished:</label><span id="tActualEndFinished"></span><br />
            </div>
            <p style="text-align:right;margin-right:10px;margin-top:5px;">
                <input type="button" id='btnRollback2' value="Rollback" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
                <input type="button" id='btnCancelFinishedStatus' value="Cancel" class="ui-corner-all ui-state-default ui-priority-secondary dpButton"/>
            </p>
        </div>

        <div id="progressSaving" style="display:none;">
            <div class="hBlurb ui-state-highlight">
                Saving...
            </div>
        </div>
    </div>


</asp:Content>
