📄 editfieldperm.jsp
字号:
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.util.*"%>
<%@ page import="cn.myapps.core.user.action.WebUser"%>
<%@ page import="cn.myapps.core.user.ejb.UserVO"%>
<%@ page import="cn.myapps.core.dynaform.form.ejb.FormProcessBean"%>
<%@ page import="cn.myapps.core.dynaform.form.ejb.FormField"%>
<%@ page import="cn.myapps.base.action.ParamsTable"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib prefix="ww" uri="webwork"%>
<%
request.setCharacterEncoding("GBK");
String contextPath = request.getContextPath();
WebUser user = (WebUser)session.getAttribute("USER");
String formname = request.getParameter("formname");
ParamsTable param = new ParamsTable();
param.setParameter("s_name", formname);
param.setParameter("_pagelines", String.valueOf(Integer.MAX_VALUE));
FormProcessBean formProxy = new FormProcessBean();
Collection colls = formProxy.doGetFields(param, user.getApplicationid());
Iterator iters = colls.iterator();
Iterator tmp = colls.iterator();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>{*[Edit FieldPerm]*}</title>
<link rel="stylesheet"
href="<%= contextPath %>/resource/css/dtree.css"
type="text/css">
<link rel="stylesheet"
href="<%= contextPath %>/resource/css/main.css"
type="text/css">
<script src="<%= contextPath %>/js/util.js"></script>
<script language="JavaScript">
var contextPath = '<%=contextPath%>';
function ev_ok() {
window.returnValue = getFieldPermList();
window.close();
}
function getFieldPermList(){
var fieldPermList = "";
if(tmp.hd != null){
for(i=0;i<tmp.hd.length;++i){
if(tmp.hd[i].checked){
fieldPermList += tmp.hd[i].value + ";";
}else if(tmp.rd[i].checked){
fieldPermList += tmp.rd[i].value + ";";
}
}
}
return fieldPermList;
}
function setFieldPermList(fieldPermList){
var hdchecked, rdchecked;
if(tmp.hd != null){
for(i=0;i<tmp.hd.length;++i)
{
hdchecked = (fieldPermList.indexOf(tmp.hd[i].value+';')>=0);
tmp.hd[i].checked = hdchecked;
rdchecked = (fieldPermList.indexOf(tmp.rd[i].value+';')>=0);
tmp.rd[i].checked = rdchecked;
if(!(hdchecked || rdchecked)){
tmp.wt[i].checked = true;
}
}
}
}
function doCheck(id,tp){
if (tp=='rd'){
tmp.allrd.checked = false;
if (document.all('rd'+id).checked){
document.all('wt'+id).checked = false;
document.all('hd'+id).checked = false;
}
}
if (tp=='wt'){
tmp.allwt.checked = false;
if (document.all('wt'+id).checked){
document.all('rd'+id).checked = false;
document.all('hd'+id).checked = false;
}
}
if (tp=='hd'){
tmp.allhd.checked = false;
if (document.all('hd'+id).checked){
document.all('rd'+id).checked = false;
document.all('wt'+id).checked = false;
}
}
}
function selectAllRd(b){
if(tmp.rd != null){
for(i=0;i<tmp.rd.length;++i){
tmp.rd[i].checked = b;
tmp.hd[i].checked = false;
tmp.wt[i].checked = false;
}
tmp.allhd.checked = false;
tmp.allwt.checked = false;
}
}
function selectAllHd(b){
if(tmp.hd != null){
for(i=0;i<tmp.hd.length;++i){
tmp.rd[i].checked = false;
tmp.hd[i].checked = b;
tmp.wt[i].checked = false;
}
tmp.allrd.checked = false;
tmp.allwt.checked = false;
}
}
function selectAllWt(b){
if(tmp.wt != null){
for(i=0;i<tmp.wt.length;++i){
tmp.rd[i].checked = false;
tmp.hd[i].checked = false;
tmp.wt[i].checked = b;
}
tmp.allrd.checked = false;
tmp.allhd.checked = false;
}
}
</script>
</head>
<body>
<table width="98%">
<tr>
<td width="10" class="image-label"><img src="<ww:url value="/resource/image/email2.jpg"/>" /></td>
<td width="3"></td>
<td width="50" class="text-label">{*[Field]*}</td>
<td>
<table width="100%" border=1 cellpadding="0" cellspacing="0"
class="line-position">
<tr>
<td></td>
<td class="line-position2" width="60" valign="top">
<button class="button-image" onClick="ev_ok()"><img
src="<ww:url value="/resource/image/save.gif"/>">{*[Save]*}</button>
</td>
<td class="line-position2" width="70" valign="top">
<button class="button-image"
onClick="window.close()"><img
src="<ww:url value="/resource/image/cancle2.gif"/>">{*[Cancle]*}</button>
</td>
</tr>
</table>
</td>
</tr>
</table>
<form name="tmp">
<ww:hidden name="s_module" value="%{#parameters.s_module}" />
<table width="95%" cellspacing="0">
<tr>
<td width="100%" valign="top">
<table width="100%" cellpadding="2" cellspacing="1" border="0" bgcolor="#dddddd">
<tr bgcolor="#FFFFFF">
<td width="20%" align="right" class="content-label">Form:</td>
<td align="left"><input type="text" name="formname" value="<%=formname%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%" align="right" class="content-label">Field:</td>
<td align="left" valign="top">
<table width="100%">
<tr>
<td width="10%" align="left"> </td>
<td width="10%" align="left"><input type="checkbox" name="allrd" onclick="selectAllRd(this.checked)">{*[all]*}</td>
<td width="10%" align="left"><input type="checkbox" name="allwt" onclick="selectAllWt(this.checked)">{*[all]*}</td>
<td width="70%" align="left"><input type="checkbox" name="allhd" onclick="selectAllHd(this.checked)">{*[all]*}</td>
</tr>
<%
int id = 0;
while(iters.hasNext()){
FormField ff = (FormField)iters.next();
id++;
%>
<tr>
<td nowrap><%=ff.getName()%>:</td>
<td nowrap><input type="checkbox" name="rd" value="@<%=ff.getName()%>" id="rd<%=id%>" onclick='doCheck("<%=id%>","rd")'>{*[Read-only]*}</td>
<td nowrap><input type="checkbox" name="wt" value="#<%=ff.getName()%>" id='wt<%=id%>' onclick='doCheck("<%=id%>","wt")'>{*[Modify]*}</td>
<td nowrap><input type="checkbox" name="hd" value="$<%=ff.getName()%>" id='hd<%=id%>' onclick='doCheck("<%=id%>","hd")'>{*[Hidden]*}</td>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
<script language="JavaScript">
var obj = window.dialogArguments;
if(obj != null && obj.formname != null){
tmp.formname.value = obj.formname;
setFieldPermList(obj.fieldPermList);
}
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -