<%@ page language="C#" autoeventwireup="true" inherits="ims.trans, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="trans">
<head runat="server">
    <title>事务中心</title><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s1" runat="server" EnablePageMethods="true" OnAsyncPostBackError="AsyncError">
        <CompositeScript Path="js/msajax.js" ScriptMode="Release">
            <Scripts>
                <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" /><asp:ScriptReference Name="MicrosoftAjax.js" /><asp:ScriptReference Name="MicrosoftAjaxWebForms.js" />
            </Scripts>
        </CompositeScript>
    </asp:ScriptManager>
    <div class="ui-tabs nobg noborder">
	    <ul>
		    <li><a href="#_flows" id="flows"><span runat="server" id="flowsText">我发起的事务</span><span class="hide"> - 查找结果</span></a></li>
		    <li><a href="#_tasks" id="pending"><span>待办事项</span><span class="hide"> - 查找结果</span></a></li>
		    <li><a href="#_tasks" id="finished"><span>已完成事项</span><span class="hide"> - 查找结果</span></a></li>
	    </ul>
        <div id="tags" runat="server" class="smallbtns mtop_n"></div>
        <asp:UpdatePanel ID="_flows" runat="server" OnPreRender="FlowsPreRender" RenderMode="Block" UpdateMode="conditional">
        <ContentTemplate>
            <div runat="server" id="myArea" visible="false">
                <table class="hr">
                    <tr><td style="width:32px"><a href="#" onclick="return sortBy('State');">状态</a></td><td> <a href="#" onclick="return sortBy('Subject');">主题</a></td><td style="width:8em" class="hide2">流程进度</td><td style="width:99px" class="hide1"><a href="#" onclick="return sortBy('BuildTime');">创建</a>/<a href="#" onclick="return sortBy('StartTime');">发起时间</a></td><td style="width:91px" class="hide1"><a href="#" onclick="return sortBy('EndTime');">计划完成时间</a></td><td style="width:76px" class="hide1">已用时</td><td style="width:74px">操作</td></tr>
                    <asp:PlaceHolder runat="server" ID="ph_my"></asp:PlaceHolder>
                </table>
            </div>
        </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="_tasks" runat="server" OnPreRender="TasksPreRender" RenderMode="Block" UpdateMode="conditional">
        <ContentTemplate>
            <div runat="server" id="taskArea" visible="false">
                <table class="hr">
                    <tr><td style="width:32px"><a href="#" onclick="return sortBy('State');">状态</a></td><td style="width:94px" class="hide2"><a href="#" onclick="return sortBy('FlowCreator');" title="点击排序">发起</a><span class="seper">/</span><a href="#" onclick="return sortBy('Handover');" title="点击排序">交办人</a></td><td><a href="#" onclick="return sortBy('Subject');" title="点击排序">主题</a></td><td class="hide1" style="width:5.2em">流程进度</td><td style="width:66px" class="hide1"><a href="#" onclick="return sortBy('StartTime');" title="点击排序">开始时间</a></td><td style="width:6.1em" class="hide1"><a href="#" onclick="return sortBy('EndTime');" title="点击排序">计划完成时间</a></td><td style="width:76px" class="hide2">已用时</td><td style="width:76px">完成情况</td></tr>
                    <asp:PlaceHolder runat="server" ID="ph"></asp:PlaceHolder>
                </table>
            </div>
        </ContentTemplate>
        </asp:UpdatePanel>       
    </div>
    <asp:UpdatePanel ID="upPager" runat="server" RenderMode="Block" UpdateMode="conditional">
    <ContentTemplate>
        <table runat="server" id="PagerBar" class="PagerBar">
            <tr><td class="nowrap">
                <asp:LinkButton ID="btnFirst" Text="首页" runat="server" ToolTip="快捷键：Home" AccessKey="F" OnClick="ChangePage" />
                <asp:LinkButton ID="btnPrevious" Text="上页" runat="server" ToolTip="快捷键：←或PageUp" AccessKey="P" OnClick="ChangePage" />
                <asp:Label ID="lblCount" CssClass="count" runat="server"></asp:Label>
                <asp:LinkButton ID="btnNext" Text="下页" runat="server" ToolTip="快捷键：→或PageDown" AccessKey="N" OnClick="ChangePage" />
                <asp:LinkButton ID="btnLast" Text="末页" runat="server" ToolTip="快捷键：End" AccessKey="L" OnClick="ChangePage" />
            </td><td class="right middle">
                <asp:DropDownList runat="server" id="ddlPagesize" AutoPostBack="True" OnSelectedIndexChanged="PageSizeChanged">
                    <asp:ListItem Value="5">5项/页</asp:ListItem>
                    <asp:ListItem Value="10">10项/页</asp:ListItem>
                    <asp:ListItem Value="15" Selected="True">15项/页</asp:ListItem>
                    <asp:ListItem Value="20">20项/页</asp:ListItem>
                    <asp:ListItem Value="30">30项/页</asp:ListItem>
                    <asp:ListItem Value="50">50项/页</asp:ListItem>
                    <asp:ListItem Value="100">100项/页</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddlPager" AutoPostBack="true" OnSelectedIndexChanged="ChangePage" runat="server"></asp:DropDownList>
            </td></tr>
        </table>
    </ContentTemplate>
    </asp:UpdatePanel>
    <div class="footBtnArea">
        <input type="button" id="btnFind" runat="server" value="查找" class="btn" onclick="toFind();" />
        <input type="button" id="addFlow" runat="server" value="发起流程" onclick="location='select.aspx?action=AddFlow';" class="btn" />
        <input type="button" id="viewOther" runat="server" value="他人事务" onclick="toView();" class="btn" />
        <button type="button" id="btnPlan" runat="server" onclick="showPlan();" class="btn">计划任务</button>
    </div>
    <ims:Pop runat="server" ID="toView" OnOkClick="ViewUserTrans" HideOnOkClientClick="false" Title="查看他人事务">
        <ContentTemplate>
            <div class="padbox notfocus">
                用户： <asp:RadioButton runat="server" ID="rbAll" Text="所有可查看的用户" Checked="true" GroupName="userRange" /> <asp:RadioButton runat="server" ID="rbOne" Text="" GroupName="userRange" /><input type="text" runat="server" placeholder="指定用户" acfid="UserName" chars=";；、,，" onfocus="$('#toView_rbOne').prop('checked',true);" ondblclick="showUserTree(this.id);" id="tbUser" title="输入或选择用户名，双击弹出选择窗口" />
                <div class="sepline2"></div>
                事务： <asp:RadioButtonList runat="server" ID="rblTypes" RepeatLayout="Flow" RepeatDirection="Horizontal">
                    <asp:ListItem Value="flows">其发起的事务</asp:ListItem>
                    <asp:ListItem Value="pending" Selected="True">待办事项</asp:ListItem>
                    <asp:ListItem Value="finished">已完成事项</asp:ListItem>
                </asp:RadioButtonList>
            </div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="findFlows" OnOkClick="FindFlows" HideOnOkClientClick="false" Title="查找">
        <ContentTemplate>
            <ul class="conds">
                <li><asp:CheckBox runat="server" ID="cbType" Text="流程类型：" /><asp:DropDownList runat="server" ID="ddlType" style="max-width:210px" onchange="typeChanged(this);"></asp:DropDownList>， <asp:CheckBox runat="server" ID="cbCond" Text="" /><a href="javascript:void(0);" onclick="return ShowFilter('FlowFilter');">筛选条件</a></li>
                <li><asp:CheckBox runat="server" ID="cbState" Text="事务状态：" /><asp:DropDownList runat="server" ID="ddlState">
                <asp:ListItem Value="Running">进行中</asp:ListItem>
                <asp:ListItem Value="Finished">已完成</asp:ListItem>
                <asp:ListItem Value="Paused">已暂停</asp:ListItem>
                <asp:ListItem Value="Veto">已否决</asp:ListItem>
                <asp:ListItem Value="Draft">未提交</asp:ListItem>
            </asp:DropDownList></li>
                <li><asp:CheckBox runat="server" ID="cbExceed" Text="是否超期：" /><asp:RadioButtonList runat="server" ID="rblExceed" RepeatLayout="Flow" RepeatDirection="Horizontal">
                <asp:ListItem Value="True">是</asp:ListItem>
                <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
            </asp:RadioButtonList></li>
                <li><asp:CheckBox runat="server" ID="cbSubject" Text="主题包含：" /><asp:TextBox runat="server" ID="tbSubject" CssClass="tb"></asp:TextBox></li>
                <li class="times"><span id="ph1"><asp:CheckBox runat="server" ID="cbTime" /><asp:DropDownList runat="server" ID="ddlTime">
                    <asp:ListItem Value="StartTime">发起时间</asp:ListItem>
                    <asp:ListItem Value="EndTime">计划完成时间</asp:ListItem>
                    <asp:ListItem Value="FinishTime">实际完成时间</asp:ListItem>
                </asp:DropDownList>： </span><asp:RadioButton runat="server" ID="rbInput" Checked="true" GroupName="time" /><asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:function(){$(this).next('.tbTime').focus();}});" ID="tbTime1"></asp:TextBox>～<asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'});" ID="tbTime2"></asp:TextBox><br />
            <asp:RadioButton runat="server" ID="rbSelect" GroupName="time" /><asp:DropDownList runat="server" ID="ddly"></asp:DropDownList>
                    <asp:DropDownList runat="server" ID="ddlm"></asp:DropDownList>
                    <asp:DropDownList runat="server" ID="ddld"></asp:DropDownList>
                </li>
            </ul>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="findTasks" OnOkClick="FindTasks" HideOnOkClientClick="false" Title="查找">
        <ContentTemplate>
            <ul class="conds">
                <li><asp:CheckBox runat="server" ID="cbType_Tasks" Text="流程类型：" /><asp:DropDownList runat="server" ID="ddlType_Tasks" style="max-width:210px" onchange="typeChanged(this);"></asp:DropDownList>， <asp:CheckBox runat="server" ID="cbCond_Tasks" Text="" /><a href="javascript:void(0);" onclick="return ShowFilter('TaskFilter');">筛选条件</a></li>
                <li id="liState_Tasks"><asp:CheckBox runat="server" ID="cbState_Tasks" Text="任务状态：" /><asp:DropDownList runat="server" ID="ddlState_Tasks">
                <asp:ListItem Value="Completed">完成</asp:ListItem>
                <asp:ListItem Value="Passed">通过</asp:ListItem>
                <asp:ListItem Value="Rejected">拒绝</asp:ListItem>
                <asp:ListItem Value="Received">进行中</asp:ListItem>
                <asp:ListItem Value="Abort">中止</asp:ListItem>
            </asp:DropDownList></li>
                <li><asp:CheckBox runat="server" ID="cbExceed_Tasks" Text="是否超期：" /><asp:RadioButtonList runat="server" ID="rblExceed_Tasks" RepeatLayout="Flow" RepeatDirection="Horizontal">
                <asp:ListItem Value="True">是</asp:ListItem>
                <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
            </asp:RadioButtonList></li>
                <li><asp:CheckBox runat="server" ID="cbSubject_Tasks" Text="主题包含：" /><asp:TextBox runat="server" CssClass="tb" ID="tbSubject_Tasks"></asp:TextBox></li>
                <li class="times"><span id="ph2"><asp:CheckBox runat="server" ID="cbTime_Tasks" /><asp:DropDownList runat="server" ID="ddlTime_Tasks">
                    <asp:ListItem Value="StartTime">开始时间</asp:ListItem>
                    <asp:ListItem Value="EndTime">计划完成时间</asp:ListItem>
                    <asp:ListItem Value="FinishTime">实际完成时间</asp:ListItem>
                </asp:DropDownList>： </span><asp:RadioButton runat="server" ID="rbInput_Tasks" Checked="true" GroupName="time_tasks" /><asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:function(){$(this).next('.tbTime').focus();}});" ID="tbTime1_Tasks"></asp:TextBox>～<asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'});" ID="tbTime2_Tasks"></asp:TextBox><br />
            <asp:RadioButton runat="server" ID="rbSelect_Tasks" GroupName="time_tasks" /><asp:DropDownList runat="server" ID="ddly_Tasks"></asp:DropDownList>
                    <asp:DropDownList runat="server" ID="ddlm_Tasks"></asp:DropDownList>
                    <asp:DropDownList runat="server" ID="ddld_Tasks"></asp:DropDownList>
                </li>
            <li><asp:CheckBox runat="server" ID="cbUsers" /><asp:DropDownList runat="server" ID="ddlUsers">
                    <asp:ListItem Value="Creator">流程发起人</asp:ListItem>
                    <asp:ListItem Value="Handover">任务交办人</asp:ListItem>
                    <asp:ListItem Value="FlowParticipant">流程参与者</asp:ListItem>
                    <asp:ListItem Value="TaskParticipant">任务参与者</asp:ListItem>
                </asp:DropDownList>：<asp:TextBox runat="server" CssClass="tb" ID="tbUsers" acfid="UserName" chars=";；、,，" ondblclick="showUserTree(this.id);" ToolTip="双击弹出用户选择窗口。多项之间以逗号、分号或顿号分隔"></asp:TextBox></li>
            </ul>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="steps" OnClientUpdated="bindCollapse();" Title="事务进度" ShowOkButton="false" CanelButtonText="关闭" Width="450">
        <ContentTemplate>
            <dl runat="server" id="dlSteps"></dl>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="step" ShowOkButton="false" OnClientUpdated="processOpn('#step_ulExers');" CanelButtonText="关闭" Width="420">
        <ContentTemplate>
            <fieldset class="mbottom_s"><legend>任务概况</legend>
                <ul runat="server" id="ulOv"></ul>
            </fieldset>
            <fieldset class="mtop_m"><legend>处理情况<span runat="server" id="findDiv">： <input type="text" onchange="findExer();" id="tbExerName" acfid="Exer" title="输入执行人查询其执行结果" /> <image src="images/find.png" id="find" /></span></legend>
                <asp:UpdatePanel ID="upExers" runat="server" UpdateMode="conditional">
                <ContentTemplate>               
                    <ul runat="server" id="ulExers"></ul>
                    <div runat="server" id="noExer" class="padcenter gray">无</div>
                </ContentTemplate>
                </asp:UpdatePanel>
            </fieldset>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="zb" Title="转办" Width="400" HideOnOkClientClick="false" HelpSubject="transfer" OnOkClick="TaskTransfer" OnClientUpdated="InitTransfer();">
        <ContentTemplate>
            步骤：　<asp:DropDownList runat="server" ID="ddlNodes"></asp:DropDownList>
            <div class="mtop_s mbottom_s">
                处理人：<asp:TextBox runat="server" placeholder="输入原处理人，可留空，或用*表示全部" ID="tbSrc" acfid="UserName" chars=";；、,，" ondblclick="showUserTree(this.id);"></asp:TextBox>
            </div>
            转办：　<asp:TextBox runat="server" ID="tbTo" placeholder="输入转办目标用户，可留空" acfid="UserName" chars=";；、,，" ondblclick="showUserTree(this.id);"></asp:TextBox>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="jhs" Title="计划任务" Width="450" ShowOkButton="false" OnClientUpdated="jhInit();" HelpSubject="plan" CanelButtonText="关闭">
        <ContentTemplate>
            <div class="lightarea notfocus">
                添加计划：<asp:TextBox runat="server" ID="tbFlow" acfid="MyFlow" placeholder="输入流程主题" ToolTip="输入(本人发起的)流程主题"></asp:TextBox> <asp:Button runat="server" ID="addPlan" OnClick="AddPlan" Text="添加" OnClientClick="return preAddPlan();" CssClass="btn small sec" />
            </div>
            <table class="mtop_n hr seprow rowhover">
                <tbody runat="server" id="ps" class="uninited">
                    <tr><td style="width:4em" runat="server" id="tdBuilder">创建人</td><td>流程主题</td><td style="width:3.5em">已执行</td><td style="width:3em">操作</td></tr>
                    <asp:PlaceHolder runat="server" ID="phPlans"></asp:PlaceHolder>
                </tbody>
            </table>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="jh" Width="450" OnOkClick="SavePlan" HideOnOkClientClick="false">
        <ContentTemplate>
            <div class="mtop_n notfocus">
                <span class="bold">计划：</span>从 <asp:TextBox runat="server" ID="tbStart" Width="110" onfocus="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm'});"></asp:TextBox> 起，每 <asp:TextBox runat="server" ID="tbFqcy" Width="24"></asp:TextBox> <asp:DropDownList runat="server" ID="ddlTimeUnit"></asp:DropDownList> 自动重发一次<br />
                <div class="sepline"></div>
                <div class="middle"><asp:CheckBox runat="server" ID="cbMax" Text="最多执行" /><asp:TextBox runat="server" ID="tbTimes" Width="30"></asp:TextBox><span> 次</span></div>
            </div>
        </ContentTemplate>
    </ims:Pop>
    <asp:Button runat="server" ID="btnOpera" OnClick="ExeOpera" CssClass="hide" />
    <script src="js/comm.js"></script><script src="js/trans.js"></script>
    </form>
</body>
</html>