<%@ page language="C#" autoeventwireup="true" inherits="ims.web.templets, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<%@ Register Src="~/UserControls/FileUploader.ascx" TagName="Uploader" TagPrefix="ims" %>
<!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="templets">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s1" runat="server" EnablePageMethods="true" AsyncPostBackTimeout="900">
        <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>
    <asp:UpdatePanel ID="upDirs" runat="server" ChildrenAsTriggers="false" OnPreRender="AttMouseEvent" UpdateMode="conditional" RenderMode="Block" />
    <asp:UpdatePanel ID="objsDiv" runat="server" EnableViewState="false" ChildrenAsTriggers="false" OnPreRender="AttMouseEvent" UpdateMode="conditional" RenderMode="Block" />
    <asp:HiddenField ID="curFolderId" runat="server" />
    <asp:HiddenField ID="curTempletId" runat="server" />
    <asp:HiddenField ID="selectedTids" runat="server" />
    <asp:HiddenField ID="pasteSource" runat="server" />
    <div class="menu" id="objMenu">
        <a href="#" runat="server" onserverclick="ShowData" id="Open">打开</a>
        <a accesskey="A" href="#" runat="server" id="appendData" onclick="toAddData()">添加　　　 Alt+A</a>
        <a accesskey="S" href="#" runat="server" id="Search" onclick="return Search();">搜索 　　　Alt+S</a>
        <a accesskey="D" href="#" onclick="return design()" runat="server" id="design">设计 　　　Alt+D</a>
        <a accesskey="E" href="#" runat="server" id="export" onserverclick="ExportTemplet">导出　　　 Alt+E</a>
        <div></div>
        <a accesskey="T" href="#" onclick="return setSource()" runat="server" id="cut">剪切　　　 Alt+T</a>
        <a accesskey="C" href="#" onclick="return setSource()" runat="server" id="copy">复制　　　 Alt+C</a>
        <a accesskey="X" href="#" onclick="return del()" runat="server" id="del">删除 　　　Alt+X</a>
        <a accesskey="N" href="#" onclick="return rename()" runat="server" id="rename">重命名　　 Alt+N</a>
        <a accesskey="B" href="#" id="fastFilter" runat="server" onserverclick="ShowFastFilter">筛选　　　 Alt+B</a>
        <a accesskey="F" href="#" id="filtersAdmin" runat="server">过滤器　　 Alt+F</a>
        <a href="#" id="shortcut" runat="server" onserverclick="AddShortcut" onclick="shortcutAdded()">添加快捷方式</a>
        <div></div>
        <a accesskey="M" href="#" runat="server" id="dataManage" onserverclick="ShowDataManage">数据管理　 Alt+M</a>
        <a accesskey="P" href="#" runat="server" onserverclick="ShowPower" id="showPower">权限 　　　Alt+P</a>
        <a accesskey="R" href="#" runat="server" onserverclick="ShowAttributes" id="showAttributes">属性 　　　Alt+R</a>
    </div>
    <div class="menu" runat="server" id="folderMenu">
        <a accesskey="O" href="#" onclick="return openFolder()">打开 　　　Alt+O</a>
        <a accesskey="C" href="#" onclick="return setSource()" runat="server" id="cutFolder">剪切　　　 Alt+C</a>
        <a accesskey="D" href="#" onclick="return confirm('确定删除该文件夹吗？');" id="delFolder" runat="server" onserverclick="DelFolder">删除 　　　Alt+D</a>
        <a accesskey="N" href="#" onclick="return renameFolder()" runat="server" id="renameDir">重命名　　 Alt+N</a>
    </div>
    <div class="menu" id="bodyMenu" runat="server">
        <span runat="server" id="forTemplet">
        <a accesskey="A" href="#" onclick="return addTemplet()">添加模板　 　Alt+A</a>
        <a accesskey="S" href="#" onclick="return showMsPop();" runat="server" id="ams" onserverclick="ShowMsPop">添加主从模板 Alt+S</a>
        <a accesskey="L" href="#" onclick="return What('addFlow','如何添加流程？')" runat="server" id="aAddFlow">添加流程　 　Alt+L</a>
        <a accesskey="I" href="#" runat="server" onserverclick="showRestore" id="import">导入模板　　 Alt+I</a>
        <a accesskey="E" href="#" runat="server" id="exportSelected" onclick="return setSelected()" onserverclick="ExportTemplet">导出选中模板 Alt+E</a>
        </span>
        <a accesskey="B" href="#" runat="server" id="backupSelected" onclick="return setSelected()" onserverclick="DataBackup">备份选中数据 Alt+B</a>
        <a accesskey="F" href="#" runat="server" id="operaAll" onserverclick="ExportOrBackupAll">导出所有模板 Alt+F</a>
        <a accesskey="R" href="#" runat="server" id="restore" onserverclick="showRestore">从备份中恢复 Alt+R</a>
        <div></div>
        <a accesskey="T" href="#" onclick="return setSource()" runat="server" id="cutSelected">剪切选中模板 Alt+T</a>
        <a accesskey="P" href="#" runat="server" id="paste" onserverclick="Paste">粘贴　 　　　Alt+P</a>
        <a accesskey="C" href="#" id="addfolder" runat="server" onclick="return addFolder();">新建文件夹　 Alt+C</a>
        <a href="#" onclick="return CanelEvent();" onmouseover="showSubMenu('sub_sort')" onmouseout="hideSubMenu('sub_sort')" id="aSort" class="hasSubMenus">排序</a>
        <a accesskey="F" href="###" id="find" onclick="showFind();">查找</a>
        <a accesskey="G" href="#" onclick="return back();">返回　　　　 Alt+G</a>
    </div>
    <asp:UpdatePanel ID="upSortMenus" runat="server" RenderMode="inline" UpdateMode="conditional">
    <ContentTemplate>
        <div class="menu" id="sub_sort" runat="server" onmouseout="hideSubMenu(this)">
            <a accesskey="N" href="#" runat="server" id="byName" onserverclick="Sort">名称　 　　　Alt+N</a>
            <a accesskey="T" href="#" runat="server" id="byTime" onserverclick="Sort">创建时间 　　Alt+T</a>
            <a accesskey="C" href="#" runat="server" id="byCustom" onserverclick="Sort" title="即手工拖动调整的排序">自定义　 　　Alt+C</a>
        </div>
     </ContentTemplate>
    </asp:UpdatePanel>
    <div class="menu" id="sub_filters"></div>
    <div id="filters" runat="server"></div>
    <ims:Pop runat="server" ID="power" OnOkClick="savePowers" Width="458" HideOnOkClientClick="false" OnClientUpdated="setReadCond();" HelpSubject="power">
    <ContentTemplate>
        <div runat="server" id="powerAs"><asp:CheckBox runat="server" ID="cbPowerAs" Text="引用" /><asp:DropDownList runat="server" ID="ddlPowerFrom" onchange="fromChanged();"></asp:DropDownList><label for="power_cbPowerAs"> 的权限设置</label><img src="images/what.gif" title="说明" onclick="What('PowerRef')" class="what" /></div>
        <div id="setArea">
        <div runat="server" id="dataOpera">
            <b>流程外操作表单数据</b>：<asp:DropDownList runat="server" ID="ddlDataOpera" onchange="alertPrompt();"><asp:ListItem Value="Disable">不允许</asp:ListItem><asp:ListItem Value="Readonly">只读</asp:ListItem><asp:ListItem Value="Enable">允许</asp:ListItem></asp:DropDownList>
            <div class="ui-corner-all">该模板已绑定流程，由流程参与者在流程中填写表单。通常不允许在流程外操作；若允许，则按下面设置的权限控制。</div>
        </div>
        <fieldset class="mbottom_s"><legend>角色：<asp:DropDownList ID="roles" runat="server" AutoPostBack="true" OnSelectedIndexChanged="InitPower"></asp:DropDownList></legend>
            <div style="padding:0.5em 3px 3px 0">
            <asp:CheckBox runat="server" ID="cbFullPower" Text="完全控制" />
            <div id="rwPower">
                <div id="readPower"><b>浏览权限：</b><asp:DropDownList runat="server" ID="ddlReadPower"></asp:DropDownList> <asp:CheckBox runat="server" ID="cbReadCond" Text="仅允许浏览符合条件的记录：" /><a href="#" onclick="return ShowFilter(this,'ReadCond');">设置条件</a><img src="images/what.gif" title="如何设置浏览权限？" onclick="What('SecLevel')" class="what" /></div>
                <b>编辑权限：</b><asp:RadioButton runat="server" ID="rbNo" GroupName="editPower" Text="无" /><asp:RadioButton runat="server" ID="rbAll" GroupName="editPower" Text="全部字段" /><asp:RadioButton runat="server" ID="rbSome" GroupName="editPower" Text="指定字段" />
                <span id="enFields"><asp:CheckBoxList runat="server" CssClass="colorText" ID="cblFields" RepeatDirection="Horizontal" RepeatLayout="Flow"></asp:CheckBoxList>　<img src='images/selectall.gif' class='slt' title='全选/全不选' onclick="SelectAll('enFields');" /><img src='images/revselect.gif' class='slt' title='反选' onclick="RevSelect('enFields');" />
                </span>
                <div id="spanOptions" class="mbottom_s">
                    <div class="sepline2"></div>
                    <asp:CheckBox runat="server" ID="cbEnAdd" Text="允许添加记录" /><br />
                    <asp:CheckBox runat="server" ID="cbProtOthers" Text="禁止编辑或删除他人添加的记录" /><br />
                    <asp:CheckBox runat="server" ID="cbEditCond" Text="仅允许编辑或删除符合条件的记录：" /><a href="#" onclick="return ShowFilter(this,'EditCond');">设置条件</a>
                    <div class="sepline2"></div>
                </div>
                <div runat="server" id="divMent"><b>评论权限：</b><asp:CheckBox runat="server" ID="cbReadMent" Text="查看评论" /><asp:CheckBox runat="server" ID="cbWriteMent" Text="发表评论" /><asp:CheckBox runat="server" ID="cbAdminMent" Text="删除评论" /></div>
                <div id="divHide" class="mtop_s"><b>其它选项：</b><asp:CheckBox runat="server" ID="cbHide" Text="隐藏该模板项" /><img src="images/what.gif" title="解释" onclick="What('HideTemplet')" class="what" /></div>
            </div>
            </div>
        </fieldset>
        <asp:CheckBox runat="server" ID="cbApplyToAll" Text="为所有角色设置以上权限" />
        </div>
    </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat ="server" ID="attr" OnOkClick="saveAttributes" HelpSubject="templetAttrs" OnClientUpdated="makeTabs();" HideOnOkClientClick="false" Width="486" CustomCss="noline">
    <ContentTemplate>
        <div id="tabs" class="ui-tabs mtop_s">
            <ul>
                <li><a href="#normal">常规</a></li>
                <li><a href="#attr_relation">关系</a></li>
                <li runat="server" id="liFlow"><a href="#attr_wfArea">流程</a></li>
                <li><a href="#protect">数据保护</a></li>
                <li><a href="#attr_remind">提醒</a></li>
                <li runat="server" id="liBuild"><a href="#attr_build">生成</a></li>
            </ul>
            <div id="normal">
                统计信息： 　　<asp:Literal runat="server" ID="fCount"></asp:Literal> 个字段，<asp:Literal runat="server" ID="rCount"></asp:Literal> 条记录
                <div class="sepline"></div>
                默认视图： 　　<asp:DropDownList runat="server" ID="ddlViews"></asp:DropDownList><br />
                默认排序方式： <asp:DropDownList runat="server" ID="ddlSort"></asp:DropDownList> <asp:DropDownList runat="server" ID="ddlfx"><asp:ListItem Value="ASC">从小到大</asp:ListItem><asp:ListItem Value="DESC">从大到小</asp:ListItem></asp:DropDownList>
                <div runat="server" id="divDir">
                    默认保存目录： <asp:RadioButton ID="rbDir" GroupName="DefaultDir" Text="" runat="server" /><a id="aDefaultDir" runat="server" href="#" title="点击选择目录" onclick="return showDirTree(true);" onserverclick="DirChanged"></a>
                    <asp:RadioButton ID="rbNone" GroupName="DefaultDir" Text="不关联到目录" runat="server" /><img src="images/what.gif" title="查看解释" onclick="What('DefaultDir')" class="what" />
                </div>
                <div class="sepline"></div>
                缩略图字段： 　<asp:DropDownList runat="server" ID="ddlThumb"></asp:DropDownList><br />
                标识字段： 　　<asp:DropDownList ID="fieldList_m" runat="server"></asp:DropDownList><img src="images/what.gif" title="查看解释" onclick="What('FirstIden')" class="what" />
                <div class="mtop_s" title="主要用于缩略图上鼠标悬浮显示">概要字段：<img src="images/what.gif" title="查看解释" onclick="What('hoverFields')" class="what" /></div><asp:CheckBoxList runat="server" ID="cblViews" RepeatLayout="Flow" RepeatDirection="Horizontal" CssClass="colorText"></asp:CheckBoxList>
                联合主键字段：<img src="images/what.gif" title="查看解释" onclick="What('unionKeys')" class="what" /><asp:CheckBoxList runat="server" ID="cblUnionKeys" RepeatLayout="Flow" RepeatDirection="Horizontal" CssClass="colorText"></asp:CheckBoxList>
                <div class="sepline"></div>
                <div runat="server" id="aboutEshop">
                    <asp:CheckBox ID="cbEShop" AutoPostBack="true" OnCheckedChanged="cbEShop_changed" OnLoad="cbEShop_changed" runat="server" Text="启用电子商务功能" />
                    <asp:Literal ID="lblPrice" runat="server" Text=" - 价格字段："></asp:Literal><asp:DropDownList runat="server" ID="ddlPrice"></asp:DropDownList>
                </div>
                <asp:CheckBox runat="server" ID="cbComment" onclick="mentChanged(this)" Text="允许评论" /><span id="aboutMent">：
                    <asp:CheckBox runat="server" ID="cbAdminBySelf" Text="允许修改或删除自己的评论" />
                    <asp:CheckBox runat="server" ID="cbAdminOwn" Text="允许记录创建者删除该记录的评论" />
                </span>
            </div>
            <div runat="server" id="relation">
                <asp:UpdatePanel ID="upChildren" runat="server" UpdateMode="conditional" RenderMode="Block">
                <ContentTemplate>
                    <div runat="server" id="subArea"></div>
                    <div id="divAddSub" runat="server" class="footBtnArea"><a href="#" class="u" onclick="return ShowPop('sub_popup');">添加子模板</a></div>
                    <asp:Button runat="server" ID="btnDel" OnClick="DelRelation" CssClass="hide" /><asp:Button runat="server" ID="btnSync" OnClick="Sync" CssClass="hide" />
                </ContentTemplate>
                </asp:UpdatePanel>
                <div runat="server" id="parent" class="corner"></div>
            </div>
            <div runat="server" id="wfArea">
                <a href="###" class="u" runat="server" id="aFlow" onclick="designFlow();"></a> <img src="images/del.gif" title="删除流程" onclick="delFlow();" runat="server" class="pointer" id="imgDel" />
            </div>
            <div id="protect">
                <fieldset id="safe"><legend>保护方式</legend>
                    <asp:CheckBox runat="server" ID="cbDisRead" Text="禁止浏览" />&nbsp;
                    <asp:CheckBox runat="server" ID="cbDisEdit" Text="禁止编辑" />&nbsp;
                    <asp:CheckBox runat="server" ID="cbDisDel" Text="禁止删除" />
                </fieldset>
                <asp:CheckBox runat="server" ID="cbRange" Text="仅保护符合条件的记录：" /><a href="javascript:void(0);" onclick="return ShowFilter(this);">设置条件</a><br />
                <br />
                <fieldset><legend>其它选项</legend>
                    <asp:CheckBox runat="server" ID="cbDisAdd" Text="禁止添加/导入数据" />&nbsp; <asp:CheckBox runat="server" ID="cbDisExport" Text="禁止导出/备份数据" />
                </fieldset>
                <br />
                <fieldset id="exclude"><legend>例外（指定的角色不受以上限制）：</legend>
                    <asp:CheckBoxList runat="server" ID="cblRoles" RepeatLayout="Flow" RepeatDirection="Horizontal"></asp:CheckBoxList>　<img src='images/selectall.gif' class='slt' title='全选/全不选' onclick="SelectAll('exclude');" /><img src='images/revselect.gif' class='slt' title='反选' onclick="RevSelect('exclude');" />
                </fieldset>
            </div>
            <asp:UpdatePanel ID="remind" runat="server" UpdateMode="conditional">
            <ContentTemplate>
            <div runat="server" id="divReminds"></div>
            <div runat="server" id="divAddRem" class="footBtnArea"><a href="#" class="u" onclick="return ShowPop('rem_popup');">添加提醒</a></div>
            <asp:Button runat="server" ID="btnRemind" OnClick="OperaRemind" CssClass="hide" />
            </ContentTemplate>
            </asp:UpdatePanel>
            <asp:UpdatePanel ID="build" runat="server" UpdateMode="conditional">
            <ContentTemplate>
                <div runat="server" id="divGeners"></div>
                <div runat="server" id="divAddGener" class="footBtnArea"><a href="#" class="u" onclick="return ShowPop('gen_popup');">添加生成方法</a><img src="images/what.gif" title="查看解释" onclick="What('Build')" class="what" /></div>
                <asp:Button runat="server" ID="btnBuild" OnClick="OperaBuilder" CssClass="hide" />
            </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="gen" Title="添加生成规则" Width="430" OnOkClick="AddGenerator" HideOnOkClientClick="false" OnOkClientClick="return preAddGenerator();" ShowProgress="false">
        <ContentTemplate>
            <b>&nbsp;源数据</b>：<asp:DropDownList runat="server" ID="ddlSource" AutoPostBack="true" OnSelectedIndexChanged="GenerSourceChanged"></asp:DropDownList>
            <div runat="server" id="mapArea" class="mtop_m">
                <fieldset><legend>添加字段映射：</legend>
                    <div class="padbox">
                        源字段：<asp:DropDownList runat="server" ID="mapSrc"></asp:DropDownList><br />
                        映射到：<asp:DropDownList runat="server" ID="mapTarget"></asp:DropDownList>
                        <input type="button" class="btn" value="添加映射" style="width:66px" onclick="addMap();" />
                    </div>
                </fieldset>
                <fieldset class="mtop_m"><legend>字段映射：</legend>
                    <ul id="maps" runat="server"></ul>
                    <div id="mapMsg">请添加字段映射</div>
                </fieldset>
            </div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="sub" OnOkClick="AddRelation" Width="430" HideOnOkClientClick="false" OnOkClientClick="return preAddSub();" ShowProgress="false">
        <ContentTemplate>
            <fieldset runat="server" id="subZone"><legend>选择子模板：<asp:DropDownList runat="server" ID="ddlChildren" AutoPostBack="true" OnDataBound="FillRelatedFields" OnSelectedIndexChanged="FillRelatedFields"></asp:DropDownList></legend>
            <div class="padbox" runat="server" id="union">
            关联：<asp:DropDownList runat="server" ID="ddlSubFields"></asp:DropDownList>关联到当前<asp:DropDownList runat="server" ID="ddlCurFields"></asp:DropDownList><br />
            选项：<asp:CheckBox runat="server" ID="cbUpdate" Text="同步更新关联字段" ToolTip="确定在更新当前模板关联字段时是否同步更新子模板中的关联字段" />&nbsp;<asp:CheckBox runat="server" ID="cbDel" Checked="true"
            ToolTip="确定删除记录时是否同步删除子模板中相关联的记录" Text="同步删除关联记录" />&nbsp;<asp:CheckBox runat="server" ID="cbAdd"
            ToolTip="添加主记录时是否在子模板中同步添加一条关联记录。该选项仅应当用于一对一的关系。" Text="同步添加关联记录" />
            </div>
            <p runat="server" id="unionMsg" class="mtop_m indent gray"></p>
            </fieldset>
            <p runat="server" id="subMsg" class="mtop_l indent red"></p>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="rem" Width="430" OnOkClick="AddRemind" OnOkClientClick="return preAddRemind();" HideOnOkClientClick="false" ShowProgress="false">
        <ContentTemplate>
            <div style="line-height:22px">
            名称： <asp:TextBox runat="server" ID="tbRemindName" Width="266"></asp:TextBox><br />
            提醒方式： <input type="checkbox" id="cbMsg" runat="server" checked="checked" value="4" /><label for="rem_cbMsg">消息</label><input type="checkbox" runat="server" value="1" id="cbMail" /><label for="rem_cbMail">邮件</label><input type="checkbox" runat="server" value="2" id="cbSms" /><label for="rem_cbSms">短信</label>，<a href="#" onclick="return ShowFilter(null,'RemindCond');" class="u">提醒条件</a>，<a href="#" runat="server" onclick="return showExer();" id="aExer" class="u">提醒对象</a><br />
            检查频率： <asp:RadioButton runat="server" ID="rbLoop" Checked="true" onclick="setFqcy();" GroupName="fqcy" /><span id="loop" onclick="loopClicked();">从 <asp:TextBox runat="server" ID="tbStart" Width="115" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});"></asp:TextBox> 起，每 <asp:TextBox runat="server" ID="tbFqcy" Width="24" Text="1"></asp:TextBox> <asp:DropDownList runat="server" ID="ddlTimeUnit"></asp:DropDownList> 检查一次</span><br />
            　　　　　 <asp:RadioButton runat="server" ID="rbUpdate" GroupName="fqcy" onclick="setFqcy();" Text="每次添加或更新数据后" />
            </div>
        </ContentTemplate>
    </ims:Pop>
    <div id="audient" runat="server" class="pop noline" style="width:555px" ShowProgress="false">
        <div class="head">
            <div class="title Default">提醒对象</div><div class="close" onclick="HideDialog();">×</div>
        </div>
        <div class="body">
            <fieldset><legend onclick="modeChanged();"><input id="rbAssigned" type="radio" value="1" name="range" checked="true" /><label for="rbAssigned">以下用户</label><input id="rbAllbut" name="range" type="radio" value="4" /><label for="rbAllbut">所有用户中排除以下用户</label><input id="rbInField" name="range" type="radio" value="5" /><label for="rbInField">指定字段中的用户</label></legend>
                <div class="padbox">
                    <div id="divUsers">
                        <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>
                    <asp:UpdatePanel ID="divFields" runat="server" UpdateMode="conditional" RenderMode="Block">
                        <ContentTemplate></ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </fieldset>
            排除：<asp:TextBox runat="server" id="tbNoUsers" acfid="UserName" ToolTip="双击弹出用户选择窗口。多项之间以逗号、分号或顿号分隔" chars=";；,，、" ondblclick="showUserTree(this.id);" />
        </div>
        <div class="btnArea">
            <input type="button" value="确定" id="btnAssign" onclick="exerAssigned();" class="btn" />
            <input type="button" class="btn" value="取消" onclick="HideDialog();" />
        </div>
    </div>
    <ims:Pop runat="server" ID="ff" OnOkClick="doFilter" OnClientCanel="$('#curFilterTid').val('');" OnOkClientClick="return checkCond();" OnClientUpdated="InitFilter('ff_popup');" Width="450" HideOnOkClientClick="false" HelpSubject="fastFilter" ShowProgress="false">
    <ContentTemplate>
        <asp:HiddenField ID="curFilterTid" runat="server" />
        <ul runat="server" id="ulFilter" class="notfocus"></ul>
        <a href="#" onclick="return SaveSC();" class="saveasShortcut">保存为快捷方式</a><span id="savesc" class="hidden">：<asp:TextBox runat="server" ID="tbShortcutName" ToolTip="输入快捷方式名称"></asp:TextBox> <asp:ImageButton runat="server" ID="saveShortcut" OnClick="SaveasShortcut" ToolTip="保存" ImageAlign="AbsMiddle" ImageUrl="images/save.png" /></span>
    </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="dm" ShowOkButton="false" OnClientUpdated="dmUpdated();" CanelButtonText="关闭" Width="414" CustomCss="noline">
    <ContentTemplate>
        <fieldset runat="server" id="fsData"><legend>数据管理</legend>
            <div class="pad">
                <asp:Button ID="backup" runat="server" class="btn" OnClick="DataBackup" Text="备份" />
                <asp:Button ID="clearAll" runat="server" OnClientClick="return confirm('该操作将会清空所有基于此模板的数据，且不可恢复。请务必慎重!\n确定要全部清空吗？');" OnClick="ClearAll" CssClass="btn" Text="清空"></asp:Button>
                <asp:Button ID="removeTo" runat="server" OnClick="RemoveTo" OnClientClick="return showDirTree()" CssClass="btn" Text="移到指定目录" Width="90"></asp:Button>
            </div>
        </fieldset>
        <fieldset runat="server" id="fsIO"><legend>数据交换</legend>
            <div class="pad">
                <input runat="server" type="button" id="uploadXls" onclick="return false;" class="btn" style="width:66px" value="导入Excel" />
                <asp:Button ID="btnToExcel" runat="server" Width="72" class="btn" OnClick="ToExcel" ToolTip="将数据导出到一个Excel文件" Text="导出Excel" />
                <asp:Button ID="excel" runat="server" Width="94" class="btn" OnClick="MakeExcelTemplet" ToolTip="下载Excel表单以批量录入可供导入的数据" Text="下载Excel表单" />
            </div>
        </fieldset>
        <div id="fu" runat="server"><input id="xlsToUpload" type="file" contenteditable="false" title="从一个Excel文件或包含Excel文件的ZIP文件包导入，并用于更新或追加数据" onchange="return toImport();" name="xlsToUpload" /></div>
        <fieldset runat="server" id="update" onkeydown="return enterTo('dm_btnUpdate');">
            <legend>批量更新 <asp:DropDownList ID="forUpdate" runat="server" AutoPostBack="true" OnSelectedIndexChanged="SetEditControls"></asp:DropDownList><span id="spanValue" class="hide"> 为 <asp:DropDownList runat="server" ID="ddlValue" onchange="valueChanged();"></asp:DropDownList></span>：</legend>
            <div style="padding:2px" runat="server" id="editArea">
            <asp:TextBox ID="_tb" runat="server" Width="99%" Visible="false"></asp:TextBox>
            <span runat="server" id="ddlspan" visible="false"><asp:Literal runat="server" ID="ddltext"></asp:Literal><asp:DropDownList ID="_ddl" runat="server"></asp:DropDownList></span>
            <asp:CheckBox ID="_cb" runat="server" Visible="false" />
            <asp:CheckBoxList ID="_cbl" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" Width="100%" Visible="false"></asp:CheckBoxList>
            <asp:RadioButtonList ID="_rbl" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" Width="100%" Visible="false"></asp:RadioButtonList>
            <asp:TextBox runat="server" ID="_ck" Width="99%" CssClass="ck" TextMode="MultiLine" Visible="false"></asp:TextBox>
            <ims:Uploader runat="server" ID="_uploader" Visible="false" />
            <table ID="_hl" runat="server" cellspacing="0" style="table-layout:fixed;width:98%" visible="false">
                <tr><td style="width:60px">链接文字：</td><td><asp:TextBox ID="_tbText" runat="server" Width="99%"></asp:TextBox></td></tr>
                <tr><td>链接地址：</td><td><asp:TextBox ID="_tbUrl" runat="server" Width="99%"></asp:TextBox></td></tr>
            </table>
            </div>
            <div id="buMsg" class="padcenter gray hide"></div>
        </fieldset>
        <table runat="server" id="updateFilter"><tr><td>
            <asp:CheckBox runat="server" ID="cbFilter" Text="仅更新符合条件的记录：" /><a href="javascript:void(0);" class="u" onclick="return ShowFilter(this);">设置条件</a>
        </td><td align="right">
            <asp:Button ID="btnUpdate" runat="server" Text="更新" OnClick="BatchUpdate" OnClientClick="return doConfirm();" CssClass="btn" />
        </td></tr></table>
    </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="seek" Title="查找" OkButtonText="查找" OnOkClick="BindAll" OnOkClientClick="return toFind();" HelpSubject="FindTemplet" HideOnOkClientClick="false" ShowProgress="false">
        <ContentTemplate>
            <div class="footBtnArea">名称包含：<input type="text" id="tbFind" acfid="Templet" onkeydown="return keyChanged();" /></div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="res" OnClientCanel="InitRestore();" Width="362" ShowOkButton="false" ShowProgress="false">
    <ContentTemplate>
        <div class="mtop_l center">
        <div id="loading1" class="hide middle"><img src="images/loading.gif" />　正在处理，请稍候…</div>
        <span id="uploadArea">
            指定文件：<input id="fileToUpload" type="file" name="fileToUpload" />
            <input type="button" id="upload" onclick="return ajaxFileUpload();" runat="server" value="导入" />
        </span>
        <div id="msg" class="hide">操作已成功完成！</div>
        </div>
    </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>
    <ims:Pop runat="server" ID="ms" Title="添加主从模板" OnOkClientClick="return preAdd();" CustomCss="noline" OnOkClick="AddTemplets" HideOnOkClientClick="false" Width="450" ShowProgress="false">
        <ContentTemplate>
            <fieldset class="mbottom_s"><legend>主模板</legend>
                <div class="padbox">
                    模板名称： <asp:TextBox runat="server" ID="tbMain"></asp:TextBox><br />
                    关联字段： <asp:TextBox runat="server" ID="tbKeyName"></asp:TextBox>， 类型： <asp:DropDownList runat="server" ID="keyType" onchange="keyTypeChanged();"><asp:ListItem Value="Text">文本</asp:ListItem><asp:ListItem Value="AutoNumber">自动编号</asp:ListItem></asp:DropDownList>
                    <fieldset id="nubmerRule" class="hide mtop_s"><legend>编号组成：</legend>
                        <asp:CheckBox runat="server" ID="cbPrefix" Text="前缀："></asp:CheckBox><asp:TextBox runat="server" ID="tbPrefix" MaxLength="110"></asp:TextBox><br />
                        <asp:CheckBox runat="server" ID="cbRandom" onchange="switchNo();" Text="随机字符串"></asp:CheckBox><br />
                        <div id="divNo">
                            <asp:CheckBox runat="server" ID="cbTime" Text="时间字符串："></asp:CheckBox><asp:TextBox runat="server" ID="tbTime" MaxLength="20"></asp:TextBox><img src="images/what.gif" title="查看解释" onclick="What('DateFormat')" class="what" /><br />
                            <asp:CheckBox runat="server" ID="cbSerial" Text="顺序号："></asp:CheckBox>位数:<asp:TextBox runat="server" ID="tbSerial" Width="32" MaxLength="2"></asp:TextBox> 初始值:<asp:TextBox runat="server" ID="tbInitValue" MaxLength="9" Width="48"></asp:TextBox> 递增:<asp:TextBox runat="server" ID="tbStep" MaxLength="4" Width="32"></asp:TextBox>，重置周期:<asp:DropDownList runat="server" ID="ddlLoop"></asp:DropDownList>
                        </div>
                        <asp:CheckBox runat="server" ID="cbSuffix" Text="后缀："></asp:CheckBox><asp:TextBox runat="server" ID="tbSuffix" MaxLength="110"></asp:TextBox>              
                    </fieldset>
                </div>
            </fieldset>
            <fieldset class="mtop_m"><legend>子模板</legend>
                <div class="padbox">
                    模板名称：<asp:TextBox runat="server" ID="tbChildren" Width="350" ToolTip="可输入多个子模板，以逗号分隔"></asp:TextBox>
                </div>
            </fieldset>
            <div class="right"><a href="#" class="u" onclick="return showHelp('masterSlave');">什么是主从模板？</a></div>
        </ContentTemplate>
    </ims:Pop>
    <input type="button" id="Updater" runat="server" onserverclick="BindAll" class="hide" />
    <script src="js/comm.js"></script><script src="js/templets.js"></script>
    </form>
</body>
</html>