MultiRequestedBrowser.jsp 45.9 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 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="weaver.general.Util,java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.workflow.request.RequestBrowser" %>
<%@ page import="weaver.workflow.workflow.WorkflowVersion" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page"/>
<jsp:useBean id="ProjectInfoComInfo" class="weaver.proj.Maint.ProjectInfoComInfo" scope="page"/>
<jsp:useBean id="crmComInfo" class="weaver.crm.Maint.CustomerInfoComInfo" scope="page"/>
<jsp:useBean id="sysInfo" class="weaver.system.SystemComInfo" scope="page"/>
<jsp:useBean id="Browsedatadefinition" class="weaver.workflow.request.Browsedatadefinition" scope="page"/>

<HTML>
<HEAD>
<LINK rel="stylesheet" type="text/css" href="/css/Weaver_wev8.css">
<link type="text/css" href="/js/dragBox/e8browser_wev8.css" rel=stylesheet>
<script language=javascript src="/workplan/calendar/src/Plugins/jquery.form_wev8.js"></script>
<script type="text/javascript" src="/js/ecology8/base/jquery-ui_wev8.js"></script>
<script type="text/javascript" src="/js/dragBox/ajaxmanager_wev8.js"></script>
<script type="text/javascript" src="/js/dragBox/rightspluingForBrowserNew_wev8.js"></script>
<script type='text/javascript' src='/js/jquery-autocomplete/jquery.autocomplete_wev8.js'></script>
<style type="text/css">
.LayoutTable .fieldName {
	padding-left:20px!important;
}
</style>
</HEAD>
<%

request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
String currentdate = df.format(new Date());

String f_weaver_belongto_userid=Util.fromScreen(request.getParameter("f_weaver_belongto_userid"),user.getLanguage());
		String f_weaver_belongto_usertype=request.getParameter("f_weaver_belongto_usertype");//需要增加的代码
		if("".equals(f_weaver_belongto_userid)){
		   f_weaver_belongto_userid = Util.null2String((String)session.getAttribute("f_weaver_belongto_userid"));
		}
		if("".equals(f_weaver_belongto_usertype)){
		   f_weaver_belongto_usertype = Util.null2String((String)session.getAttribute("f_weaver_belongto_usertype"));
		}
		user = HrmUserVarify.getUser(request, response, f_weaver_belongto_userid, f_weaver_belongto_usertype) ;//需要增加的代码
		String userID = String.valueOf(user.getUID());
		int userid=user.getUID();
		if(!f_weaver_belongto_userid.equals(userID) && !"".equals(f_weaver_belongto_userid)){
		userID = f_weaver_belongto_userid;
		userid = Util.getIntValue(f_weaver_belongto_userid,0);
		}
		String belongtoshow = "";				
		RecordSet.executeSql("select * from HrmUserSetting where resourceId = "+userID);
					if(RecordSet.next()){
						belongtoshow = RecordSet.getString("belongtoshow");
					}
String userIDAll = String.valueOf(user.getUID());	
String Belongtoids =user.getBelongtoids();
int Belongtoid=0;
String[] arr2 = null;
ArrayList<String> userlist = new ArrayList();
userlist.add(userid + "");
if(!"".equals(Belongtoids)){
userIDAll = userID+","+Belongtoids;
arr2 = Belongtoids.split(",");
for(int i=0;i<arr2.length;i++){
Belongtoid = Util.getIntValue(arr2[i]);
userlist.add(Belongtoid + "");
}
}
		String usertype = "0";
if("2".equals(user.getLogintype())) usertype = "1";
String fieldid = Util.null2String(request.getParameter("fieldid"));
String currworkflowid = Util.null2String(request.getParameter("currworkflowid"));
if ("".equals(currworkflowid)) {
	currworkflowid = Util.null2String(request.getParameter("workflowid"));
}
if (!"".equals(fieldid)) {
	String newwfs[] = fieldid.split("_");
	fieldid = newwfs[0];
}

String issearch= Util.null2String(request.getParameter("issearch"));
String requestname = Util.null2String(request.getParameter("requestname"));
requestname=new String(requestname.getBytes("UTF-8"));
String creater = Util.null2String(request.getParameter("creater"));
String createdatestart = Util.null2String(request.getParameter("createdatestart"));
String createdateend = Util.null2String(request.getParameter("createdateend"));
String isrequest = Util.null2String(request.getParameter("isrequest"));
String requestmark = Util.null2String(request.getParameter("requestmark"));
String prjids = Util.null2String(request.getParameter("prjids"));
String crmids = Util.null2String(request.getParameter("crmids"));
String workflowid = Util.null2String(request.getParameter("workflowid"));
String department = Util.null2String(request.getParameter("department"));
String status = Util.null2String(request.getParameter("status"));
String subid = Util.null2String(request.getParameter("subid"));

int olddate2during = 0;
BaseBean baseBean = new BaseBean();
String date2durings = "";
try{
	date2durings = Util.null2String(baseBean.getPropValue("wfdateduring", "wfdateduring"));
} catch(Exception e) {}
String[] date2duringTokens = Util.TokenizerString2(date2durings, ",");
if (date2duringTokens.length > 0){
	olddate2during = Util.getIntValue(date2duringTokens[0], 0);
}
if (olddate2during < 0 || olddate2during > 36) {
	olddate2during = 0;
}
int date2during = Util.getIntValue(request.getParameter("date2during"), olddate2during);

List<Map<String, String>> list = null;
if (!"".equals(fieldid) && !"".equals(currworkflowid)) {
	if (Browsedatadefinition.read(currworkflowid, fieldid)) {
	   	list = Browsedatadefinition.getList();
	} else {
		list = new ArrayList<Map<String, String>>();
	}
} else {
	list = new ArrayList<Map<String, String>>();
}
String check_per = Util.null2String(request.getParameter("resourceids"));

if (isrequest.equals("")) isrequest = "1";
if(user.getLogintype().equals("2")) usertype="1";
String resourceids = "";
String resourcenames = "";
if (!check_per.equals("")) {
	if(check_per.indexOf(',')==0){
		check_per=check_per.substring(1);
	}
	String strtmp = "select requestid,requestname from workflow_requestbase  where requestid in ("+check_per+")";
	RecordSet.executeSql(strtmp);
	Hashtable ht = new Hashtable();
	while (RecordSet.next()) {
		ht.put( Util.null2String(RecordSet.getString("requestid")), Util.null2String(RecordSet.getString("requestname")));
	}
	try{
		StringTokenizer st = new StringTokenizer(check_per,",");

		while(st.hasMoreTokens()){
			String s = st.nextToken();
			if(ht.containsKey(s)){//如果check_per中的已选的流程此时不存在会出错
				resourceids +=","+s;
				resourcenames += ","+ht.get(s).toString();
			}
		}
	}catch(Exception e){
		resourceids ="";
		resourcenames ="";
	}
}

if ("".equals(isrequest)) isrequest = "1";
if ("2".equals(user.getLogintype())) usertype = "1";

if (list.size() > 0) {
	if ("".equals(issearch)) {
		String requestname01 = Browsedatadefinition.getRequestname();
		String workflowtype = Browsedatadefinition.getWorkflowtype();
		String Processnumber = Browsedatadefinition.getProcessnumber();
		String createtype = Browsedatadefinition.getCreatetype();
		String createtypeid = Browsedatadefinition.getCreatetypeid();
		String createdepttype = Browsedatadefinition.getCreatedepttype();
		String department01 = Browsedatadefinition.getDepartment();
		String createsubtype = Browsedatadefinition.getCreatesubtype();
		String createsubid = Browsedatadefinition.getCreatesubid();
		String createdatetype = Browsedatadefinition.getCreatedatetype();
		String createdatestart01 = Browsedatadefinition.getCreatedatestart();
		String createdateend01 = Browsedatadefinition.getCreatedateend();
		String xgxmtype = Browsedatadefinition.getXgxmtype();
		String xgxmid = Browsedatadefinition.getXgxmid();
		String xgkhtype = Browsedatadefinition.getXgkhtype();
		String xgkhid = Browsedatadefinition.getXgkhid();
		String gdtype = Browsedatadefinition.getGdtype();
		String jsqjtype = Browsedatadefinition.getJsqjtype();

		if("".equals(requestname)){
			requestname = requestname01;
	    }

		if("".equals(workflowid)){
	   	 	workflowid = workflowtype;
	    }

		if("".equals(requestmark)){
			requestmark = Processnumber;
		}

		if ("".equals(creater)) {
			if("1".equals(createtype)) {
				creater = ""+user.getUID();
			} else if("2".equals(createtype)) {
				creater = createtypeid;
			} else if("3".equals(createtype)) {
				creater = Util.null2String(request.getParameter("cre"));
			}
		}

		if("".equals(department)) {
			if("1".equals(createdepttype)) {
				department = ""+user.getUserDepartment();
			} else if("2".equals(createdepttype)) {
				department = department01;
			} else if("3".equals(createdepttype)) {
				department = Browsedatadefinition.getDepartment(Util.null2String(request.getParameter("dep")));
			}
		}

		if("".equals(subid)) {
			if("1".equals(createsubtype)) {
				subid = ""+user.getUserSubCompany1();
			} else if("2".equals(createsubtype)) {
				subid = ""+createsubid;
			} else if ("3".equals(createsubtype)) {
				subid = Browsedatadefinition.getSubcompany(Util.null2String(request.getParameter("sub")));
			}
		}

		if("".equals(createdatestart) && "".equals(createdateend)){
			if("2".equals(createdatetype)) {//今天
				createdatestart = ""+currentdate;
				createdateend = ""+currentdate;
			} else if("3".equals(createdatetype)) {//本周
				createdatestart = df.format(Browsedatadefinition.getMonday());
				createdateend = df.format(Browsedatadefinition.getSunday());
			} else if("4".equals(createdatetype)){//本月
				createdatestart = df.format(Browsedatadefinition.getFirstDayOfMonth());
				createdateend = df.format(Browsedatadefinition.getLastDayOfMonth());
			} else if("5".equals(createdatetype)){//本季
				createdatestart = df.format(Browsedatadefinition.getFirstDayOfQuarter());
				createdateend = df.format(Browsedatadefinition.getLastDayOfQuarter());
			} else if("6".equals(createdatetype)){//本年
				createdatestart = Browsedatadefinition.getYearDateStart();
				createdateend = Browsedatadefinition.getYearDateEnd();
			} else if("7".equals(createdatetype)){//指定日期
				createdatestart = createdatestart01;
				createdateend = createdateend01; 
			} else if("8".equals(createdatetype)) {
				createdatestart = Util.null2String(request.getParameter("date"));
				createdateend = Util.null2String(request.getParameter("date"));
			}
		} else {
			if("".equals(createdatestart)){
				createdatestart = createdatestart01;
			}
			if("".equals(createdateend)){
				createdateend = createdateend01;
			}
		}

		if("".equals(prjids)) {
			if ("2".equals(xgxmtype)) {
				prjids = xgxmid;
			} else if ("3".equals(xgxmtype)) {
				prjids = Util.null2String(request.getParameter("xgxm"));
			}
		}

		if("".equals(crmids)) {
			if ("2".equals(xgkhtype)) {
				crmids = xgkhid;
			} else if ("3".equals(xgkhtype)) {
				crmids = Util.null2String(request.getParameter("xgkh"));
			}
		}

	    if("".equals(status)){
	   	 	status = gdtype;
	    }

	    date2during = Util.getIntValue(jsqjtype,0);
	}
}
%>
<BODY scroll="no" style="overflow-x: hidden;overflow-y:hidden">
<jsp:include page="/systeminfo/commonTabHead.jsp">
 	<jsp:param name="mouldID" value="workflow"/>
	<jsp:param name="navName" value="<%=SystemEnv.getHtmlLabelName(33925,user.getLanguage())%>"/>
</jsp:include>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
	<table id="topTitle" cellpadding="0" cellspacing="0">
	<tr>
		<td>
		</td>
		<td class="rightSearchSpan" style="text-align:right;">
			<input type="button" value="<%=SystemEnv.getHtmlLabelName(197,user.getLanguage())%>" class="e8_btn_top"  onclick="javascript:btnOnSearch(),_self"/>
			<span title="<%=SystemEnv.getHtmlLabelName(33925,user.getLanguage())%>" class="cornerMenu"></span>
		</td>
	</tr>
	</table>
		<div class="zDialog_div_content">
		<FORM id=weaver name=SearchForm style="margin-bottom:0" action="MultiRequestedBrowser.jsp" method=post onsubmit="btnOnSearch();return false;">
		<input type="hidden" name="pagenum" value=''>
		<input type="hidden" name="resourceids" value="">
		<input type="hidden" name="isrequest" value='<%=isrequest%>'>
		<input type="hidden" name="issearch" id="issearch"  >
		<input type="hidden" name="currworkflowid" value="<%=currworkflowid %>">
		<input type="hidden" name="fieldid" value='<%=fieldid%>'>
		<input type="hidden" name="status" value='2'>
		<div style="width:0px;height:0px;overflow:hidden;">
				<button type=submit></BUTTON>
			</div>
		<%if (list.size() > 0) {
		for (int j = 0; j < list.size(); j++) {
			Map<String, String> map = list.get(j);
			String type = map.get("type");
			boolean isHide = Browsedatadefinition.isHide(map.get("hide"));
			String inputName = "";
			String inputValue = "";
			if (isHide) {
				if ("1".equals(type)) {%>
		<input type="hidden" name="requestname" value="<%=requestname%>" />
		<%} else if ("2".equals(type)) {%>
		<input type="hidden" name="workflowid" value="<%=workflowid%>" />
		<%} else if ("3".equals(type)) {%>
		<input type="hidden" name="requestmark" value="<%=requestmark%>" />
		<%} else if ("4".equals(type)) {%>
		<input type="hidden" name="creater" value="<%=creater%>" />
		<%} else if ("5".equals(type)) {%>
		<input type="hidden" name="department" value="<%=department%>" />
		<%} else if ("6".equals(type)) {%>
		<input type="hidden" name="subid" value="<%=subid%>" />
		<%} else if ("7".equals(type)) {%>
		<input type="hidden" name="createdatestart" value="<%=createdatestart%>" />
		<input type="hidden" name="createdateend" value="<%=createdateend%>" />
		<%} else if ("8".equals(type)) {%>
		<input type="hidden" name="prjids" value="<%=prjids%>" />
		<%} else if ("9".equals(type)) {%>
		<input type="hidden" name="crmids" value="<%=crmids%>" />
		<%} else if ("11".equals(type)) {%>
		<input type="hidden" name="date2during" value="<%=date2during%>" />
		<%}}}}%>
		
		<!--##############Right click context menu buttons START####################-->
			<DIV align=right style="display:none">
			<%
			RCMenu += "{"+SystemEnv.getHtmlLabelName(197,user.getLanguage())+",javascript:btnOnSearch(),_self} " ;
			RCMenuHeight += RCMenuHeightStep ;
			%>
			<BUTTON class=btnSearch accessKey=S type=submit><U>S</U>-<%=SystemEnv.getHtmlLabelName(197,user.getLanguage())%></BUTTON>


			<%
			RCMenu += "{"+SystemEnv.getHtmlLabelName(826,user.getLanguage())+",javascript:btn_ok(),_self} " ;
			RCMenuHeight += RCMenuHeightStep ;
			%>
			<BUTTON type="button" class=btn accessKey=O id=btnok><U>O</U>-<%=SystemEnv.getHtmlLabelName(826,user.getLanguage())%></BUTTON>

			<%
			RCMenu += "{"+SystemEnv.getHtmlLabelName(201,user.getLanguage())+",javascript:btn_cancel(),_self} " ;
			RCMenuHeight += RCMenuHeightStep ;
			%>
			<BUTTON class=btnReset accessKey=T type=reset><U>T</U>-<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>1</BUTTON>


			<%
			RCMenu += "{"+SystemEnv.getHtmlLabelName(311,user.getLanguage())+",javascript:btn_clear(),_self} " ;
			RCMenuHeight += RCMenuHeightStep ;
			%>
			<BUTTON type="button" class=btn accessKey=2 id=btnclear><U>2</U>-<%=SystemEnv.getHtmlLabelName(311,user.getLanguage())%></BUTTON>
			</DIV>
		<!--##############Right click context menu buttons END//####################-->
		
		
<div id="e8QuerySearchArea" style="overflow:auto;height: 155px;">
			<wea:layout type="4col">
				<wea:group attributes="{'groupSHBtnDisplay':'none'}" context="<%=SystemEnv.getHtmlLabelName(15774, user
									.getLanguage())%>">		
<%if(list.size()>0){%>
		<%
 				for (int j = 0; j < list.size(); j++) {
			Map<String, String> map = list.get(j);
			boolean isHide = Browsedatadefinition.isHide(map.get("hide"));
			if (isHide) {
				continue;
			}
			String type = map.get("type");
			boolean isReadonly = Browsedatadefinition.isHide(map.get("readonly"));
 				%>
			<%if ("1".equals(type)) {%>
				<wea:item><%=SystemEnv.getHtmlLabelName(26876, user.getLanguage())%></wea:item>
				<wea:item><input name="requestname" class="Inputstyle" value='<%=requestname%>' <%if(isReadonly){%>readonly="readonly"<%}%>></wea:item>
			<%} else if ("2".equals(type)) {%>
				<%if (!"2".equals(user.getLogintype())) {
					String workflowids[] = Util.TokenizerString2(workflowid, ",");
					String workflowestr = "";
					for (int i = 0; i < workflowids.length; i++) {
						if (!"".equals(workflowids[i]) && !"0".equals(workflowids[i])) {
							workflowestr += (!"".equals(workflowestr) ? "," : "")
									+ Util.null2String(WorkflowComInfo.getWorkflowname(workflowids[i]));
						}
					}
				%>
					<wea:item><%=SystemEnv.getHtmlLabelName(33806, user.getLanguage())%></wea:item>
					<wea:item><span><brow:browser viewType="0" name="workflowid"
						browserValue='<%=workflowid%>'
						browserUrl="/systeminfo/BrowserMain.jsp?url=/workflow/workflow/MutiWorkflowBrowser.jsp?selectedids="
						browserDialogHeight="650px;"
						hasInput='<%=isReadonly ? "false" : "true"%>' isSingle="false" hasBrowser="true"
						isMustInput='<%=isReadonly ? "0" : "1"%>' linkUrl="#"
						completeUrl="/data.jsp?type=workflowBrowser"
						browserSpanValue='<%=workflowestr%>'>
					</brow:browser></span></wea:item>
				<%}%>
			<%} else if ("3".equals(type)) {%>
				<wea:item><%=SystemEnv.getHtmlLabelName(714, user.getLanguage())%></wea:item>
				<wea:item><input name="requestmark" class="Inputstyle" value='<%=requestmark%>' <%if(isReadonly){%>readonly="readonly"<%}%> /></wea:item>
			<%} else if ("4".equals(type)) {
				String creates[] = Util.TokenizerString2(creater, ",");
				String createnames = "";
				for (int i = 0; i < creates.length; i++) {
					if (!"".equals(creates[i]) && !"0".equals(creates[i])) {
						createnames += (!"".equals(createnames) ? "," : "")
								+ ResourceComInfo.getResourcename(creates[i]);
					}
				}
			%>
				<%
					String hasInput = "true";
					String isMustInput = "1";
					if ("2".equals(user.getLogintype())) {
						isMustInput = "0";
						hasInput = "false";
					} else if (isReadonly) {
						isMustInput = "0";
						hasInput = "false";
					}
				%>
				<wea:item><%=SystemEnv.getHtmlLabelName(882, user.getLanguage())%></wea:item>
				<wea:item><span><brow:browser viewType="0" name="creater"
						browserValue='<%=creater%>'
						completeUrl="/data.jsp?type=1"
						browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp?resourceids="
						hasInput='<%=hasInput%>' isSingle="false" hasBrowser="true"
						isMustInput='<%=isMustInput%>' linkUrl="#"
						browserSpanValue='<%=createnames%>'>
				</brow:browser></span></wea:item>
			<%} else if ("5".equals(type)) {
				String departments[] = Util.TokenizerString2(department, ",");
				String departmentnames = "";
				for (int i = 0; i < departments.length; i++) {
					if (!"".equals(departments[i]) && !"0".equals(departments[i])) {
						departmentnames += (!"".equals(departmentnames) ? "," : "")
								+ DepartmentComInfo.getDepartmentname(departments[i]);
					}
				}
			%>
				<wea:item><%=SystemEnv.getHtmlLabelName(19225, user.getLanguage())%></wea:item>
				<wea:item><span><brow:browser viewType="0" name="department"
						browserValue='<%=department%>'
						browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/MutiDepartmentBrowser.jsp?selectedids="
						hasInput='<%=isReadonly ? "false" : "true"%>' isSingle="false" hasBrowser="true"
						completeUrl="/data.jsp?type=4"
						isMustInput='<%=isReadonly ? "0" : "1"%>' linkUrl="#"
						browserSpanValue='<%=departmentnames%>'>
				</brow:browser></span></wea:item>
			<%} else if ("6".equals(type)) {
				String subids[] = Util.TokenizerString2(subid, ",");
				String subnames = "";
				for (int i = 0; i < subids.length; i++) {
					if (!"".equals(subids[i]) && !"0".equals(subids[i])) {
						subnames += (!"".equals(subnames) ? "," : "")
								+ SubCompanyComInfo.getSubCompanyname(subids[i]);
					}
				}
			%>
				<wea:item><%=SystemEnv.getHtmlLabelName(22788, user.getLanguage())%></wea:item>
				<wea:item><span><brow:browser viewType="0" name="subid"
						browserValue='<%=subid%>'
						browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser3.jsp?selectedids="
						hasInput='<%=isReadonly ? "false" : "true"%>' isSingle="false" hasBrowser="true"
						completeUrl="/data.jsp?type=164"
						isMustInput='<%=isReadonly ? "0" : "1"%>' linkUrl="#"
						browserSpanValue='<%=subnames%>'>
				</brow:browser></span></wea:item>
			<%} else if ("7".equals(type)) {%>
				<wea:item><%=SystemEnv.getHtmlLabelName(722, user.getLanguage())%></wea:item>
				<wea:item><button type="button" class=Calendar id=selectbirthday <%if(!isReadonly){%>onclick="getTheDate(createdatestart,createdatestartspan)"<%}%>></BUTTON>
				<SPAN id=createdatestartspan><%=createdatestart%></SPAN>
	  - &nbsp;<button type="button" class=Calendar id=selectbirthday1 <%if(!isReadonly){%>onclick="getTheDate(createdateend,createdateendspan)"<%}%>></BUTTON>
				<SPAN id=createdateendspan><%=createdateend%></SPAN>
				<input type="hidden" id="createdatestart" name="createdatestart" value="<%=createdatestart%>">
				<input type="hidden" id="createdateend" name="createdateend" value="<%=createdateend%>"></wea:item>
			<%} else if ("8".equals(type)) {
				String prjidss[] = Util.TokenizerString2(prjids, ",");
				String projnames = "";
				for (int i = 0; i < prjidss.length; i++) {
					if (!"".equals(prjidss[i]) && !"0".equals(prjidss[i])) {
						projnames += (!"".equals(projnames) ? "," : "")
					 			+ ProjectInfoComInfo.getProjectInfoname(prjidss[i]);
					}
				}
			%>
				<wea:item><%=SystemEnv.getHtmlLabelName(782, user.getLanguage())%></wea:item>
				<wea:item><span><brow:browser viewType="0" name="prjids"
						browserValue='<%=prjids%>'
						browserUrl="/systeminfo/BrowserMain.jsp?url=/proj/data/MultiProjectBrowser.jsp?resourceids="
						hasInput='<%=isReadonly ? "false" : "true"%>' isSingle="false" hasBrowser="true"
						isMustInput='<%=isReadonly ? "0" : "1"%>' linkUrl="#"
						completeUrl="/data.jsp?type=8"
						browserSpanValue='<%=projnames%>'>
				</brow:browser></span></wea:item>
			<%} else if ("9".equals(type)) {
				String crmidss[] = Util.TokenizerString2(crmids, ",");
				String crmnames = "";
				for (int i = 0; i < crmidss.length; i++) {
					if (!"".equals(crmidss[i]) && !"0".equals(crmidss[i])) {
						crmnames += (!"".equals(crmnames) ? "," : "")
					 			+ crmComInfo.getCustomerInfoname(crmidss[i]);
					}
				}
			%>
				<wea:item><%=SystemEnv.getHtmlLabelName(783, user.getLanguage())%></wea:item>
				<wea:item><span><brow:browser viewType="0" name="crmids"
						browserValue='<%=crmids%>'
						browserUrl="/systeminfo/BrowserMain.jsp?url=/CRM/data/MutiCustomerBrowser.jsp?resourceids="
						hasInput='<%=isReadonly ? "false" : "true"%>' isSingle="false" hasBrowser="true"
						completeUrl="/data.jsp?type=7"
						isMustInput='<%=isReadonly ? "0" : "1"%>' linkUrl="#"
						browserSpanValue='<%=crmnames%>'>
				</brow:browser></span></wea:item>
			<%} else if ("11".equals(type)) {%>
				<wea:item><%=SystemEnv.getHtmlLabelName(31787, user.getLanguage())%></wea:item>
				<wea:item><select <%if(isReadonly){%>disabled="true"<%}%> class=inputstyle size=1 id=date2during name=date2during>
					<%
						for (int i = 0; i < date2duringTokens.length; i++) {
							int tempdate2during = Util.getIntValue(date2duringTokens[i], 0);
							if (tempdate2during > 36 || tempdate2during < 1) {
								continue;
							}
					%>
					<!-- 最近个月 -->
					<option value="<%=tempdate2during%>" <%if (date2during == tempdate2during) {%> selected <%}%>><%=SystemEnv.getHtmlLabelName(24515,user.getLanguage())%><%=tempdate2during%><%=SystemEnv.getHtmlLabelName(26301,user.getLanguage())%></option>
					<%}%>
					<!-- 全部 -->
					<option value="38" <%if (date2during == 38) {%> selected <%}%>><%=SystemEnv.getHtmlLabelName(332, user.getLanguage())%></option>
				</select></wea:item>
			<%}%>
		<%}%>
<%}else{%>
    <!-- 请求标题 -->
    <wea:item><%=SystemEnv.getHtmlLabelName(26876, user.getLanguage())%></wea:item>
	<wea:item><input name="requestname" class="Inputstyle" value='<%=requestname%>'></wea:item>
	<!-- 路径类型 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(33806, user.getLanguage())%></wea:item>
	<wea:item>
		<span> <brow:browser viewType="0" name="workflowid"
				browserValue='<%=workflowid%>'
				browserUrl="/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkflowBrowser.jsp"
				hasInput="true" isSingle="true" hasBrowser="true"
				isMustInput='1' linkUrl="#" width="80%"
				completeUrl="/data.jsp?type=workflowBrowser"
				browserSpanValue='<%=WorkflowComInfo
								.getWorkflowname(workflowid)%>'></brow:browser>
		</span>
	</wea:item>
	<!-- 流程编号 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(19502, user.getLanguage())%></wea:item>
	<wea:item>
		<input name=requestmark class=Inputstyle value="<%=requestmark%>">
	</wea:item>
	<!-- 创建人 -->
	<wea:item>
	<%
		if (!user.getLogintype().equals("2")) {
	%>
		<%=SystemEnv.getHtmlLabelName(882, user.getLanguage())%>
	<%
		}
	%>
	</wea:item>
	<wea:item>
	<%
		if (!user.getLogintype().equals("2")) {
	%>
		<span> 
		 	<brow:browser viewType="0" name="creater" browserValue='<%=creater%>' completeUrl="/data.jsp?type=1"
			browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp" hasInput="true" isSingle="false" hasBrowser="true"
			isMustInput='1' linkUrl="#" width="80%" browserSpanValue='<%=Util.toScreen(ResourceComInfo.getResourcename(creater),user.getLanguage())%>'>
			</brow:browser>
		</span>
	<%
		}
	%>
	</wea:item>
	<!-- 创建人部门 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(19225, user.getLanguage())%></wea:item>
	<wea:item>
		<span> 
		<%
 		String departments[] = Util.TokenizerString2(department, ",");
 		String departmentnames = "";
 		for (int i = 0; i < departments.length; i++) {
 			if (!departments[i].equals("")&& !departments[i].equals("0")) {
 				departmentnames += (!departmentnames.equals("") ? "," : "")+ DepartmentComInfo.getDepartmentname(departments[i]);
 			}
 		}
 		%> 
 		<brow:browser viewType="0" name="department" browserValue='<%=department%>'
		browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/MutiDepartmentBrowser.jsp"
		hasInput="true" isSingle="false" hasBrowser="true" completeUrl="/data.jsp?type=4"
		isMustInput='1' linkUrl="#" width="80%" browserSpanValue='<%=departmentnames%>'>
		</brow:browser> 
		</span>
	</wea:item>
	<!-- 创建人分部 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(22788, user.getLanguage())%></wea:item>
	<wea:item>
		<%
			String subids[] = Util.TokenizerString2(subid, ",");
			String subnames = "";
			for (int i = 0; i < subids.length; i++) {
				if (!"".equals(subids[i]) && !"0".equals(subids[i])) {
					subnames += (!"".equals(subnames) ? "," : "")
							+ SubCompanyComInfo.getSubCompanyname(subids[i]);
				}
			}
		%>
		<span>
			<brow:browser viewType="0" name="subid"
				browserValue='<%=subid%>'
				browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser3.jsp?selectedids="
				hasInput='true' isSingle="false" hasBrowser="true"
				completeUrl="/data.jsp?type=164"
				isMustInput='1' linkUrl="#"
				browserSpanValue='<%=subnames%>'>
			</brow:browser>
		</span>
	</wea:item>
	<!-- 创建日期 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(722, user.getLanguage())%></wea:item>
	<wea:item>
			<button type="button" class=Calendar id=selectbirthday onclick="getTheDate(createdatestart,createdatestartspan)"></BUTTON>
			<SPAN id=createdatestartspan><%=createdatestart%></SPAN>
			-&nbsp;
			<button type="button" class=Calendar id=selectbirthday1 onclick="getTheDate(createdateend,createdateendspan)"></BUTTON>
			<SPAN id=createdateendspan><%=createdateend%></SPAN>
			<input type="hidden" id=createdatestart name="createdatestart" value="<%=createdatestart%>">
			<input type="hidden" id=createdateend name="createdateend" value="<%=createdateend%>">
	</wea:item>
	<!-- 相关项目 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(782, user.getLanguage())%></wea:item>
	<wea:item>
		<%
			String prjidss[] = Util.TokenizerString2(prjids, ",");
			String projnames = "";
			for (int i = 0; i < prjidss.length; i++) {
				if (!"".equals(prjidss[i]) && !"0".equals(prjidss[i])) {
					projnames += (!"".equals(projnames) ? "," : "")
				 			+ ProjectInfoComInfo.getProjectInfoname(prjidss[i]);
				}
			}
		%>
		<span>
			<brow:browser viewType="0" name="prjids"
				browserValue='<%=prjids%>'
				browserUrl="/systeminfo/BrowserMain.jsp?url=/proj/data/MultiProjectBrowser.jsp?resourceids="
				hasInput='true' isSingle="false" hasBrowser="true"
				isMustInput='1' linkUrl="#"
				completeUrl="/data.jsp?type=8"
				browserSpanValue='<%=projnames%>'>
			</brow:browser>
		</span>
	</wea:item>
	<!-- 相关项目 -->
	<wea:item><%=SystemEnv.getHtmlLabelName(783, user.getLanguage())%>
	</wea:item>
	<wea:item>
		<%
			String crmidss[] = Util.TokenizerString2(crmids, ",");
			String crmnames = "";
			for (int i = 0; i < crmidss.length; i++) {
				if (!"".equals(crmidss[i]) && !"0".equals(crmidss[i])) {
					crmnames += (!"".equals(crmnames) ? "," : "")
				 			+ crmComInfo.getCustomerInfoname(crmidss[i]);
				}
			}
		%>
		<span>
			<brow:browser viewType="0" name="crmids"
					browserValue='<%=crmids%>'
					browserUrl="/systeminfo/BrowserMain.jsp?url=/CRM/data/MutiCustomerBrowser.jsp?resourceids="
					hasInput='true' isSingle="false" hasBrowser="true"
					completeUrl="/data.jsp?type=7"
					isMustInput='1' linkUrl="#"
					browserSpanValue='<%=crmnames%>'>
			</brow:browser> 
		</span>
	</wea:item>
	<%
		if (date2duringTokens.length > 0) {
	%>
	<wea:item><%=SystemEnv.getHtmlLabelName(31787, user.getLanguage())%>
	</wea:item>
	<wea:item>
		<select class=inputstyle size=1 id=date2during name=date2during>
			<%
				for (int i = 0; i < date2duringTokens.length; i++) {
										int tempdate2during = Util.getIntValue(
												date2duringTokens[i], 0);
										if (tempdate2during > 36
												|| tempdate2during < 1) {
											continue;
										}
			%>
			<!-- 最近个月 -->
			<option value="<%=tempdate2during%>"
				<%if (date2during == tempdate2during) {%> selected <%}%>><%=SystemEnv.getHtmlLabelName(24515,
									user.getLanguage())%><%=tempdate2during%><%=SystemEnv.getHtmlLabelName(26301,
									user.getLanguage())%></option>
			<%
				}
			%>
			<!-- 全部 -->
			<option value="38" <%if (date2during == 38) {%> selected <%}%>><%=SystemEnv.getHtmlLabelName(332, user
								.getLanguage())%></option>
		</select>
	</wea:item>
	<%
		}
	%>
<%} %>
</wea:group>
</wea:layout>
</div>
<wea:layout>
<wea:group context="" attributes="{'groupDisplay':'none'}">
	<wea:item attributes="{'isTableList':'true','colspan':'full'}">
		<div id="dialog">
			<div id='colShow'></div>
		</div>
	</wea:item>
</wea:group>
</wea:layout>
<input type="hidden" name="f_weaver_belongto_userid" value="<%=request.getParameter("f_weaver_belongto_userid") %>">
			<input type="hidden" name="f_weaver_belongto_usertype" value="<%=request.getParameter("f_weaver_belongto_usertype") %>">
</FORM>
</div>
<script type="text/javascript">
		var parentWin = null;
		var dialog = null;
		var config = null;
		try {
			parentWin = parent.parent.getParentWindow(parent);
			dialog = parent.parent.getDialog(parent);
		} catch (e) {
		}
		function showMultiRequestDialog(selectids) {
			config = rightsplugingForBrowser.createConfig();
			config.srchead = [ "<%=SystemEnv.getHtmlLabelName(33569, user.getLanguage())%>", "<%=SystemEnv.getHtmlLabelName(882, user.getLanguage())%>", "<%=SystemEnv.getHtmlLabelName(1339, user.getLanguage())%>" ];
			config.container =$("#colShow");
		    config.searchLabel="";
		    config.hiddenfield="requestid";
		    config.saveLazy = true;//取消实时保存
		    config.saveurl= "/workflow/request/MultiRequestBrowserAjax.jsp?f_weaver_belongto_userid=<%=userid%>&f_weaver_belongto_usertype=<%=usertype%>&src=save";
		    config.srcurl = "/workflow/request/MultiRequestBrowserAjax.jsp?f_weaver_belongto_userid=<%=userid%>&f_weaver_belongto_usertype=<%=usertype%>&src=src";
		    config.desturl = "/workflow/request/MultiRequestBrowserAjax.jsp?f_weaver_belongto_userid=<%=userid%>&f_weaver_belongto_usertype=<%=usertype%>&src=dest";
		    config.delteurl= "/workflow/request/MultiRequestBrowserAjax.jsp?f_weaver_belongto_userid=<%=userid%>&f_weaver_belongto_usertype=<%=usertype%>&src=save";
		    config.pagesize = 10;
		    config.formatCallbackFn = function(config,destMap,destMapKeys){
		         var ids="",names="";
		         var nameKey = destMap["__nameKey"];
		         for(var i=0;destMapKeys&&i<destMapKeys.length;i++){	              
						var key = destMapKeys[i];
						var dataitem = destMap[key];
						var name = dataitem[nameKey];
						if(name.indexOf("<B>")!=-1){
						   name = name.substring(0,name.indexOf("<B>"));
						}
						if(ids==""){
							ids = key;
						}else{
							ids = ids+","+key;
						}
						if(names==""){
		        			names = name;
		        		}else{
		        			names=names + ","+name;
		        		}
				}
		         return {id:ids,name:names};
		    },
		    config.formId = "weaver";
		    config.selectids = selectids;
		    config.searchAreaId = "e8QuerySearchArea";
			try{
				config.dialog = dialog;
			}catch(e){
			   console.log(e);
			}
		   	jQuery("#colShow").html("");
		    rightsplugingForBrowser.createRightsPluing(config);
		    
		    jQuery("#btn_Ok").bind("click",function(){
		    	rightsplugingForBrowser.system_btnok_onclick(config);
		    });
		    jQuery("#btn_Clear").bind("click",function(){
				rightsplugingForBrowser.system_btnclear_onclick(config);
		    });
		    jQuery("#btn_Cancel").bind("click",function(){	    	
				rightsplugingForBrowser.system_btncancel_onclick(config);
		    });
		    jQuery("#btn_Search").bind("click",function(){
		    	rightsplugingForBrowser.system_btnsearch_onclick(config);
		    });
		}
		function btnOnSearch(){
		    jQuery("#btn_Search").trigger("click");
		}
		
		function onClose(){
			try{
				if(dialog){
					jQuery("#btn_Cancel").trigger("click");
				}else{
					window.parent.close();
				}
			}catch(e){
				window.parent.close();
			}
		}
		function onReset(){
			SearchForm.reset();
		}
		function doSearch()
		{
		    //document.getElementById("issearch").value="issearch";
			//setResourceStr();
		    //document.all("resourceids").value = resourceids.substring(1) ;
		    //document.SearchForm.submit();
		    btnOnSearch();
		}
		jQuery(document).ready(function(){
			showMultiRequestDialog("<%=resourceids%>");
		});
		
		function btn_ok(){
	        jQuery("#btn_Ok").trigger("click");
	    }
		function btn_search(){
        	jQuery("#btn_Search").trigger("click");
    	}
		function btn_cancel(){
        	jQuery("#btn_Cancel").trigger("click");
   		}
		function btn_clear(){
        	jQuery("#btn_Clear").trigger("click");
        }
	</script>
		<div id="zDialog_div_bottom" class="zDialog_div_bottom"  style="padding:0px!important;">
		<div style="padding:5px 0px;">
			<wea:layout needImportDefaultJsAndCss="false">
				<wea:group context="" attributes='{\"groupDisplay\":\"none\"}'>
					<wea:item type="toolbar">
						<input type="button" style="display: none;" class=zd_btn_submit
							accessKey=S id=btn_Search
							value="S-<%=SystemEnv.getHtmlLabelName(197, user
										.getLanguage())%>"></input>
						<input type="button" class=zd_btn_submit accessKey=O id=btn_Ok
							value="O-<%=SystemEnv.getHtmlLabelName(826, user
										.getLanguage())%>"></input>
						<input type="button" class=zd_btn_submit accessKey=2 id=btn_Clear
							value="2-<%=SystemEnv.getHtmlLabelName(311, user
										.getLanguage())%>"></input>
						<input type="button" class=zd_btn_cancle accessKey=T id=btn_Cancel
							value="T-<%=SystemEnv.getHtmlLabelName(201, user
										.getLanguage())%>"></input>
					</wea:item>
				</wea:group>
			</wea:layout>
			</div>
</div>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<jsp:include page="/systeminfo/commonTabFoot.jsp"></jsp:include>
</BODY></HTML>

<script>

function onShowWorkFlow2(inputname, spanname) {
	var retValue = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/workflow/workflow/MutilWorkflow_Browser.jsp", "", "dialogWidth:550px;dialogHeight:550px;");
	if (retValue != null) {
		if (wuiUtil.getJsonValueByIndex(retValue, 0) != "" ) {
			$G(spanname).innerHTML = wuiUtil.getJsonValueByIndex(retValue, 1).substr(1,wuiUtil.getJsonValueByIndex(retValue, 1).length);
			$G(inputname).value = wuiUtil.getJsonValueByIndex(retValue, 0).substr(1,wuiUtil.getJsonValueByIndex(retValue, 0).length);
		} else { 
			$G(inputname).value = "";
			$G(spanname).innerHTML = "";
		}
	}
}



 function BrowseTable_onmouseover(event){
    var eventObj =event.srcElement ? event.srcElement : event.target;
	if(eventObj.tagName =='TD'){
		jQuery(eventObj).parents("tr:first")[0].className="Selected";
	}else if (eventObj.tagName == 'A'){
		jQuery(eventObj).parents("tr:first")[0].className="Selected";
	}
 }
 
 function BrowseTable_onmouseout(event){
    var eventObj =event.srcElement ? event.srcElement : event.target;
	if(eventObj.tagName =='TD'||eventObj.tagName == 'A'){
		var trObj =jQuery(eventObj).parents("tr:first")[0];
		if(trObj.rowIndex%2 == 0)
			trObj.className ="DataLight";
		else
			trObj.className ="DataDark";
	}
 }
 
 function BrowseTable_onclick(event){
    var e =event.srcElement ? event.srcElement : event.target;
	if(e.tagName == "TD" || e.tagName == "A"){
		//var newEntry = e.parentElement.cells(0).innerText+"~"+e.parentElement.cells(1).innerText ;
		var node = $(e).closest("tr").children("td:first");
		var newEntry = $(node).text();
		newEntry = newEntry + "~" +  $(node).next().text();
		if(!isExistEntry(newEntry,resourceArray)){
			addObjectToSelect(document.all("srcList"),newEntry);
			reloadResourceArray();
		}
	}
 }
 
 function btnok_onclick(){
	 setResourceStr();
	 var returnjson = {id:resourceids,name:resourcenames};
     if(dialog){
	    try{
	        dialog.callback(returnjson);
	    }catch(e){}
		try{
	        dialog.close(returnjson);
		}catch(e){}
	}else{ 
	   	window.parent.returnValue = returnjson;
		window.parent.close();
	 }
 }
 function btnclear_onclick(){
 	var returnjson = {id:"",name:"",fieldtype:"",options:""}; 
	if(dialog){
	    try{
	        dialog.callback(returnjson);
	    }catch(e){}
		try{
	        dialog.close(returnjson);
		}catch(e){}
	}else{ 
	   	window.parent.returnValue = returnjson;
		window.parent.close();
	 }
 }
 function btncancel_onclick(){
	if(dialog) {
		dialog.close();
	} else { 
	    window.parent.close();
   	}
 }
 
 jQuery("#BrowseTable").bind("mouseover",BrowseTable_onmouseover);
 jQuery("#BrowseTable").bind("mouseout",BrowseTable_onmouseout);
 jQuery("#BrowseTable").bind("click",BrowseTable_onclick);
 
 jQuery("#btnok").bind("click",btnok_onclick);
 jQuery("#btnclear").bind("click",btnclear_onclick);
 
 function onShowManagerID(inputname,spanname){
	var results = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp");
	if (results) {
	  if (results.id!=""){
		 //update by liaodong for qc57566 in 20130906 start
		 //spanname.innerHTML = "<A href='/hrm/resource/HrmResource.jsp?id="+results.id+"' target='_blank'>"+results.name+"</A>"
		   spanname.innerHTML = results.name;
		 //end
		inputname.value=results.id
	  }else{
		spanname.innerHTML = ""
		inputname.value=""
	  }
   }
  }
  
 
function onShowBranch(inputename,tdname){
	var ids = jQuery("#"+inputename).val();            
	var datas=null;
	var iTop = (window.screen.availHeight-30-550)/2+"px"; //获得窗口的垂直位置;
	var iLeft = (window.screen.availWidth-10-550)/2+"px"; //获得窗口的水平位置; 
	datas = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser3.jsp?selectedids="+ids+"&selectedDepartmentIds="+ids);
    
    if (datas){
	    if (datas.id!= "" ){
	    	var ids=datas.id.slice(1).split(",");
	    	var names=datas.name.slice(1).split(",");
	    	var i=0;
	    	var strs="";
            for(i=0;i<ids.length;i++){
                strs=strs+""+names[i]+"&nbsp;";
            }
			jQuery("#"+tdname).html(strs);
			jQuery("#"+inputename).val(datas.id.slice(1));
		}
		else{
			jQuery("#"+tdname).html("");
			jQuery("#"+inputename).val("");
		}
	}
}
  function onShowManagerID2(inputename,tdname){
  var ids = jQuery("#"+inputename).val();    
	var datas = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp?resourceids="+ids);
	if (datas) {
	  if (datas.id!= "" ){
	    	var ids=datas.id.slice(1).split(",");
	    	var names=datas.name.slice(1).split(",");
	    	var i=0;
	    	var strs="";
            for(i=0;i<ids.length;i++){
                strs=strs+""+names[i]+"&nbsp;";
            }
			jQuery("#"+tdname).html(strs);
			jQuery("#"+inputename).val(datas.id.slice(1));
		}
		else{
			jQuery("#"+tdname).html("");
			jQuery("#"+inputename).val("");
		}
   }
  } 
  
  function onShowDepartment(){
	var results = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/company/MutiDepartmentBrowser.jsp?selectedids="+$G("department").value)    
    if (results) {
		if (results.id!="") {
		  $G("departmentspan").innerHTML =results.name.substr(1);
		  $G("department").value=results.id.substr(1);
		}else{
		  $G("departmentspan").innerHTML ="";
		  $G("department").value="";
		}
     }		
  }
  
  function onShowPrjids(){
	var results = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/proj/data/ProjectBrowser.jsp");
	if (results) {
	    if (results.id!="") {
		  $G("prjidsspan").innerHTML =results.name;
		  $G("prjids").value=results.id;
		}else{
		  $G("prjidsspan").innerHTML ="";
		  $G("prjids").value="";
	   }
	}
  }
  
</script>

<script language="javascript">
resourceids = "<%=resourceids%>";
resourcenames = "<%=resourcenames%>";

//Load
var resourceArray = new Array();
for(var i =1;i<resourceids.split(",").length;i++){
	
	resourceArray[i-1] = resourceids.split(",")[i]+"~"+resourcenames.split(",")[i];
	//alert(resourceArray[i-1]);
}

loadToList();
function loadToList(){
	var selectObj = document.all("srcList");
	for(var i=0;i<resourceArray.length;i++){
		addObjectToSelect(selectObj,resourceArray[i]);
	}
}

function addObjectToSelect(obj,str){
	if(!!!obj || obj.tagName != "SELECT") return;
	var oOption = document.createElement("OPTION");
	obj.options.add(oOption);
	//oOption.value = str.split("~")[0];
	$(oOption).val(str.split("~")[0]);
	//oOption.innerText = str.split("~")[1];
	$(oOption).text(str.split("~")[1]);
	
}

function isExistEntry(entry,arrayObj){
	for(var i=0;i<arrayObj.length;i++){
		if(entry == arrayObj[i].toString()){
			return true;
			
		}
	}
	return false;
}

function upFromList(){
	var destList  = document.all("srcList");
	//var len = destList.options.length;
	var len = $(destList).children("option").size();
	for(var i = 0; i <= (len-1); i++) {
		if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
			if(i>0 && destList.options[i-1] != null){
				fromtext = destList.options[i-1].text;
				fromvalue = destList.options[i-1].value;
				totext = destList.options[i].text;
				tovalue = destList.options[i].value;
				destList.options[i-1] = new Option(totext,tovalue);
				destList.options[i-1].selected = true;
				destList.options[i] = new Option(fromtext,fromvalue);		
			}
      }
   }
   reloadResourceArray();
}
function addToList(){
	var str = document.all("forAddSingleClick").value;
	if(!isExistEntry(str,resourceArray)&&str!=""){
		addObjectToSelect(document.all("srcList"),str);
		document.all("forAddSingleClick").value="";
	}		
	reloadResourceArray();
}
function addAllToList(){
	var table =$("#BrowseTable");
	$("#BrowseTable").find("tr").each(function(){
		var str=$($(this)[0].cells[0]).text()+"~"+$($(this)[0].cells[1]).text();
		if(!isExistEntry(str,resourceArray))
			addObjectToSelect($("select[name=srcList]")[0],str);
	});
	reloadResourceArray();
}

function def(obj){
	if(obj==null||obj=="undefined"||obj=="")return false;
	return true;
}

function deleteFromList(){
	var destList  = document.all("srcList");
	var options = $(destList).children("option");
	options.each(function(){
		if(def($(this).attr("selected"))){
			$(this).remove();
		}
	});
	$(destList).closest("select").attr("style", "width:100%");
	reloadResourceArray();
}
function deleteAllFromList(){
	var destList  = document.all("srcList");
	var options = $(destList).children("option");
	var len = options.size();
	for(var i = (len-1); i >= 0; i--) {
	if ($(options[i]) != null) {
	         $(options[i]).remove();
		  }
	}
	reloadResourceArray();
}
function downFromList(){
	var destList  = document.all("srcList");
	
	var len = destList.options.length;
	for(var i = (len-1); i >= 0; i--) {
		if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
			if(i<(len-1) && destList.options[i+1] != null){
				fromtext = destList.options[i+1].text;
				fromvalue = destList.options[i+1].value;
				totext = destList.options[i].text;
				tovalue = destList.options[i].value;
				destList.options[i+1] = new Option(totext,tovalue);
				destList.options[i+1].selected = true;
				destList.options[i] = new Option(fromtext,fromvalue);		
			}
      }
   }
   reloadResourceArray();
}
//reload resource Array from the List
function reloadResourceArray(){
	resourceArray = new Array();
	var destList = document.all("srcList");
	var options = $(destList).children("option");
	for(var i=0;i<options.size();i++){
		
		resourceArray[i] = $(options[i]).val()+"~"+$(options[i]).text();//destList.options[i].value+"~"+destList.options[i].text ;
	}
	//alert(resourceArray.length);
}

function setResourceStr(){
	
	resourceids ="";
	resourcenames = "";
	for(var i=0;i<resourceArray.length;i++){
		resourceids += ","+resourceArray[i].split("~")[0] ;
		resourcenames += ","+resourceArray[i].split("~")[1] ;
	}
	//alert(resourceids+"--"+resourcenames);
	document.all("resourceids").value = resourceids.substring(1)
}

function doSearch()
{
    document.getElementById("issearch").value="issearch";
	setResourceStr();
    //document.all("resourceids").value = resourceids.substring(1) ;
    document.SearchForm.submit();
}

jQuery(document).ready(function(){
	resizeDialog(document);
});

jQuery(".e8_sep_line:eq(0)").hide();
</SCRIPT>
<script type="text/javascript" src="/js/browser/WorkFlowBrowser_wev8.js"></script>
<SCRIPT language="javascript"  defer="defer" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript"  src="/js/selectDateTime_wev8.js"></script>
<SCRIPT language="javascript" defer="defer" src='/js/JSDateTime/WdatePicker_wev8.js?rnd="+Math.random()+"'></script>