<%@ page language="C#" autoeventwireup="true" inherits="ims.web.edit, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<%@ Register Src="~/UserControls/FileUploader.ascx" TagName="Uploader" TagPrefix="ims" %>
<!DOCTYPE html>
<html id="edit">
<head runat="server"><title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <script src="js/comm.js"></script><script src="js/edit.js"></script>
</head>
<body class="waiting" onbeforeunload="confirmExit();">
    <div class="hide"><img src="images/loading.gif" />处理中，请稍候 …</div>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="sm" runat="server" AsyncPostBackTimeout="600" EnablePageMethods="true" OnAsyncPostBackError="AsyncError" />
        <asp:ValidationSummary ID="ValSum" runat="server" ShowMessageBox="True" ShowSummary="False" />
        <table class="mbottom_s"><tr><td runat="server" id="pageTitle"></td><td id="tools" runat="server">
            <a href="#" onclick="return false;" id="batchImport">批量导入</a><asp:LinkButton runat="server" ID="xlsHeader" CausesValidation="false" OnClick="MakeExcelTemplet"
            ToolTip="下载Excel表单以批量录入可供导入的数据" Text="下载Excel表单"></asp:LinkButton><asp:LinkButton runat="server"
            ID="lbFill" CausesValidation="false" OnClick="ShowSelectPop" OnClientClick="curAcTextbox='';" ToolTip="选择已有的记录来填充当前表单" Text="导入"></asp:LinkButton>
            <div id="upload"><input id="xlsToUpload" type="file" contenteditable="false" title="从Excel文件批量导入数据" onchange="return toImport();" name="xlsToUpload" /></div>
        </td></tr></table>
        <asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="false" OnPreRender="InitEditArea" RenderMode="Block" UpdateMode="conditional">
        <ContentTemplate>
        <div runat="server" id="editZone" visible="false"></div>
        <div id="editArea" runat="server"></div>
        <div id="fixedArea" runat="server">
            <table class="r">
	            <tr>
		            <td class="h middle"><img src="images/lock.gif" />保密级别</td>
		            <td class="e"><asp:DropDownList ID="ddlSecLevel" runat="server"></asp:DropDownList> <asp:ImageButton runat="server" ID="defSecLevel" ImageUrl="images/default.gif" CausesValidation="false" OnClick="SetDefault" ToolTip="将当前保密级别设为默认" /></td>
	            </tr>
            </table>
            <table class="r middle" runat="server" id="rDir">
	            <tr>
		            <td class="h"><img src="images/off.gif" />保存目录</td>
		            <td class="e">
	                    <asp:UpdatePanel ID="upDir" runat="server" RenderMode="Inline" UpdateMode="conditional">
                            <ContentTemplate><a id="aDir" runat="server" href="#" title="点击选择目录" CausesValidation="false" onclick="return showDirTree(true);" onserverclick="DirChanged"></a> <asp:ImageButton runat="server" ID="defDir" CausesValidation="false" ImageUrl="images/default.gif" OnClick="SetDefault" ToolTip="将当前指定的保存目录设为默认" /></ContentTemplate>
                            <Triggers><asp:AsyncPostBackTrigger ControlID="defSecLevel" EventName="Click" /></Triggers>
                        </asp:UpdatePanel>
                    </td>
	            </tr>
            </table>
        </div>
        <div id="subs" runat="server" class="mtop_l" visible="false"></div>
        <div runat="server" id="wfArea" visible="false">
        <div runat="server" id="divMent" visible="false"></div>
        <table class="r" runat="server" id="subject">
	        <tr>
		        <td class="h middle"><img src="images/subject.png" /> 主题<span class="required">*</span></td>
		        <td class="e middle"><asp:TextBox runat="server" ID="tbSubject"></asp:TextBox> <img src="images/clear.gif" onclick="$('#tbSubject').val('').focus();" title="清除主题" class="pointer" /></td>
	        </tr>
        </table>
        <table class="r" runat="server" id="endTime">
	        <tr>
		        <td class="h middle"><img src="images/datetime.gif" /> 计划完成时间</td>
		        <td class="e"><asp:TextBox runat="server" ID="tbEndTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});"></asp:TextBox></td>
	        </tr>
        </table>
        <table class="r" runat="server" id="idenArea" visible="false">
	        <tr>
		        <td class="h middle"><img src="images/users.gif" /> 我的身份</td>
		        <td class="e"><asp:RadioButtonList runat="server" ID="rblIdens" RepeatLayout="Flow" RepeatDirection="Horizontal"></asp:RadioButtonList></td>
	        </tr>
        </table>
	<asp:UpdatePanel ID="upNext" runat="server" RenderMode="Block" UpdateMode="conditional">
        <ContentTemplate>
            <table class="r" runat="server" id="nextArea" visible="false">
	            <tr>
		            <td class="h middle"><img src="images/next.gif" />下一步<span class="required">*</span></td>
		            <td class="e"><asp:RadioButtonList runat="server" ID="rblNext" RepeatLayout="Flow" RepeatDirection="Horizontal"></asp:RadioButtonList><asp:CheckBoxList runat="server" ID="cblNext" RepeatLayout="Flow" RepeatDirection="Horizontal"></asp:CheckBoxList></td>
	            </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
        </div>
        <asp:PlaceHolder ID="phHelpers" runat="server"></asp:PlaceHolder>
        </ContentTemplate>
        </asp:UpdatePanel>
        <table><tr><td>
            <div id="divAction" runat="server">
                保存后的动作：<asp:RadioButtonList ID="rblAction" RepeatLayout="Flow" RepeatDirection="Horizontal" runat="server">
                    <asp:ListItem Value="None" Selected="True">无</asp:ListItem>
                    <asp:ListItem Value="New">新建</asp:ListItem>
                    <asp:ListItem Value="Back">返回</asp:ListItem>
                    <asp:ListItem Value="Browse">浏览</asp:ListItem>
                </asp:RadioButtonList>
            </div>
        </td><td id="showAttr" runat="server">
            <span onclick="toggleAttrs();" class="hid" runat="server" id="toggler">隐藏属性字段</span>
        </td></tr></table>
        <table class="mtop_l"><tr><td class="vbottom middle">
            <asp:HyperLink runat="server" ID="prev" ToolTip="编辑上一条记录" Visible="false"></asp:HyperLink>
        </td><td class="center bigger">
            <asp:UpdatePanel ID="upBtns" runat="server" RenderMode="Block" UpdateMode="conditional">
            <ContentTemplate>
            <asp:Button ID="btnSubmit" Visible="false" CausesValidation="false" runat="server" OnClientClick="return doValidate();" Text="提交" OnClick="Save" CssClass="btn big" />
            <asp:Button ID="save" CausesValidation="false" runat="server" OnClientClick="return doValidate();" Text="保存" OnClick="Save" CssClass="btn big" />
            <asp:Button ID="saveas" CausesValidation="false" runat="server" OnClientClick="return doValidate();" Text="另存" ToolTip="将当前编辑的记录另存为一条新的记录" OnClick="Save" CssClass="btn" />
            <input type="button" runat="server" id="btnLayout" title="切换版式" value="版式" onclick="return showLayouts();" class="btn" />
            <asp:Button ID="toNew" runat="server" CausesValidation="false" OnClientClick="return toExit();" ToolTip="新建一条记录" Text="新建" OnClick="New" CssClass="btn" />
            <input type="button" onclick="MarkAndBack();" value="返回" class="btn" />
            </ContentTemplate>
            </asp:UpdatePanel>
            <asp:Button runat="server" ID="btnAdvac" OnClick="ShowAdvAc" CausesValidation="false" CssClass="hide" />
        </td><td class="right vbottom middle">
            <asp:HyperLink runat="server" ID="next" ToolTip="编辑下一条记录" Visible="false"></asp:HyperLink>
        </td></tr></table>
        <ims:Pop runat="server" ID="ff" OnOkClientClick="return resultSelected();" OnClientUpdated="showDetail();" OnOkClick="FillSimilar" HideOnOkClientClick="false" Width="464" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>            
            <fieldset runat="server" id="conditions">
                <legend>筛选： <asp:DropDownList runat="server" ID="ddlTemplets" Enabled="false" AutoPostBack="true" OnSelectedIndexChanged="ddlTempletsChanged"></asp:DropDownList> <asp:DropDownList runat="server" ID="srcFields" AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList"></asp:DropDownList></legend>
                <div class="padbox" title="设置筛选条件">
                    <div class="liSquare"><asp:DropDownList runat="server" ID="ddlFields1" AutoPostBack="true" OnSelectedIndexChanged="ddlFieldsChanged" /> <asp:Literal runat="server" ID="l1" /><asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList" runat="server" ID="ddl1" /><asp:RadioButtonList AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList" runat="server" ID="rbl1" RepeatLayout="Flow" RepeatDirection="Horizontal"><asp:ListItem Value="true" Selected="True">是</asp:ListItem><asp:ListItem Value="false">否</asp:ListItem></asp:RadioButtonList><asp:TextBox runat="server" Width="108" ID="tb1_1" AutoPostBack="true" OnTextChanged="GenerateValuesList" /><span runat="server" id="span1">～<asp:TextBox runat="server" ID="tb2_1" Width="108" CssClass="tb" AutoPostBack="true" OnTextChanged="GenerateValuesList" /></span> <asp:ImageButton runat="server" ID="ibAddCond1" ImageUrl="images/add.png" ToolTip="添加条件" CommandArgument="cond2" OnClick="AddCond" CausesValidation="false" /></div>
                    <div id="cond2" class="liSquare" runat="server" visible="false">
                        <asp:DropDownList runat="server" ID="ddlFields2" AutoPostBack="true" OnSelectedIndexChanged="ddlFieldsChanged" /> <asp:Literal runat="server" ID="l2" /><asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList" runat="server" ID="ddl2" /><asp:RadioButtonList AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList" runat="server" ID="rbl2" RepeatLayout="Flow" RepeatDirection="Horizontal"><asp:ListItem Value="true" Selected="True">是</asp:ListItem><asp:ListItem Value="false">否</asp:ListItem></asp:RadioButtonList><asp:TextBox runat="server" Width="108" ID="tb1_2" AutoPostBack="true" OnTextChanged="GenerateValuesList" /><span runat="server" id="span2">～<asp:TextBox runat="server" ID="tb2_2" Width="108" CssClass="tb" AutoPostBack="true" OnTextChanged="GenerateValuesList" /></span> <asp:ImageButton runat="server" ID="ibAddCond2" ImageUrl="images/add.png" ToolTip="添加条件" CommandArgument="cond3" OnClick="AddCond" CausesValidation="false" />
                    </div>
                    <div id="cond3" class="liSquare" runat="server" visible="false">
                        <asp:DropDownList runat="server" ID="ddlFields3" AutoPostBack="true" OnSelectedIndexChanged="ddlFieldsChanged" /> <asp:Literal runat="server" ID="l3" /><asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList" runat="server" ID="ddl3" /><asp:RadioButtonList AutoPostBack="true" OnSelectedIndexChanged="GenerateValuesList" runat="server" ID="rbl3" RepeatLayout="Flow" RepeatDirection="Horizontal"><asp:ListItem Value="true" Selected="True">是</asp:ListItem><asp:ListItem Value="false">否</asp:ListItem></asp:RadioButtonList><asp:TextBox runat="server" Width="108" ID="tb1_3" AutoPostBack="true" OnTextChanged="GenerateValuesList" /><span runat="server" id="span3">～<asp:TextBox runat="server" ID="tb2_3" Width="108" CssClass="tb" AutoPostBack="true" OnTextChanged="GenerateValuesList" /></span>
                    </div>
                </div>
            </fieldset>
            <asp:ListBox runat="server" ID="values" Rows="10"></asp:ListBox>
            <fieldset id="info"><legend>详细</legend>
                <div></div>
            </fieldset>
        </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="au" Title="指定处理者/处理时限" Visible="false" OnClientUpdated="assignShown();" OnClientCanel="$('#upBtns').removeClass('hidden');" Width="555" HideOnOkClientClick="false" OnOkClientClick="return preSave();" OnOkClick="SubmitFlow" ShowProgress="false">
            <ContentTemplate>
                <fieldset runat="server" id="exersArea"><legend><asp:DropDownList runat="server" ID="ddlNodes" onfocus="return SaveExecutor();" onchange="initExecutor();"></asp:DropDownList> 处理者：</legend>
                    <div id="modeFull" class="padbox">
                        <input type="checkbox" id="cbUser" /><label for="cbUser">用户：</label><asp:TextBox runat="server" id="tbUsers" acfid="UserName" chars=";；,，、" ondblclick="showUserTree(this.id);" ToolTip="双击弹出用户选择窗口。多项之间以逗号、分号或顿号分隔" /><br />
                        <input type="checkbox" id="cbRole" /><label for="cbRole">角色：</label><asp:TextBox runat="server" id="tbRoles" acfid="RoleName" chars=";；,，、" ToolTip="多项之间以逗号、分号或顿号分隔" /><br />
                        <input type="checkbox" id="cbUnit" /><label for="cbUnit">机构：</label><asp:TextBox runat="server" id="tbUnits" acfid="UnitNameWithID" chars=";；,，、" ondblclick="showUserTree(this.id,true);" ToolTip="双击弹出机构选择窗口。多项之间以逗号、分号或顿号分隔" /> <input type="checkbox" id="cbRector" value="1" checked="checked" /><label for="cbRector">负责人</label> <input type="checkbox" id="cbDirectly" value="2" /><label for="cbDirectly">直属成员</label> <input type="checkbox" id="cbIndirect" value="4" /><label for="cbIndirect">非直属成员</label><br />
                        <div id="related">
                            <input type="checkbox" id="cbRel" /><select id="ddlRel"><option value="1">交办人的</option><option value="2">发起人的</option></select>： <input type="checkbox" id="cbSelf" value="1" /><label for="cbSelf">本人</label> <input type="checkbox" id="cbLateral" value="2" /><label for="cbLateral">平级</label> <input type="checkbox" id="cbSuperior" value="4" /><label for="cbSuperior">上级</label> <input type="checkbox" id="cbDirectUnderling" value="8" /><label for="cbDirectUnderling">直接下级</label> <input type="checkbox" id="cbUnderling" value="16" /><label for="cbUnderling">所有下级</label>
                            <span runat="server" id="spanLevels"><br /><span class="hidden"><input type="checkbox" /><select><option>交办人的</option></select>： </span><input type="checkbox" id="cbLevel" value="32" /><asp:DropDownList runat="server" ID="ddlLevels"></asp:DropDownList><span class="subItems">的： <input type="checkbox" id="cbLevelRector" value="1" checked="checked" class="levelMember" /><label for="cbLevelRector">负责人</label> <input type="checkbox" class="levelMember" id="cbLevelDirectly" value="2" /><label for="cbLevelDirectly">直属成员</label></span></span>
                            <img src="images/what.gif" title="相关说明" onclick="What('Colleague')" class="what" />
                        </div>
                        <div id="exclude" class="box mtop_s"><b>排除：</b><span class="inner"><input type="checkbox" id="cbHandover" value="1" /><label for="cbHandover">交办人</label><input type="checkbox" id="cbStarter" value="2" /><label for="cbStarter">发起人</label></span><input type="checkbox" id="cbFixed" value="4" /><label for="cbFixed">指定用户：</label><asp:TextBox runat="server" id="tbNoUsers" acfid="UserName" ToolTip="双击弹出用户选择窗口。多项之间以逗号、分号或顿号分隔" chars=";；,，、" ondblclick="showUserTree(this.id);" /></div>
                    </div>
                    <div id="inUsers" class="hide">用户：<input type="text" id="tbInUsers" title="可输入多个用户，以逗号、分号或顿号分隔" /></div>
                </fieldset>
                <fieldset runat="server" id="timeArea" class="mtop_m"><legend>处理时限</legend>
                    <ul runat="server" id="ulTime"></ul>
                </fieldset>
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="importMode" ShowCancelButton="false" ShowOkButton="false" Title="导入Excel - 操作模式" Width="280" ShowProgress="false">
            <ContentTemplate>
                <div class="center mtop_l">
                    <input type="button" value="导入数据" title="将Excel中的数据追加进来" class="btn" onclick="xlsUpload(false); HideDialog();" />
                    <input type="button" value="更新数据" title="用Excel中的数据更新现有记录（根据ID匹配）" class="btn" onclick="xlsUpload(true); HideDialog();" />
                    <input type="button" value="取消" class="btn" onclick="HideDialog();" />
                </div>
            </ContentTemplate>
        </ims:Pop>
        <div class="menu" runat="server" id="layouts"></div>
    </form>
</body>
</html>