OrgChartDoc.jsp 17.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
<%@ page language="java" contentType="text/html; charset=UTF-8" %> 
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="java.util.*,java.io.File" %>
<%@ page import="weaver.systeminfo.*" %>
<%@ page import="weaver.org.layout.*" %>
<%@ page import="weaver.general.GCONST" %>
<%@ page import="weaver.general.IsGovProj" %>
<%@ page import="weaver.hrm.common.*,weaver.hrm.chart.domain.*" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="CompanyComInfo" class="weaver.hrm.company.CompanyComInfo" scope="page" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="DocSearchManage" class="weaver.docs.search.DocSearchManage" scope="page" />
<jsp:useBean id="DocSearchComInfo" class="weaver.docs.search.DocSearchComInfo" scope="page" />
<jsp:useBean id="showDepLayoutToPicServlet" class="weaver.org.layout.ShowDepLayoutToPicServlet" scope="page" />
<%
	int isgoveproj = Util.getIntValue(IsGovProj.getPath(),0);//0:非政务系统,1:政务系统
	String fnarightlevel = HrmUserVarify.getRightLevel("FnaTransaction:All",user) ;

	String imagefilename = "/images/hdHRMCard_wev8.gif";
	String titlename = SystemEnv.getHtmlLabelName(562,user.getLanguage());
	String needfav ="1";
	String needhelp ="";
	
	String sorgid = Util.null2String(request.getParameter("sorgid"),"1");
	String docStatus = Util.null2String(request.getParameter("docStatus"));
%>
<HTML>
	<HEAD>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link type="text/css" rel="stylesheet" href="/css/Weaver_wev8.css"/>
		<link type="text/css" rel="stylesheet" href="/appres/hrm/css/orgchart_wev8.css"/>
		<script language="javascript" src="/js/weaver_wev8.js"></script>
		<script language="javascript" type="text/javascript" src="/appres/hrm/js/mfcommon_wev8.js"></script>
		<style type="text/css">
		.ellipsis {
			padding:1px;
			white-space:nowrap;
			overflow:hidden;
			text-overflow:ellipsis;
		}
		.wpoint{
			position:absolute;
			overflow:hidden;
			width:1px;
			height:1px;
			background:#000;
			border:0;
			border:0;
		}
		</style>
		<script>
			var sorgid = "<%= sorgid%>";
			
			function onBtnSearchClick(){
				jQuery("#searchfrm").submit();
			}
			
			function resetSelect(){
				var obj = $GetEle("docStatus");
				if(obj)changeSelectValue(obj.id,"0");
			}
		</script>
	</HEAD>
	<BODY>
		<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
		<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
		<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
		<form action="" name="searchfrm" id="searchfrm">
			<input type="hidden" name="sorgid" value="<%=sorgid%>">
			<table id="topTitle" class="topTitle" cellpadding="0" cellspacing="0">
				<tr>
					<td></td>
					<td class="rightSearchSpan" style="text-align:right;">
						<span id="advancedSearch" class="advancedSearch"><%=SystemEnv.getHtmlLabelName(21995,user.getLanguage())%></span>
						<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage())%>" class="cornerMenu"></span>
					</td>
				</tr>
			</table>
			<div class="advancedSearchDiv" id="advancedSearchDiv" style="display:none;" >
				<wea:layout type="2col">
					<wea:group context='<%=SystemEnv.getHtmlLabelName(20331,user.getLanguage())%>'>
						<wea:item><%=SystemEnv.getHtmlLabelName(602,user.getLanguage())%></wea:item>
						<wea:item>
							<select class="InputStyle" id="docStatus" name="docStatus">
								<option value=""><%=SystemEnv.getHtmlLabelName(332,user.getLanguage())%></option>
								<option value="0" <%=docStatus.equals("0")?"selected":""%>><%=SystemEnv.getHtmlLabelName(220,user.getLanguage())%></option>
								<option value="1" <%=docStatus.equals("1")?"selected":""%>><%=SystemEnv.getHtmlLabelName(18431,user.getLanguage())%></option>
								<option value="2" <%=docStatus.equals("2")?"selected":""%>><%=SystemEnv.getHtmlLabelName(225,user.getLanguage())%></option>
								<option value="3" <%=docStatus.equals("3")?"selected":""%>><%=SystemEnv.getHtmlLabelName(359,user.getLanguage())%></option>
								<option value="4" <%=docStatus.equals("4")?"selected":""%>><%=SystemEnv.getHtmlLabelName(236,user.getLanguage())%></option>
								<option value="5" <%=docStatus.equals("5")?"selected":""%>><%=SystemEnv.getHtmlLabelName(251,user.getLanguage())%></option>
								<option value="6" <%=docStatus.equals("6")?"selected":""%>><%=SystemEnv.getHtmlLabelName(19564,user.getLanguage())%></option>
								<option value="7" <%=docStatus.equals("7")?"selected":""%>><%=SystemEnv.getHtmlLabelName(15750,user.getLanguage())%></option>
								<option value="8" <%=docStatus.equals("8")?"selected":""%>><%=SystemEnv.getHtmlLabelName(15358,user.getLanguage())%></option>
								<option value="9" <%=docStatus.equals("9")?"selected":""%>><%=SystemEnv.getHtmlLabelName(21556,user.getLanguage())%></option>
							</select>
						</wea:item>
					</wea:group>
					<wea:group context="">
						<wea:item type="toolbar">
							<input type="button" value="<%=SystemEnv.getHtmlLabelName(197,user.getLanguage())%>" class="e8_btn_submit" onclick="onBtnSearchClick()"/>
							<input type="button" value="<%=SystemEnv.getHtmlLabelName(2022,user.getLanguage())%>" class="e8_btn_cancel" onclick="resetCondtion();resetSelect()"/>
							<input type="button" value="<%=SystemEnv.getHtmlLabelName(31129,user.getLanguage())%>" class="e8_btn_cancel" id="cancel"/>
						</wea:item>
					</wea:group>
				</wea:layout>
			</div>
		</form>
		<div id="contentDiv" style="position:relative;height:100%;bottom:4px;width:100%;overflow:auto;">
			<table id="scrollarea" name="scrollarea" width="100%" height="100%" style="zIndex:-1" >
				<tr>
					<td align="center" valign="center">
						<div style="width:170px;border:1px solid #d0d0d0;"><img src="/images/loading2_wev8.gif" align="absmiddle"><%=SystemEnv.getHtmlLabelName(19205,user.getLanguage())%></div>
					</td>
				</tr>
			</table>
		</div>
<%
RecordSet.executeSql("select needupdate from orgchartstate");
    int needupdate = 1;
    if (RecordSet.next())
        needupdate = RecordSet.getInt("needupdate");


int companyid = Util.getIntValue(request.getParameter("companyid"),1);
String departids="\"\"";


RecordSet.executeProc("HrmSubCompany_SByCompanyID",""+companyid);

int subcompanycount = RecordSet.getCounts();
int clientwidth = 125*subcompanycount;

int top = 210;
int cellHeight = 66;
int cellWidth = 105;
int cellWidth2 = 420;
int lineHeight1 = 7;
int lineHeight2 = 73;
int lineWidth = 5;
int cellSpace = 20;
int linestep = 17;


String charttype = Util.null2String(request.getParameter("charttype"));

String doctype_a = Util.null2String(request.getParameter("doctype_a"));
String doctype_p = Util.null2String(request.getParameter("doctype_p"));
String doctype_o = Util.null2String(request.getParameter("doctype_o"));
String doctype_d = Util.null2String(request.getParameter("doctype_d"));
String docstatus = docStatus;

if(charttype.equals(""))
	charttype = "D";

int topMargin = 210;
int leftMargin = 20;
DepLayout dl = DownloadDeptLayoutServlet.readDeptLayout(user.getLanguage(), false, user);

dl.buildObjectRef();
dl.checkAndAutoset(10, 10, 20, 20);
%>
<table width="<%=dl.getMaxPos().x+60%>" height="<%=dl.getMaxPos().y+300%>" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td ></td>
	<td valign="top">
		<TABLE class=Shadow>
		<tr>
		<td valign="top">

			<FORM action="OrgChartDoc.jsp" id=Baco name=Baco method=post>
				<%

				DocSearchComInfo.resetSearchInfo();
				if (docStatus!= null && docStatus.length() > 0) {
					DocSearchComInfo.addDocstatus(docStatus);
				}
				%>
				

			<div id=oDiv STYLE="POSITION:absolute;Z-INDEX:100;TOP:<%=topMargin%>;LEFT:<%=leftMargin%>;height:<%=dl.getMaxPos().y%>;width:<%=dl.getMaxPos().x%>">
			<%
			out.print(showDepLayoutToPicServlet.gerLine(request,response));
			int curnum = 0;
			for (int i=0;i<dl.departments.size();i++) {
				Department depart = (Department)dl.departments.get(i);
				String tmpnum="";
				departids +=",\"";
				departids += depart.id;
				departids +="\"";
				curnum += 1;
				
				String whereclause = "";
				if (depart.type == Department.TYPE_ZONGBU) {
			%>
				<TABLE class="org_node_c_inner_company" cellpadding=1 cellspacing=1 STYLE="POSITION:absolute;Z-INDEX:100;;TOP:<%=depart.y%>px;LEFT:<%=depart.x%>px;height:<%=depart.getWidthHeight().y+1%>px;width:<%=depart.getWidthHeight().x%>px;cursor:hand;">
					<TR height=22px><TD colspan=2 style="color:#000079" id=t align="center" title="<%=depart.name%>"><br><%=Tools.vString(depart.name, 12)%></TD></TR>
					<TR height=20px>
					<%
						tmpnum = "";
						whereclause = " where " + DocSearchComInfo.FormatSQLSearch(user.getLanguage()) ; 
						DocSearchManage.getSelectResultCount(whereclause,user) ;
						tmpnum=""+DocSearchManage.getRecordersize();
					%>
					<TD align="center" width="100%" style="padding-bottom:3px;color:#000079"><%=tmpnum%></TD>
					</TR>
				</TABLE>		
			<%
				} else if (depart.type == Department.TYPE_FENBU) {
					int subcompanyid = depart.id;
			%>
				<TABLE class="org_node_c_inner_subcompany" cellpadding=1 cellspacing=1
					STYLE="POSITION:absolute;Z-INDEX:100;;TOP:<%=depart.y%>px;LEFT:<%=depart.x%>px;height:<%=depart.getWidthHeight().y+1%>px;width:<%=depart.getWidthHeight().x%>px;background-repeat:no-repeat;">
					<TR height=28px><TD align="center" onclick="doShowOrg('subcompany','<%=depart.id%>');" style="color:#eee;cursor:pointer" colspan=1 TITLE="<%=depart.name%>" id=t><span class="ellipsis" style="width:<%=depart.getWidthHeight().x%>px;display:inline-block;overflow:hidden;"><span><%=Tools.vString(depart.name, 12)%></span></span></TD></TR>
					<TR height=14px>
					<%
						tmpnum = "";
						whereclause = " where " + DocSearchComInfo.FormatSQLSearch(user.getLanguage()) ; 
						whereclause +=  " and docdepartmentid in ( " +
										" select id from HrmDepartment where subcompanyid1= " +
										subcompanyid + "  or  subcompanyid1  in (select id from hrmsubcompany where supsubcomid="+subcompanyid+") ) ";
						DocSearchManage.getSelectResultCount(whereclause,user) ;
						tmpnum=""+ DocSearchManage.getRecordersize();
					%>
					<TD align="center" width=100% style="padding-bottom:0px;color:#eee;cursor:pointer" onclick="doShow('subcompany','<%=depart.id%>');"><%=tmpnum%></TD>
					</TR>		
				</TABLE>
			<%
				} else if (depart.type == Department.TYPE_COMMON_DEPARTMENT) {
			%>
				<TABLE class="org_node_c_inner_dept" cellpadding=1 cellspacing=1 
					STYLE="POSITION:absolute;Z-INDEX:100;;TOP:<%=depart.y%>px;LEFT:<%=depart.x%>px;height:<%=depart.getWidthHeight().y+1%>px;width:<%=depart.getWidthHeight().x%>px;cursor:hand;background-repeat:no-repeat;">
					<TR height=28px><TD onclick="doShowOrg('department','<%=depart.id%>');" align="center" style="color:#eee;cursor:pointer" colspan=1 TITLE="<%=depart.name%>" id=t><span class="ellipsis" style="width:<%=depart.getWidthHeight().x%>px;display:inline-block;overflow:hidden;"><span ><%=Tools.vString(depart.name, 12)%></span></span></TD></TR>
					<TR height=14px>
					<%
						tmpnum = "";
						whereclause = " where " + DocSearchComInfo.FormatSQLSearch(user.getLanguage()) ; 
						whereclause +=  " and docdepartmentid = " +  depart.id;

						DocSearchManage.getSelectResultCount(whereclause,user) ;
						tmpnum=""+DocSearchManage.getRecordersize();
					%>
					<TD align="center" width=100% style="padding-bottom:0px;color:#eee;cursor:pointer" onclick="doShow('department','<%=depart.id%>');"><%=tmpnum%></TD>
					</TR>
				</TABLE>
			<%  } // end of if
			} // end of for
			%>
			</div>
			<DIV style="position:absolute;top:947;left:804;visibility:hidden;width:1;height:1;"></DIV>
			<SCRIPT language=VBScript>
			oc_DivisionList=array(<%=departids%>)
			dim oc_CurrentMenu
			dim oc_CurrentIndex

			Sub oc_ShowMenu(Index,elMenu)
				dim t
				on error resume next
				oc_CurrentMenu.style.visibility="hidden"
				on error goto 0
				Set oc_CurrentMenu=elMenu
				oc_CurrentIndex = Index

				' title
				set elFrom = window.event.srcElement
				do while elFrom.tagName<>"TABLE"
					set elFrom = elFrom.parentElement
				loop
				elMenu.all("t").innerText = elFrom.all("t").innerText

				st = document.body.scrollTop
				oh = document.body.offsetHeight
				t = (st + window.event.clientY) - 2
				l = (document.body.scrollLeft + window.event.clientX) -10
				h = elMenu.clientHeight
				w = elMenu.clientWidth

				if ((l + w) > (document.body.scrollLeft + document.body.offsetWidth)) then l = l - (w-20)
				if ((t + h) > (document.body.scrollTop + document.body.offsetHeight)) then t = t - (h+2)

				elMenu.style.left = l
				elMenu.style.top = t
				elMenu.style.visibility = "visible"
			End Sub

			Sub oc_CurrentMenuOnMouseOut()
				set el = window.event.srcElement
				if (el.tagName = "A") then set el = el.parentElement
				if (el.tagName = "IMG") then set el = el.parentElement
				if (el.tagName = "TD" AND el.className <> "MenuPopupSelected" AND el.className <> "NoHand") then el.className = "MenuPopup"
			End Sub

			Sub oc_CurrentMenuOnMouseOver()
				set el = window.event.srcElement
				if (el.tagName = "A") then set el = el.parentElement
				if (el.tagName = "IMG") then set el = el.parentElement
				if (el.tagName = "TD" AND el.className <> "MenuPopupSelected" AND el.className <> "NoHand") then el.className = "MenuPopupFocus"
			End Sub

			Sub document_onmouseover
				on error resume next
				If window.event.srcElement.tagName = "BODY" Then
					oc_CurrentMenu.style.visibility = "hidden"
				End If
			End Sub

			Sub document_onmouseup
				on error resume next
				If window.event.srcElement.tagName = "BODY" Then
					oc_CurrentMenu.style.visibility = "hidden"
				End If
			End Sub

			Function oc_getAllDivisions(isQuoted)
				oc_getAllDivisions = Null
				For i = 1 To UBound(oc_DivisionList)
					d = oc_DivisionList(i)
					If isQuoted Then d = "'" & d & "'"
					oc_getAllDivisions = oc_getAllDivisions + "," & d
				Next
			End Function
			</SCRIPT>


				<DIV id="oc_divMenuTop" style="visibility:hidden; LEFT:0px; POSITION:absolute; TOP:0px; WIDTH:240px; Z-INDEX: 200">
				<TABLE cellpadding=2 cellspacing=0 class="MenuPopup" LANGUAGE=javascript onclick="return oc_CurrentMenuOnClick()" onmouseout="return oc_CurrentMenuonmouseout()" onmouseover="return oc_CurrentMenuonmouseover()" style="HEIGHT: 79px; WIDTH: 246px">
				<TR><TD class="NoHand" style=text-align:center;color:white id=t>Title</TD>
				</TR>
				
				</TABLE>
				</DIV>
				<DIV id="oc_divMenuGroup" style="visibility:hidden; LEFT:0px; POSITION:absolute; TOP:0px; WIDTH:240px; Z-INDEX: 200">
				<TABLE cellpadding=2 cellspacing=0 class="MenuPopup" LANGUAGE=javascript onclick="return oc_CurrentMenuOnClick()" onmouseout="return oc_CurrentMenuonmouseout()" onmouseover="return oc_CurrentMenuonmouseover()" style="HEIGHT: 79px; WIDTH: 246px">
				<TR><TD class="NoHand" style=text-align:center;color:white id=t>Title</TD></TR>
				
				</TABLE>
				</DIV>
				<DIV id="oc_divMenuDivision" style="visibility:hidden; LEFT:0px; POSITION:absolute; TOP:0px; WIDTH:240px; Z-INDEX: 200">
				<TABLE cellpadding=2 cellspacing=0 class="MenuPopup" LANGUAGE=javascript onclick="return oc_CurrentMenuOnClick()" onmouseout="return oc_CurrentMenuonmouseout()" onmouseover="return oc_CurrentMenuonmouseover()" style="HEIGHT: 79px; WIDTH: 246px">
				<TR><TD class="NoHand" style=text-align:center;color:white id=t>Title</TD></TR>
				
					 <TR id=D1><TD class=MenuPopup><%=SystemEnv.getHtmlLabelName(124,user.getLanguage())%></TD></TR>
				
					 <TR id=D2><TD class=MenuPopup><%=SystemEnv.getHtmlLabelName(70,user.getLanguage())%></TD></TR>
					 
					 <TR id=D3><TD class=MenuPopup><%=SystemEnv.getHtmlLabelName(58,user.getLanguage())%></TD></TR>
				
				</TABLE>
				</DIV>
				<SCRIPT LANGUAGE=VBScript>
				Sub oc_CurrentMenuOnClick
					set el = window.event.srcElement
					if (el.tagName = "A") then set el = el.parentElement
					select case el.parentElement.id
					
						case "D1"
							r="/hrm/company/HrmDepartmentDsp.jsp?id=" & oc_DivisionList(oc_CurrentIndex)
						case "D2"
							r="/docs/news/DocNews.jsp?depid=" & oc_DivisionList(oc_CurrentIndex)
						case "D3"
							r="/docs/search/DocSearchTemp.jsp?docstatus=<%=docstatus%>&departmentid=" & oc_DivisionList(oc_CurrentIndex)
					end select
					oc_CurrentMenu.style.visibility = "hidden"
					if (r <> "") then
						window.event.returnValue = false
						window.location.href = r
					end if
				End Sub
				</SCRIPT>

			</FORM>
		</td>
		</tr>
		</TABLE>
	</td>
	<td></td>
</tr>
<tr>
	<td height="10" colspan="3"></td>
</tr>
</table>
<script language="javascript">
 function onSubmit(){ 	
	document.Baco.submit();
 }
 function doShow(type, id){
	if(type === "subcompany"){
		window.open("/hrm/HrmTab.jsp?_fromURL=HrmResourceSearchResult&from=hrmorg&virtualtype="+sorgid+"&subcompanyid1="+id);
	} else if(type === "department"){
		window.open("/hrm/HrmTab.jsp?_fromURL=HrmResourceSearchResult&from=hrmorg&virtualtype="+sorgid+"&departmentid="+id);
	}
}
	jQuery(document).ready(function(){
		if (typeof onBtnSearchClick != "undefined" && onBtnSearchClick instanceof Function) {
			$("#topTitle").topMenuTitle({searchFn:onBtnSearchClick});
		}
		document.all("contentDiv").style.display = "none";
	});
</script>
</BODY>
</HTML>