<%@ page language="C#" autoeventwireup="true" inherits="ims.web.trans, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="trans">
<head runat="server">
    <title>事务中心</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s1" runat="server">
        <Scripts><asp:ScriptReference Name="MicrosoftAjax.js" ScriptMode="Auto" Path="~/js/MsAjax.js"/><asp:ScriptReference Name="MicrosoftAjaxWebForms.js" ScriptMode="Auto" Path="~/js/MsAjax.js"/></Scripts>
    </asp:ScriptManager>
    <div class="ui-tabs 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>
        <asp:UpdatePanel ID="_flows" runat="server" OnPreRender="FlowsPreRender" RenderMode="Block" UpdateMode="conditional">
        <ContentTemplate>
            <div runat="server" id="myArea" visible="false">
                <table class="normal hr" cellspacing="1">
                    <tr class="headRow" title="点击列标题链接排序，再次点击反向排序"><td style="width:24px"><a href="#" onclick="return sortBy('State');">状态</a></td><td> <a href="#" onclick="return sortBy('Subject');">事务主题</a></td><td style="width:200px">当前进度</td><td style="width:92px"><a href="#" onclick="return sortBy('BuildTime');">创建</a>／<a href="#" onclick="return sortBy('StartTime');">发起时间</a></td><td style="width:80px"><a href="#" onclick="return sortBy('EndTime');">计划完成时间</a></td><td style="width:82px">操作</td></tr>
                    <asp:PlaceHolder runat="server" ID="ph_my"></asp:PlaceHolder>
                </table>
            </div>
            <div runat="server" id="msg_my" class="nodata">无</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" cellspacing="0">
                    <tr class="headRow"><td style="width:24px"><a href="#" onclick="return sortBy('State');">状态</a></td><td><a href="#" onclick="return sortBy('Subject');">主题</a></td><td style="width:72px"><a href="#" onclick="return sortBy('StartTime');">开始时间</a></td><td style="width:80px"><a href="#" onclick="return sortBy('EndTime');">计划完成时间</a></td><td style="width:52px"><a href="#" onclick="return sortBy('Handover');">交办人</a></td><td style="width:50px">操作</td></tr>
                    <asp:PlaceHolder runat="server" ID="ph"></asp:PlaceHolder>
                </table>
            </div>
            <div runat="server" id="msg" class="nodata">无</div>
        </ContentTemplate>
        </asp:UpdatePanel>       
    </div>

    <asp:UpdatePanel ID="upPager" runat="server" RenderMode="Block" UpdateMode="conditional">
    <ContentTemplate>
        <table runat="server" id="PagerBar" class="PagerBar" cellspacing="0">
            <tr><td>
                <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 align="right">
                <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:ListItem Value="500">500项/页</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddlPager" AutoPostBack="true" OnSelectedIndexChanged="ChangePage" runat="server"></asp:DropDownList>
            </td></tr>
        </table>
    </ContentTemplate>
    </asp:UpdatePanel>

    <div class="mtop_x mbottom_l center">
        <input type="button" id="btnFind" 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" />
    </div>
    <ims:Pop runat="server" ID="toView" OnOkClick="ViewUserTrans" HideOnOkClientClick="false" Title="查看他人事务" ShowProgress="false">
        <ContentTemplate>
            <div class="padbox">
                用户： <input type="text" runat="server" acfid="UserName" 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="查找" ShowProgress="false">
        <ContentTemplate>
            <ul class="conds">
                <li runat="server" id="liType"><asp:CheckBox runat="server" ID="cbType" Text="流程类型：" /><asp:DropDownList runat="server" ID="ddlType"></asp:DropDownList></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"><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>： <asp:RadioButton runat="server" ID="rbInput" Checked="true" GroupName="time" /><asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:function(){$(this).next('.tbTime').focus();}});" ID="tbTime1"></asp:TextBox>～<asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({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="查找" ShowProgress="false">
        <ContentTemplate>
            <ul class="conds">
                <li runat="server" id="liType_Tasks"><asp:CheckBox runat="server" ID="cbType_Tasks" Text="流程类型：" /><asp:DropDownList runat="server" ID="ddlType_Tasks"></asp:DropDownList></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: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"><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>： <asp:RadioButton runat="server" ID="rbInput_Tasks" Checked="true" GroupName="time_tasks" /><asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:function(){$(this).next('.tbTime').focus();}});" ID="tbTime1_Tasks"></asp:TextBox>～<asp:TextBox runat="server" CssClass="tbTime" onfocus="WdatePicker({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" ShowProgress="false">
        <ContentTemplate>
            <dl runat="server" id="dlSteps"></dl>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="step" ShowOkButton="false" CanelButtonText="关闭" Width="420" CustomCss="noline" ShowProgress="false">
        <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/find2.gif" 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>
    <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>