<%@ page language="C#" autoeventwireup="true" inherits="ims.roles, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="roles">
<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:HiddenField ID="curRoleName" 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="menu" id="menu_obj">
        <a href="#" runat="server" onserverclick="ShowAttributes" id="showAttributes">权限</a>
        <a href="#" onclick="return renameRole()">重命名</a>
        <a href="#" onclick="return del();">删除</a>
        <div></div>
        <a href="#" onclick="return listUsers();">列出用户</a>
        <div></div>
        <a href="#" id="anony" onclick="return What('anonyUser')">什么是匿名用户？</a>
    </div>

    <div class="menu" id="menu_body">
        <a href="#" onclick="return createRole();" class="f-add">添加角色</a>
        <a href="#" onclick="location='users.aspx';" class="f-user2">用户管理</a>
   </div>

    <ims:Pop runat="server" ID="attr" OnOkClick="saveAttributes" OnClientUpdated="setReadLevel();" HideOnOkClientClick="false" Width="450" HelpSubject="power">
    <ContentTemplate>
        <fieldset class="mbottom_m"><legend>系统权限</legend>
            <div class="padbox">
                <asp:CheckBox ID="cbSysAdmin" Text="系统管理" runat="server" AutoPostBack="true" OnCheckedChanged="cbSysAdmin_changed" />
                <asp:CheckBox ID="cbUserAdmin" Text="用户管理" runat="server" />
                <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.Sys.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>&nbsp;<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>
                <li runat="server" id="wxPower">
                    微信权限：<asp:CheckBox ID="cbWxSend" Text="允许发送" runat="server" /><span runat="server" id="spanWxBatch"><asp:CheckBox ID="cbWxBatchSend" Text="允许群发" runat="server" /></span>
                </li>
            </ul>
        </fieldset>
        <fieldset runat="server" id="tPowers"><legend>模板权限</legend>
            <div class="padcenter"><asp:LinkButton runat="server" ID="lbShow" OnClick="ShowTempltPowers" Text="查看模板权限" /></div>
        </fieldset>
        <div class="note" runat="server" id="info">请在<a href="templets.aspx">设计中心</a>模板右键-"权限"来设置模板权限！</div>
    </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="tps" Title="模板权限" Width="624" ShowOkButton="false" HelpSubject="power" CanelButtonText="关闭">
        <ContentTemplate>
            <asp:PlaceHolder runat="server" ID="phPowers"></asp:PlaceHolder>
        </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>