<%@ page language="C#" autoeventwireup="true" inherits="ims.web.roles, 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="roles">
<head runat="server">
    <title>系统中的所有角色</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="curRoleName" runat="server" />
    <asp:ScriptManager ID="s1" runat="server" EnablePageMethods="true">
        <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="menu" id="menu_obj">
        <a accesskey="R" href="#" runat="server" onserverclick="ShowAttributes" id="showAttributes">权限 　　　Alt+R</a>
        <a accesskey="N" href="#" onclick="return renameRole()">重命名　　 Alt+N</a>
        <a accesskey="D" href="#" onclick="return del();">删除 　　　Alt+D</a>
        <div></div>
        <a accesskey="L" href="#" onclick="return listUsers();">列出用户　 Alt+L</a>
        <div></div>
        <a href="#" id="anony" onclick="return What('anonyUser')">什么是匿名用户？</a>
    </div>

    <div class="menu" id="menu_body">
        <a accesskey="N" href="#" onclick="return createRole();">添加新角色 Alt+N</a>
        <a accesskey="U" href="#" onclick="location='users.aspx';">用户管理　 Alt+U</a>
   </div>

    <ims:Pop runat="server" ID="attr" OnOkClick="saveAttributes" OnClientUpdated="setReadLevel();setReadCond();" HideOnOkClientClick="false" Width="430" CustomCss="noline" ShowProgress="false">
    <ContentTemplate>
        <fieldset class="mbottom_m"><legend>系统权限</legend>
            <div class="inFieldset">
                <asp:CheckBox ID="cbSysAdmin" Text="系统管理" runat="server" AutoPostBack="true" OnCheckedChanged="cbSysAdmin_changed" />
                <asp:CheckBox ID="cbTempletAdmin" Text="创建模板" runat="server" />
                <asp:CheckBox ID="cbOrderAdmin" Text="订单管理" runat="server" />
            </div>
        </fieldset>
        <fieldset class="mbottom_m" runat="server" id="commPower"><legend>沟通权限</legend>
            <ul>
                <li runat="server" id="infoPower">
                    <%= ims.Comm.Vars.InfoCenterText %>：<asp:CheckBox ID="cbPublish" Text="发布" runat="server" /><asp:CheckBox ID="cbRead" Text="浏览" runat="server" /><span runat="server" id="infoReadLevel"> - 权限级别：<asp:DropDownList runat="server" ID="ddlInfoLevel"></asp:DropDownList> </span><asp:CheckBox ID="cbComment" Text="评论" runat="server" /><asp:CheckBox ID="cbAdmin" Text="管理" runat="server" />
                </li>
                <li runat="server" id="mailPower">
                    邮件权限：<asp:CheckBox ID="cbMailSend" Text="允许发送" runat="server" /><span runat="server" id="spanMailBatch"><asp:CheckBox ID="cbMailBatchSend" Text="允许群发" runat="server" /></span>
                </li>
                <li runat="server" id="smsPower">
                    短信权限：<asp:CheckBox ID="cbSend" Text="允许发送" runat="server" /><span runat="server" id="spanBatch"><asp:CheckBox ID="cbBatchSend" Text="允许群发" runat="server" /></span><span class="hide"><asp:CheckBox ID="cbReceive" Text="允许接收" runat="server" /></span>
                </li>
                <li runat="server" id="msgPower">
                    消息权限：<asp:CheckBox ID="cbMsgSend" Text="允许发送" runat="server" /><span runat="server" id="spanMsgBatch"><asp:CheckBox ID="cbMsgBatchSend" Text="允许群发" runat="server" /></span>
                </li>
            </ul>
        </fieldset>
        <fieldset class="mbottom_m" runat="server" id="tPowers"><legend>模板权限：<asp:DropDownList runat="server" ID="ddlTempletPower" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="TempletChanged"></asp:DropDownList></legend>
            <div runat="server" id="msg" class="padbox gray left">请进入<a href="templets.aspx" target="_self">设计中心</a>，在模板右键菜单“权限”中查看和设置对模板的权限！</div>
            <div class="inFieldset" runat="server" id="PowerZone" visible="false">
            <asp:CheckBox runat="server" ID="cbFullPower" Text="完全控制" />
            <div id="rwPower" style="padding-left:20px">
                浏览权限：<span style="+margin-left:4px"><asp:DropDownList runat="server" ID="ddlReadPower"></asp:DropDownList></span>&nbsp;<asp:CheckBox runat="server" ID="cbReadCond" Text="仅允许浏览符合条件的记录：" /><a href="javascript:void(0);" onclick="return ShowFilter(this,'ReadCond');">设置条件</a><img src="images/what.gif" title="如何设置浏览权限？" onclick="What('SecLevel')" class="what" /><br />
                编辑权限：<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="指定字段" /><br />
                <fieldset style="padding:2px 1px 2px 2px;" id="enFields" runat="server"><legend>允许编辑的字段：</legend>
                    <asp:CheckBoxList runat="server" ID="cblFields" CssClass="colorText" RepeatDirection="Horizontal" RepeatLayout="Flow"></asp:CheckBoxList>　<img src='images/selectall.gif' class='slt' title='全选/全不选' onclick="SelectAll('attr_enFields');" /><img src='images/revselect.gif' class='slt' title='反选' onclick="RevSelect('attr_enFields');" />
                </fieldset>
                <span id="spanOptions">
                    <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="javascript:void(0);" onclick="return ShowFilter(this,'EditCond');">设置条件</a>
                </span>
            </div>
            </div>
        </fieldset>
        <asp:CheckBox runat="server" ID="cbApplyToAll" Visible="false" ToolTip="使当前角色对每一个模板都具有当前所设置的模板权限" Text="为所有模板设置以上权限" />
    </ContentTemplate>
    </ims:Pop>
    
    <asp:UpdatePanel ID="objsDiv" runat="server" ChildrenAsTriggers="false" UpdateMode="conditional" RenderMode="Block" OnPreRender="RolesPreRender">
    <ContentTemplate>
        <div class="obj role_locked" title="匿名用户，指所有未登录的用户" runat="server" id="anonyRole"><div></div><span>匿名用户</span></div>
        <asp:PlaceHolder runat="server" ID="phRoles"></asp:PlaceHolder>
    </ContentTemplate>
    </asp:UpdatePanel>
    <script src="js/comm.js"></script><script src="js/roles.js"></script>
    </form>
</body>
</html>