<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
     <%--  富客户端环境引用文件  --%> 
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
    <title>
     <s:i18n name="param1">
    <s:property value="getText('title')"/>
    </s:i18n>
    </title>
 

  </head>
  <body>
  <table width="300" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr  bgcolor="#c0c0c0" class="clickable_t">
    <td>&nbsp;&nbsp;[<s:property value="u_name"/>]权限设定
    <select name="ls_qx" onchange="toSetqx(this.value);">
      <s:iterator value="scope" var="qx">
        <option value="<s:property value="#qx.SCOPECODE"/>" <s:if test="#qx.SCOPECODE==#parameters.qxlx[0]">selected</s:if><s:else></s:else>><s:property value="#qx.SCOPENAME"/></option>
      </s:iterator>
    </select>
    --选取相应操作人员</td>
  </tr>
  <s:set name="ls_uu_yy" value=""></s:set>
  <s:iterator value="department" var="dpt">
  <tr bgcolor="#ffffff">
    <td>
	<table width="300" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td><s:property value="#dpt.DPT_NAME"/></td>
  </tr>
    <s:iterator value="loginuser" var="user">
    <s:if test="#user.EMDEPART==#dpt.DPT_NO">
  <tr>
    <td>
    <table width="300" border="0" cellspacing="1" cellpadding="0">
      <tr onMouseOver="this.style.backgroundColor='#D0E6EE';" onMouseOut="this.style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
        <td width="30">
         <s:if test='oldPPStr.contains(#user.EMID)'>
          <s:set name="ls_check" value="checked='checked'"></s:set>
          <s:if test='#ls_uu_yy==null || #ls_uu_yy==""'>
            <s:set name="ls_uu_yy" value="#user.EMID+','"></s:set>
          </s:if>
          <s:else>
            <s:set name="ls_uu_yy" value="#ls_uu_yy+#user.EMID+','"></s:set>
          </s:else>
         </s:if>
         <s:else>
          <s:set name="ls_check" value=""></s:set>
         </s:else>
         <input type="checkbox" id="u<s:property value="#user.EMID"/>" value="<s:property value="#user.EMID"/>" <s:property value="#ls_check"/> onclick="getUu('u<s:property value="#user.EMID"/>');"/>
        </td>
        <td><s:property value="#user.EMNAME"/></td>
      </tr>
    </table>
    </td>
  </tr>
  </s:if>
  </s:iterator>
</table>
	</td>
  </tr>
  </s:iterator>
  <tr  bgcolor="#ffffff">
    <td align="center">
     <input type="button" value="确定" onclick="ls_submit();"/>
     <input type="button" value="取消" onclick="gaowj.getDialog().close(true);"/>
    </td>
  </tr>
</table>
<form name="ls_touu" method="post" action="personChoiceLinguserSave">
  <input type="hidden" name="qxlx" value="<s:property value="#parameters.qxlx[0]"/>"/>
  <input type="hidden" name="touu"/>
  <input type="hidden" name="uid" value="<s:property value="#parameters.myzd_id[0]"/>"/> 
  <input type="hidden" name="myzd_id" value="<s:property value="#parameters.myzd_id[0]"/>"/>
  <input type="hidden" name="emid" value="<s:property value="u_emid"/>"/> 
</form>
  </body>
   <script type="text/javascript">
     var ls_uu="<s:property value='#ls_uu_yy'/>";
     var ls_uid="<s:property value='#parameters.myzd_id[0]'/>";
     setUu();
     function getUu(ls_uuid){
      var uuid=document.all.item(ls_uuid);
      if(uuid.checked==true){
       ls_uu=ls_uu+uuid.value+",";
      }else{
       ls_uu=ls_uu.substring(0,ls_uu.indexOf(uuid.value))+ls_uu.substring(ls_uu.indexOf(uuid.value)+uuid.value.length+1);
      }
     }
     function setUu(){
      var ls_temp=ls_uu;
      if(ls_temp!=null && ls_temp.length>0){
       ls_temp=ls_temp.substring(0,ls_temp.length -1);
      }else{
       ls_temp="";
      }
      document.all.item("touu").value=ls_temp;
      document.all.item("qxlx").value=document.all.item("ls_qx").value;
     }
     function ls_submit(){
      setUu();
      document.all.item("ls_touu").submit();
     }
     function toSetqx(qxlx){
      window.location="personChoiceLinguser?myzd_id="+ls_uid+"&qxlx="+qxlx;
     }
   </script>
</html>
