📄 address_list_group.jsp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<jsp:include page="/vnex/page/FORM_HEAD.jsp" />
<BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
<script language="javascript" src="/vnex/validate.js" ></script>
<script language="JavaScript">
function isValidChar(str)
{
var i,j,strTemp;
strTemp="<>";
for (i=0;i<str.length;i++)
{
j=strTemp.indexOf(str.charAt(i));
if (j!=-1)
{
return false;
}
}
return true;
}
function selectt(selectedIndex)
{
str = document.myform.group.options[selectedIndex].text;
document.myform.groupName.value = str;
}
function delGroups(selectedIndex)
{
if(document.myform.group.selectedIndex<=-1)
{
alert("请选择要删除的组。");
return false;
}
if(!confirm("是否确定删除?"))
{
return false;
}
document.myform.action = "/mainctrl/addressbook/groupList?removeGroup=ok";
document.myform.submit();
}
function addGroup()
{
if (!stripWhitespace(document.myform.groupName.value) || document.myform.groupName.value=="")
{
alert("组名不能为空。");
document.myform.groupName.focus();
return false;
}
if(!isValidChar(myform.groupName.value))
{
alert("输入内容不能包括 < > 这些特殊字符。");
return false;
}
document.myform.action = "/mainctrl/addressbook/groupList?createGroup=ok";
document.myform.submit();
}
function updataGroup()
{
if(document.myform.group.selectedIndex<=-1)
{
alert("请选择要修改的组。");
return false;
}
if (!stripWhitespace(document.myform.groupName.value) || document.myform.groupName.value=="")
{
alert("组名不能为空。");
document.myform.groupName.focus();
return false;
}
if(!isValidChar(myform.groupName.value))
{
alert("输入内容不能包括 < > 这些特殊字符。");
return false;
}
document.myform.action = "/mainctrl/addressbook/groupList?modifyGroup=ok";
document.myform.submit();
}
</script>
<script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
<script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
<%@ page errorPage="/vnex/ErrorPage.jsp" %>
<%@ page import="com.vnex.intranet.addresslist.value.*"%>
<%@ page import="com.vnex.intranet.addresslist.proxy.*"%>
<%@ page import="com.vnex.intranet.util.*"%>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ taglib uri="/vnex.tld" prefix="vnex"%>
<%@ taglib uri="/vnex_addresslist.tld" prefix="addresslist"%>
<jsp:useBean id="groupProxy" class="com.vnex.intranet.addresslist.proxy.AddressGroupProxyBean" scope="application" />
<jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
<DIV align=center>
<form name="myform" method="post" action="">
<%
ContactGroupValueBean cgvb = new ContactGroupValueBean();
Collection coll = null;
String condition = "";
int empId = BusinessName.getEmpId();
condition = "emp_id="+empId+" order by emp_id DESC";
String pageTo = "/mainctrl/addressbook/groupList?";
if( request.getParameter("createGroup")!=null && request.getParameter("createGroup").equals("ok") )
{
if( request.getParameter("groupName")!=null && !request.getParameter("groupName").equals("") )
{
int flag = 0;
coll = groupProxy.getGroupList(condition);
if(coll != null && coll.size() != 0)
{
Iterator it = coll.iterator();
while( it.hasNext() )
{
cgvb = (ContactGroupValueBean)it.next();
if( cgvb.getGroupName().equals(request.getParameter("groupName").trim()) )
{
flag = 1;
}
}
}
if(flag==0)
{
cgvb.setGroupName(request.getParameter("groupName"));
cgvb.setEmpId(empId);
groupProxy.createGroup(cgvb);
}
}
}
if( request.getParameter("removeGroup")!=null && request.getParameter("removeGroup").equals("ok") )
{
String[] str = null;
int[] groupIds = null;
if( request.getParameter("group")!=null && !request.getParameter("group").equals("") )
{
str = request.getParameterValues("group");
groupIds = new int[str.length];
for(int i=0; i<str.length; i++)
{
groupIds[i] = Integer.parseInt( str[i] );
}
groupProxy.removeGroup(groupIds);
}
}
if( request.getParameter("modifyGroup")!=null && request.getParameter("modifyGroup").equals("ok") )
{
if( request.getParameter("groupName")!=null && !request.getParameter("groupName").equals("") )
{
int flag = 0;
coll = groupProxy.getGroupList(condition);
if(coll != null && coll.size() != 0)
{
Iterator it = coll.iterator();
while( it.hasNext() )
{
cgvb = (ContactGroupValueBean)it.next();
if( cgvb.getGroupName().equals(request.getParameter("groupName").trim()) )
{
flag = 1;
}
}
}
if(flag==0)
{
cgvb.setGroupId( Integer.parseInt(request.getParameter("group")) );
cgvb.setGroupName(request.getParameter("groupName"));
groupProxy.modifyGroup(cgvb);
}
}
}
%>
<TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
<jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
<TR>
<TD colSpan=3 align="center"><br>
<table width="600" border="1" cellspacing="1" bordercolor="#666666">
<tr>
<td align="center" colspan="2" bgcolor="#FFFFFF">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#666666">
<td colspan="2"><font class="strongw"><a href="/mainctrl/home/index"><font color="#ffffff">首页</font></a>>><a href="/mainctrl/personal/main"><font color="#ffffff">个人办公</font></a>>><a href="/mainctrl/addressbook/home"><font color="#ffffff">个人通讯录</font></a>>>组管理</font>
</td>
</tr>
</table>
<table class=title border="0" cellpadding="2" cellspacing="1" width="600">
<tr bgcolor="#fafafa">
<td colspan="2">
<font class="strong"> 添加新组(不可以重名)</font>
<input type="text" name="groupName" size="20" maxlength="20" class="text">
<input type="button" name="createGroupp" value="添加保存" class="text" onClick="addGroup()" style="width:60px">
<input type="button" name="modifyGroupp" value="修改保存" class="text" onClick="updataGroup()" style="width:60px">
</td>
</tr>
</table>
<table class=title border="0" cellpadding="2" cellspacing="1" width="600">
<tr bgcolor="#e0e0e0">
<td width="13%"> <strong>组名:</strong></td>
<td width="87%">
<select size="5" name="group" onChange="selectt(group.selectedIndex)" class="text" style="width:300">
<addresslist:groupList queryStr="<%=condition%>">
<vnex:items paging="true">
<option value="<addresslist:groupAttribute attribute="group_id" />">
<addresslist:groupAttribute attribute="group_name"/>
</option>
</vnex:items>
</addresslist:groupList>
</select>
<input type="button" name="Button2" value="删除" onClick="delGroups(group.selectedIndex)" class="text">
</td>
</tr>
<tr bgcolor="#fafafa" height="30">
<td colspan="2" align="center">
<input type="button" name="Button3" value="返回" onClick="location='/mainctrl/addressbook/home'" class="text">
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<jsp:include page="/vnex/page/TTOA_HELP.jsp" />
</TD>
</TR>
<jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
</TABLE>
<br>
<jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
</form></DIV>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -