DocTempletFieldsPurviewManage.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:8k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312" %>
- <%@ page import="com.gforce.gfoa.*, com.gforce.currency.*, java.util.*" %>
- <jsp:include page="/CheckLogin.jsp" flush="true"/><%
- Session m_session = new Session(session);
- Request m_request = new Request(request);
- int iSysDirID = m_request.GetInt("SysDirID");
- String strTempletID = m_request.GetString("ID");
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <title>公文管理 -- GForce OA 2.0</title>
- <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
- <script language="JavaScript" src="/js/changestyle.js"></script>
- <script language="JavaScript">
- //可写用户初始化数组
- var WA_Array = new Array();
- //只读用户初始化数组
- var RA_Array = new Array();
- var SelectedCheckBoxValue = new Array();
- var WA_UserIDs = "";
- var RA_UserIDs = "";
- var INTI_WA_Array = "";
- var INTI_RA_Array = "";
- <%
- //返回当前公文的所有字段信息
- Vector DTF_vt = DocTempletFieldsManager.getRecordBySearch("","","","","","","","","","","","1","","",strTempletID,"","","","","");
- if (DTF_vt.size()>0)
- {
- for (int i=0;i<DTF_vt.size();i++)
- {
- //格式:“字段ID”,“用户IDs”
- out.println("WA_Array[" + i + "]=new Array('" + ((Vector)DTF_vt.get(i)).get(0) + "','" + ((Vector)DTF_vt.get(i)).get(9).toString() + "','" + ((Vector)DTF_vt.get(i)).get(10).toString() + "');");
- out.println("RA_Array[" + i + "]=new Array('" + ((Vector)DTF_vt.get(i)).get(0) + "','" + ((Vector)DTF_vt.get(i)).get(10).toString() + "');");
- }
- }
- %>
- var jsArray = new Array();
- <%
- Vector vt = UserManager.getUserTreeData();
- for(int j=0;j<vt.size();j++)
- {
- out.println("jsArray[" +j + "] = new Array("" + ((Vector)vt.get(j)).get(0).toString() + "","" + ((Vector)vt.get(j)).get(1).toString() + "");");
- }
- %>
- //产生str1和str2的交集
- function intersection(str1,str2)
- {
- var str3 = "";
- ///alert("str1=" + str1 + ";str2=" + str2 + ";str3=" + str3);
- if (str1.length<1||str2.length<1)
- {
- ///alert("str1或者str2为空!str1=" + str1 + ";str2=" + str2 + ";str3=" + str3);
- return "";
- }
- else
- {
- var MyArray = new Array();
- if(str1.indexOf(",")>=0)
- {
- ///alert("str1包含,!str1=" + str1 + ";str2=" + str2 + ";str3=" + str3);
- MyArray = str1.split(",");
- str2 = "," + str2 + ",";
- for (var i=0;i<MyArray.length;i++)
- {
- if (MyArray[i].length>0 && str2.indexOf(","+ MyArray[i] +",")>=0)
- {
- str3 += ("," + MyArray[i]);
- }
- }
- str3=str3.substr(1);
- }
- else if (("," + str2 + ",").indexOf(","+ str1 +",")>=0)
- {
- ///alert("str1不包含,!str1=" + str1 + ";str2=" + str2 + ";str3=" + str3);
- str3 += str1;
- }
- else
- {
- str3="";
- }
- }
- return str3;
- }
- function PickCheck()
- {
- INTI_WA_Array = "";
- INTI_RA_Array = "";
- WA_UserIDs = "-1";
- RA_UserIDs = "-1";
- var j=0;
- for(var i=0;i<document.DTFPManage.Purview.length;i++)
- {
- if (document.DTFPManage.Purview[i].checked==true)
- {
- for (var k=0;k<WA_Array.length;k++)
- {
- if(document.DTFPManage.Purview[i].value==WA_Array[k][0])
- {
- INTI_WA_Array = WA_Array[k][1];
- if (WA_UserIDs=="-1")
- {
- WA_UserIDs = INTI_WA_Array;
- }
- else
- {
- WA_UserIDs = intersection(WA_UserIDs,INTI_WA_Array);
- }
- INTI_RA_Array = WA_Array[k][2];
- if (RA_UserIDs=="-1")
- {
- RA_UserIDs = INTI_RA_Array;
- }
- else
- {
- RA_UserIDs = intersection(RA_UserIDs,INTI_RA_Array);
- }
- }
- }
- j=j+1;
- }
- }
- if (document.DTFPManage.OpType.value == "Writeable")
- return WA_UserIDs;
- else if (document.DTFPManage.OpType.value == "Readable")
- return RA_UserIDs;
- }
- function ChangeSelected()
- {
- document.DTFPManage.UserIDs.value = PickCheck();
- document.DTFPManage.Intersection.value = document.DTFPManage.UserIDs.value;
- }
- function changeUserID()
- {
- var temp = "";
- for(var i=0;i<jsArray.length;i++)
- {
- if(("," + document.DTFPManage.UserIDs.value + ",").indexOf("," + jsArray[i][0] + ",")>=0)
- temp+="," + jsArray[i][1];
- }
- document.DTFPManage.UserNames.value = temp.substr(1,temp.length);
- }
- function ClearField()
- {
- if (document.DTFPManage.UserIDs.value==-1)
- {document.DTFPManage.UserIDs.value="";}
- }
- function checkFields()
- {
- for(var i=0;i<document.DTFPManage.Purview.length;i++)
- {
- if (document.DTFPManage.Purview[i].checked==true)
- {
- return true;
- }
- }
- alert("请先选择要操作的字段!");
- return false;
- }
- </script>
- </head>
- <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
- <table width="100%" height="100%" border="0" align="center" cellspacing="0">
- <tr>
- <td align="center" valign="top"><p> </p>
- <form name="DTFPManage" action="DTFP_ManageAction.jsp?SysDirID=<%=iSysDirID%>" onSubmit="javascript:return checkFields();" method="post">
- <table width="90%" border="0" align="center" cellspacing="0">
- <tr>
- <td align="center">
- <font color="#000000"><strong>公文模板字段权限管理</strong></font>
- </td>
- </tr>
- <tr>
- <td>
-
- </td>
- </tr>
- </table>
- <table align="center" width="90%" border="1" cellpadding="1" cellspacing="1">
- <tr align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
- <td align="center" width="14%">
- 操作类型:
- </td>
- <td align="left" width="80%">
- <select name="OpType" onchange="ChangeSelected()">
- <option value="Writeable" selected="selected">可写权限</option>
- <option value="Readable">只读权限</option>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td align="center" width="14%">权限列表: </td>
- <td align="left" width="70%"><%
- if (DTF_vt.size()>0)
- {
- for (int i=0;i<DTF_vt.size();i++)
- {
- out.println("<class><input name="Purview" type="checkbox" value="" + ((Vector)DTF_vt.get(i)).get(0) + "" onpropertychange="ChangeSelected()">" + ((Vector)DTF_vt.get(i)).get(1) + "</class>");
- }
- }
- else
- {
- out.println("该公文模板没有字段!");
- return;
- }
- %>
- </td>
- </tr>
- <tr>
- <td align="center">请选择用户:
- </td>
- <td align="left"> <textarea name="UserNames" cols="60" rows="4" readonly="true" onDblClick="GetUserIDAndNames(document.DTFPManage.UserIDs,this);"></textarea>
- <a href="" onclick="GetUserIDAndNames(document.DTFPManage.UserIDs,document.DTFPManage.UserNames);return false;" title="选择用户"><img src="/images/couple.gif" border="0"></a>
- <input name="UserIDs" type="hidden" value="" onpropertychange="changeUserID()">
- <input name="TempletID" type="hidden" value="<%=strTempletID%>">
- <input name="Intersection" type="hidden" value="">
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">
-
- </td>
- </tr>
- </table>
- <table width="90%">
- <tr>
- <td align="right">
- <input type="submit" onclick="ClearField()" value="确 定" style="background-color: #FFFFFF; border: 1 solid #000000">
- <input type="reset" value="重 置" style="background-color: #FFFFFF; border: 1 solid #000000">
- <input type="button" value="返 回" onclick="window.location='DocumentTempletManage.jsp?SysDirID=155'" style="background-color: #FFFFFF; border: 1 solid #000000">
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>