/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: ......
 * Generated at: 2021-03-03 03:48:20 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.net.*;
import wiseoa.*;
import wiseoa.mail.jstl.*;
import wiseoa.home.*;
import wiseoa.RBAC.*;
import wiseoa.util.*;

public final class system_005fgroup_005frole_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody;

  private volatile javax.el.ExpressionFactory _el_expressionfactory;
  private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
    if (_el_expressionfactory == null) {
      synchronized (this) {
        if (_el_expressionfactory == null) {
          _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
        }
      }
    }
    return _el_expressionfactory;
  }

  public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
    if (_jsp_instancemanager == null) {
      synchronized (this) {
        if (_jsp_instancemanager == null) {
          _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
        }
      }
    }
    return _jsp_instancemanager;
  }

  public void _jspInit() {
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.release();
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write(" \r\n");
      out.write(" \r\n");
      out.write(" \r\n");
  

 
	 

	request.setCharacterEncoding("UTF-8");
    FF.setResponseContentType(response);
	wiseoa.mail.jstl.MyUser  mu =new wiseoa.mail.jstl.MyUser (request);
	
    FF.pageContextSetAttribute(pageContext,"path", mu.groupPath);
    FF.pageContextSetAttribute(pageContext,"groupid",   mu.groupID );
 
	FF.pageContextSetAttribute(pageContext,"canedit", mu.canEdit);	  
	
	if ( ! mu.canEdit) 
	{
		   String s= User.TIP_NORIGHT;
		   response.sendRedirect( "SystemTip.jsp?info="+  URLEncoder.encode(s,"UTF-8") );
	}
     
	   
    UserRoleTree  dtc=new UserRoleTree(request );
     

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<HTML>\r\n");
      out.write("  <head><meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\r\n");
      out.write(" \r\n");
      out.write("    <META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("    <TITLE>部门统一角色设置</TITLE>\r\n");
      out.write("    \r\n");
      out.write("    <META http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("    <META http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("    <META http-equiv=\"expires\" content=\"0\">\r\n");
      out.write(" \r\n");
      out.write("     \r\n");
      out.write("\t<script type=\"text/javascript\" src=\"js/json.js\"></script>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"js/jst.js\"></script>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"js/jquery.js\"></script>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"js/zrpc.js.jsp\"></script>\r\n");
      out.write("\r\n");
      out.write("    <LINK rel=\"stylesheet\" type=\"text/css\" href=\"css/normal.css\">\r\n");
      out.write(" \r\n");
      out.write("   <LINK rel=\"StyleSheet\" href=\"tree/dtree.css\" type=\"text/css\" />\r\n");
      out.write("   <SCRIPT  type=\"text/javascript\" src=\"tree/dtree.js\"></SCRIPT>\r\n");
      out.write("  \r\n");
      out.write("<script>\r\n");
      out.write("\r\n");
      out.write("//角色前的checkbox点击后的回调，这里不做任何事\r\n");
      out.write("function grantRole( input , roleid)\r\n");
      out.write("{\r\n");
      out.write(" \r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function overGrantGroupRole()\r\n");
      out.write("{\r\n");
      out.write("\t tip=\"确信要给部门(及子部门)中所有人员统一修成选中的角色吗?\"\r\n");
      out.write("\t grantGroupRole(tip,\"overwrite\");\t\t \r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function appendGrantGroupRole()\r\n");
      out.write("{\r\n");
      out.write("\t tip=\"确信要给部门(及子部门)中所有人员追加授与选中的角色吗?\"\r\n");
      out.write("\t grantGroupRole(tip,\"grant\");\t\t \r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function revokeGroupRole()\r\n");
      out.write("{\r\n");
      out.write("\t tip=\"确信要给部门(及子部门)中所有人员统一剥夺选中的角色吗?\"\r\n");
      out.write("\t grantGroupRole(tip,\"revoke\");\t\t \r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("function grantGroupRole ( tip ,action )\r\n");
      out.write("{\r\n");
      out.write("   \r\n");
      out.write("\t if( !confirm( tip)) \r\n");
      out.write("\t{\r\n");
      out.write("\t\t \r\n");
      out.write("\t\t return ;\r\n");
      out.write("\t}    \r\n");
      out.write("\r\n");
      out.write("    var  objs = document.getElementsByTagName(\"INPUT\");\r\n");
      out.write("    var roleid='';\r\n");
      out.write("    for(var i=0;i<objs.length;i++)\r\n");
      out.write("    {\r\n");
      out.write("        var obj=objs[i];\r\n");
      out.write("        var type=obj.type;\r\n");
      out.write("        type=type.toUpperCase();\r\n");
      out.write("      \r\n");
      out.write("        if( type!='CHECKBOX' ) continue;\r\n");
      out.write("         \r\n");
      out.write("        if( obj.checked)  roleid=roleid+\",\"+obj.value;\r\n");
      out.write("        \r\n");
      out.write("    } \r\n");
      out.write("\r\n");
      out.write("   \r\n");
      out.write("    \r\n");
      out.write("\t$rpc( 'wiseoa.RBAC.RoleRightManage', 'setGroupRole' , \r\n");
      out.write("            {\r\n");
      out.write("\t\t      action:action,\r\n");
      out.write("              'roleid'          :  roleid  , \r\n");
      out.write("              'groupid': ");
      if (_jspx_meth_c_005fout_005f0(_jspx_page_context))
        return;
      out.write("\r\n");
      out.write("        \r\n");
      out.write("             },\r\n");
      out.write("             function ( ret)\r\n");
      out.write("             {\r\n");
      out.write("                  var data= JSON.parse(ret);\r\n");
      out.write("                  if (! data.success)\r\n");
      out.write("                  {\r\n");
      out.write("                     alert ( data.message);\r\n");
      out.write("                  } \r\n");
      out.write("                  else\r\n");
      out.write("                  {\r\n");
      out.write("                      alert(\"设置成功\");\r\n");
      out.write("                  }\r\n");
      out.write("            }\r\n");
      out.write("     );         \r\n");
      out.write("             \r\n");
      out.write("     \r\n");
      out.write("} \r\n");
      out.write("\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("  </HEAD>\r\n");
      out.write("  \r\n");
      out.write("  <BODY  style= \"margin:0\">\r\n");
      out.write("  \r\n");
      out.write(" \r\n");
      out.write("<TABLE width=\"100%\" border=\"0\" align='center' cellpadding=\"0\"\r\n");
      out.write("\tcellspacing=\"0\"  >\r\n");
      out.write("\t<TR>\r\n");
      out.write("\t\t<TD height=\"48\" style=\" width:309px; padding-top:12px;\"  align=\"left\" valign=\"top\"\r\n");
      out.write("\t\t\tbackground=\"image/sztop.gif\"><span  style=\"color:white; width:309px; font-size:16px; \" > &nbsp;当前部门</span></TD>\r\n");
      out.write("\t\t<TD\twidth=80% background=\"image/sztop2.gif\"  style=\"color:white;\"> ");
      if (_jspx_meth_c_005fout_005f1(_jspx_page_context))
        return;
      out.write("\r\n");
      out.write("     \r\n");
      out.write("        </TD>\r\n");
      out.write("\r\n");
      out.write("\t</TR>\r\n");
      out.write("   </TABLE>\r\n");
      out.write("   \r\n");
      out.write("   \r\n");
      out.write("  <div style=\"padding:20px;\">\r\n");
      out.write("      \t<SCRIPT type=\"text/javascript\">\r\n");
      out.write("\t\t");
      out.print(dtc.TreeHTML);
      out.write("  \r\n");
      out.write("\t\t</SCRIPT>\r\n");
      out.write("\t\t</div>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t<table border=0 width=100%>\r\n");
      out.write("\t\t<tr><td><input type=\"button\" value=\"统一设置\" onclick=\"overGrantGroupRole();\"></td>\r\n");
      out.write("\t\t<td style=\"width:99%\">  <div style=\"color:red; padding:10px;padding-left:20px;\">\r\n");
      out.write(" 警告：选中需要授与的角色，在点击统一设置后，当前部门下所有人员（包括子部门人员）不管以前是什么角色，现在都统一成下面选中的的角色了。所以请谨慎操作。\r\n");
      out.write(" </div>\r\n");
      out.write("</td></tr>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t<tr><td><input type=\"button\" value=\"统一授与\" onclick=\"appendGrantGroupRole();\"></td>\r\n");
      out.write("\t\t<td style=\"width:99%\">  <div style=\"color:red; padding:10px;padding-left:20px;\">\r\n");
      out.write(" 警告：选中需要授与的角色，在点击统一授与后，当前部门下所有人员（包括子部门人员）以前授与的角色仍保留，并追加授与选中的的角色了。\r\n");
      out.write(" </div>\r\n");
      out.write("</td></tr>\r\n");
      out.write("\r\n");
      out.write("<tr><td><input type=\"button\" value=\"统一剥夺\" onclick=\"revokeGroupRole();\"></td>\r\n");
      out.write("\t\t<td style=\"width:99%\">  <div style=\"color:red; padding:10px;padding-left:20px;\">\r\n");
      out.write(" 警告：选中需要剥夺的角色，在点击统一剥夺后，当前部门下所有人员（包括子部门人员）如果以前授与这些角色，现在都将被剥夺。\r\n");
      out.write(" </div>\r\n");
      out.write("</td></tr>\r\n");
      out.write("\r\n");
      out.write("\t\t</table>\r\n");
      out.write("\t \r\n");
      out.write("\t  </BODY>\r\n");
      out.write("</HTML>\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_c_005fout_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:out
    org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f0 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
    _jspx_th_c_005fout_005f0.setPageContext(_jspx_page_context);
    _jspx_th_c_005fout_005f0.setParent(null);
    // /system_group_role.jsp(122,25) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fout_005f0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${param.id}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
    int _jspx_eval_c_005fout_005f0 = _jspx_th_c_005fout_005f0.doStartTag();
    if (_jspx_th_c_005fout_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
    return false;
  }

  private boolean _jspx_meth_c_005fout_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:out
    org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f1 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
    _jspx_th_c_005fout_005f1.setPageContext(_jspx_page_context);
    _jspx_th_c_005fout_005f1.setParent(null);
    // /system_group_role.jsp(154,69) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fout_005f1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${path}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
    int _jspx_eval_c_005fout_005f1 = _jspx_th_c_005fout_005f1.doStartTag();
    if (_jspx_th_c_005fout_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
    return false;
  }
}
