pageExpandBrowser.jsp 7.23 KB
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="weaver.formmode.virtualform.VirtualFormHandler"%>
<%
	if (!HrmUserVarify.checkUserRight("FORMMODEAPP:ALL", user)) {
		response.sendRedirect("/notice/noright.jsp");
		return;
	}
%>
<%
	int customSearchId = Util.getIntValue(Util.null2String(request.getParameter("customsearchid")), 0);
	String expendname = Util.null2String(request.getParameter("expendname"));
	int modeid = 0;
	int formid = 0;
	if(customSearchId>0){
		RecordSet rs = new RecordSet();
		String sql = "select modeid,formid from mode_customsearch where id = " + customSearchId;
		rs.executeSql(sql);
		while(rs.next()){
			modeid = Util.getIntValue(rs.getString("modeid"), 0);
			formid = Util.getIntValue(rs.getString("formid"),0);
		}
	}
%>

<HTML>
<HEAD>
    <LINK REL=stylesheet type=text/css HREF=/css/Weaver_wev8.css>
    <SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
    <script>
    var parentWin = null;
	var dialog = null;
	try{
		parentWin = parent.parent.getParentWindow(parent);
		dialog = parent.parent.getDialog(parent);
	}catch(e){}
    </script>
</HEAD>
<body>
<%
    String imagefilename = "/images/hdMaintenance_wev8.gif";
    String titlename = SystemEnv.getHtmlLabelNames("19422,30090", user.getLanguage());
    String needfav = "";
    String needhelp = "";
%>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
    RCMenu += "{" + SystemEnv.getHtmlLabelName(197, user.getLanguage()) + ",javascript:doSearch(),_self} ";//搜索
    RCMenuHeight += RCMenuHeightStep;

    RCMenu += "{" + SystemEnv.getHtmlLabelName(309, user.getLanguage()) + ",javascript:onClose(),_self} ";//关闭
    RCMenuHeight += RCMenuHeightStep;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<jsp:include page="/systeminfo/commonTabHead.jsp">
   <jsp:param name="mouldID" value="formmode"/>
   <jsp:param name="navName" value="<%=SystemEnv.getHtmlLabelNames("172,19422,30090", user.getLanguage()) %>"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
	<tr>
		<td class="rightSearchSpan" style="text-align:right;">
			<input type="button" class="e8_btn_top" value="<%=SystemEnv.getHtmlLabelName(197,user.getLanguage()) %>" onclick="javascript:doSearch(this)"/>				
			<span title="<%=SystemEnv.getHtmlLabelName(81804,user.getLanguage())%>" class="cornerMenu"></span><!-- 菜单 -->
		</td>
	</tr>
</table>
<div class="zDialog_div_content">
	<form name="expandbrowserform" method="post" action="pageExpandBrowser.jsp">
	<input type="hidden" name="customsearchid" id="customsearchid" value="<%=customSearchId %>">
	<wea:layout>
		<wea:group context="" attributes="{groupDisplay:none}">
			<wea:item><%=SystemEnv.getHtmlLabelName(30170,user.getLanguage())%><!-- 扩展名称 --></wea:item>
			<wea:item><input class="inputstyle" id="expendname" name="expendname" type="text" value="<%=expendname%>" style="width:80%"></wea:item>
		</wea:group>
	</wea:layout>
	<%
	String sqlWhere = " where a.modeid = b.id ";
	sqlWhere += " and a.modeid = '"+modeid+"'";
	sqlWhere += " and a.isbatch = 0 and (a.issystemflag not in (1,2,10,6,8) or a.issystemflag is null)";
	sqlWhere += " and (a.issystem = 1 or (a.issystem = 0 and a.viewpage = 1))";
	
	if(!expendname.equals("")){
		sqlWhere += " and a.expendname like '%"+expendname+"%' ";
	}
	if(VirtualFormHandler.isVirtualForm(formid)){
	 	sqlWhere += " and (a.issystemflag not in (3,4,5,9,100,8)  or a.issystemflag is null)";
	}
	String perpage = "10";
	String backFields = "a.id,a.modeid,a.expendname,a.showtype,a.hrefid,a.hreftype,a.hreftarget,a.opentype,a.isshow,a.showorder,a.isbatch,a.issystem,a.issystemflag,b.modename ";
	String sqlFrom = "from mode_pageexpand a,modeinfo b ";
	String tableString=""+
		"<table  pagesize=\""+perpage+"\" tabletype=\"none\">"+
			"<sql backfields=\""+backFields+"\" sqlform=\""+sqlFrom+"\" sqlprimarykey=\"a.id\" sqlsortway=\"desc\" sqldistinct=\"true\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\"/>"+
				"<head>"+
					//扩展名称     
					"<col width=\"35%\"  text=\""+SystemEnv.getHtmlLabelName(30170,user.getLanguage())+"\" column=\"expendname\" orderkey=\"expendname\"  otherpara=\"column:id+column:issystem+column:issystemflag+"+user.getLanguage()+"\" transmethod=\"weaver.formmode.interfaces.InterfaceTransmethod.getExpandNameWithoutUrl\"/>"+
					//扩展类型
					"<col width=\"20%\"  text=\""+SystemEnv.getHtmlLabelName(81468,user.getLanguage())+"\" column=\"issystem\" orderkey=\"issystem\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.interfaces.InterfaceTransmethod.getExpandType\"/>"+
					//扩展用途
					"<col width=\"25%\"  text=\""+SystemEnv.getHtmlLabelName(81469,user.getLanguage())+"\" column=\"isbatch\" orderkey=\"isbatch\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.interfaces.InterfaceTransmethod.getIsBatch\"/>"+
					//打开方式
					"<col width=\"20%\"  text=\""+SystemEnv.getHtmlLabelName(30173,user.getLanguage())+"\" column=\"opentype\" orderkey=\"opentype\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.formmode.interfaces.InterfaceTransmethod.getOpenType\"/>"+
					//隐藏值
					"<col hide=\"true\"  text=\"\" column=\"id\" name=\"pageExpandExist\" otherpara=\""+customSearchId+"+"+user.getLanguage()+"\" transmethod=\"weaver.formmode.interfaces.InterfaceTransmethod.pageExpandExist\"/>"+
					"<col hide=\"true\"  text=\"\" column=\"expendname\" name=\"expendName\" />"+
				"</head>"+
		"</table>";
	%>
	<wea:SplitPageTag  tableString='<%=tableString%>'  mode="run" isShowTopInfo="true"/>
	</form>
</div>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout type="2col" needImportDefaultJsAndCss="false">
	<wea:group context="">
		<wea:item type="toolbar">
			<input type="button" class=zd_btn_submit accessKey=T  id=btncancel onclick="onClose();"  value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>">
		</wea:item>
	</wea:group>
</wea:layout>
</div>

<script language=javascript>
    jQuery(document).ready(function(){
    	resizeDialog();
    	jQuery("#_xTable").bind("click",BrowseTable_onclick);
    })
    
    function doSearch(){
    	enableAllmenu();
    	document.expandbrowserform.submit();
    }
    
    function onClose() {
        if(dialog){
		    dialog.close();
		}else{  
		    window.parent.parent.close();
		}
    }
    
	function BrowseTable_onclick(e){
		var e=e||event;
		var target=e.srcElement||e.target;
	
		if( target.nodeName =="TD"||target.nodeName =="A"  ){
			var tr = jQuery(target).closest("tr");
			var pageExpandExist = tr.find("td[name='pageExpandExist']").text();
			if(pageExpandExist == "true"){
				top.Dialog.alert("不能重复添加!");
			}else{
				var idValue = tr.find("input[type='checkbox']").val();
				var nameValue = tr.find("td[name='expendName']").text();
				var returnjson = {id:idValue,name:nameValue};
				if(dialog){
					 try{
					     dialog.callback(returnjson);
					 }catch(e){}
					 try{
					     dialog.close(returnjson);
					 }catch(e){}
				}else{
					window.parent.parent.returnValue=returnjson;
					window.parent.parent.close();
				}
			}
		}
	}
</script>
<jsp:include page="/systeminfo/commonTabFoot.jsp"></jsp:include>
</body>
</html>