<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.adsoon.common.util.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<link rel="StyleSheet" href="<%=basePath %>css/style.css" type="text/css" />
</head>
<link rel="StyleSheet" href="<%=basePath %>css/dtree.css" type="text/css" />
<script type="text/javascript" src="<%=basePath %>js/dtree.js"></script>
<script type="text/javascript" src="<%=basePath %>js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<%=basePath %>js/jQuery.CascadingSelect.js"></script>
<script type="text/javascript" src="<%=basePath %>js/jQuery.FillOptions.js"></script>
<SCRIPT language="JavaScript">
var d = new dTree("d", "selectAddressUser.jsp", "../../img/");
d.add("0","-1", "通讯簿");
<%
GroupUserDao group=new GroupUserDao();
out.println(group.toHtmlListMenu());
%>
function select_department(obj)
{
$("#list1").FillOptions("<%=basePath %>common/selectUser.do?id="+obj,{datatype:"json",textfield:"lgname",valuefiled:"lgid"});
}
function ok(fbox)
{
var rece="";
for(var i=0; i<fbox.options.length; i++){
rece+=","+fbox.options[i].text+"["+fbox.options[i].value+"]";
}
window.returnValue =rece.substring(1);
window.close();
}
//fbox - 待选项目列表
//tbox - 选择了的项目列表
function move(fbox,tbox)
{
for(var i=0; i<fbox.options.length; i++)
{
if(fbox.options[i].value != "")
{
// 增加项目列表到右侧
var no = new Option();
no.value = fbox.options[i].value
no.text = fbox.options[i].text
tbox.options[tbox.options.length] = no;
// 清空左侧的项目列表
fbox.options[i].value = ""
fbox.options[i].text = ""
}
}
}
//检查列表框tbox中是否已含有value=value的option项
function checkIsExist(tbox,value)
{
for(var i=0; i<tbox.options.length; i++)
{
if(tbox.options[i].value==value)
return true;
}
return false;
}
function move1(fbox,tbox)
{
var isUserBeSel = false;
for(var i=0; i<fbox.options.length; i++)
{
if(fbox.options[i].selected&&!checkIsExist(tbox,fbox.options[i].value))
{
var no = new Option();
no.value = fbox.options[i].value
no.text = fbox.options[i].text
tbox.options[tbox.options.length] = no;
fbox.options[i] = null;
i--;
isUserBeSel = true;
//setSelValue(document.forms[0].list2,document.forms[0].inputUserGroupNames,document.forms[0].receiver);
}
else
{
fbox.options[0].selected = true;
}
}
}
//清除空的项目列表
function BumpUp(box) {
for(var i=0; i<box.options.length; i++) {
if(box.options[i].value == "") {
for(var j=i; j<box.options.length-1; j++) {
box.options[j].value = box.options[j+1].value
box.options[j].text = box.options[j+1].text + ""
}
var ln = i
break
}
}
if(ln < box.options.length) {
box.options.length -= 1;
BumpUp(box);
}
}
function SortD(box) {
var temp_opts = new Array()
var temp = new Object()
//调用临时数组
for(var i=0; i<box.options.length; i++) {
temp_opts[i] = box.options[i]
}
for(var i=0; i<box.options.length; i++) {
box.options[i].value = temp_opts[i].value
box.options[i].text = temp_opts[i].text
}
//重复选择的不显示
for(var i=0; i<box.options.length-1; i++)
for(var j=i+1;j<box.options.length;j++){
if(box.options[i].value==box.options[j].value){
box.options[j] = null;
}
}
}
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" align="center" border="0" cellspacing="0" cellpadding="0" height=100%>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td align="center" bgcolor="#FFFFFF" valign="top"> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="83%" height="23" align="left" valign="top" class="cpx12hei"><strong> 选择用户:</strong></td>
<td width="17%" height="23" align="left" valign="top" class="cpx12hei">
</td>
</tr>
</table>
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="35%" height="100%" scope="col" align="center" valign="top">
<TABLE cellSpacing="1" cellPadding="3" width="100%" align="center" border="0">
<TBODY>
<TR>
<TD>
<SCRIPT language="JavaScript">
document.write(d);
</SCRIPT>
</TD>
</TR>
</TBODY>
</TABLE>
</th>
<th width="65%" height="100%" scope="col" valign="top">
<form method="post" name="orc">
<table width="100%" height="100%" border="1" bordercolor="#cccccc" cellpadding="6" cellspacing="0" bgcolor="ffffff" class="cpx12hei">
<tr>
<td width="40%" height="17" align="center" valign="top" class="tablehead">未选人员</td>
<td width="20%" rowspan="2" align="center" valign="middle">
<input name="B1" type="button" class="button" onclick="move1(document.forms[0].list1,document.forms[0].list2)" value=" >> ">
<br><br>
<input NAME="B2" TYPE="button" class="button" onclick="move1(document.forms[0].list2,document.forms[0].list1)" VALUE=" << "></td><td width="40%" height="17" align="center" valign="top" class="tablehead">已选人员</td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="F4FAFF">
<select size="12" name="list1" id="list1" multiple="multiple" style="width:100%">
</select>
</td>
<td width="40%" align="center" valign="top" bgcolor="F4FAFF">
<select name="list2" id="list2" size="12" multiple="multiple" style="width:100%">
</select>
</td>
</tr>
</table>
</form>
</th>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="94%" height="17" class="cpx12red"><span class="cpx12red">(注:可以选择群组)</span></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><a href="#" onclick="ok(document.forms[0].list2);" class="cpx12orange"><img src="<%=basePath %>img/ok.gif" width="38" height="19" border="0"></a>
<a href="#" onclick="javascript:window.close();" class="cpx12orange"><img src="<%=basePath %>img/cancel.gif" width="38" height="19" border="0"></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>