batch_topic_m.jsp

来自「oa 源码」· JSP 代码 · 共 956 行 · 第 1/3 页

JSP
956
字号
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="com.redmoon.forum.OnlineInfo"%>
<%@ page import="cn.js.fan.db.*"%>
<%@ page import="cn.js.fan.web.*"%>
<%@ page import="cn.js.fan.util.*"%>
<%@ page import="com.redmoon.forum.*"%>
<%@ page import="com.redmoon.forum.ui.*"%>
<%@ page import="java.util.*"%>
<%@ page import="cn.js.fan.web.Global"%>
<%@ page import="com.redmoon.forum.person.*"%>
<%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
<%
String skincode = UserSet.getSkin(request);
if (skincode.equals(""))
	skincode = UserSet.defaultSkin;
SkinMgr skm = new SkinMgr();
Skin skin = skm.getSkin(skincode);
if (skin==null)
	skin = skm.getSkin(UserSet.defaultSkin);
String skinPath = skin.getPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<LINK href="../common.css" type=text/css rel=stylesheet>
<LINK href="admin/default.css" type=text/css rel=stylesheet>
<link href="<%=skinPath%>/skin.css" rel="stylesheet" type="text/css">
<script src="../inc/calendar.js"></script>
<script src="../inc/common.js"></script>
<script language="javascript">
function advanceoptionShow(obj){
	if(advanceoption.style.display == "none"){
		obj.value = "1";
		advanceoption.style.display = ""
	}else{
		obj.value = "0";
		advanceoption.style.display = "none"
	}
}

function loadThreadFollow(b_id,t_id,getstr){
	var targetImg2 =eval("document.all.followImg" + t_id);
	var targetTR2 =eval("document.all.follow" + t_id);
	if (targetImg2.src.indexOf("nofollow")!=-1){return false;}
	if ("object"==typeof(targetImg2)){
		if (targetTR2.style.display!="")
		{
			targetTR2.style.display="";
			targetImg2.src="images/minus.gif";
			if (targetImg2.loaded=="no"){
				document.frames["hiddenframe"].location.replace("listtree.jsp?id="+b_id+getstr);
			}
		}else{
			targetTR2.style.display="none";
			targetImg2.src="images/plus.gif";
		}
	}
}
</script>
</head>

<body>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
<%
		if (!privilege.isMasterLogin(request))
		{
			out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
			return;
		}
		
		String operation = ParamUtil.get(request, "operation");
		if(!operation.trim().equals("")){
			MsgMgr mm = new MsgMgr();
			
			if (operation.equals("moveBoard")) {
			    String strIds = ParamUtil.get(request, "ids");
				String selToBoard = ParamUtil.get(request, "selToBoard");
				String[] idsary = StrUtil.split(strIds, ",");
				if (idsary!=null) {
					int len = idsary.length;
					for (int i=0; i<len; i++) {
						try {
							mm.ChangeBoard(request, Long.parseLong(idsary[i]), selToBoard);
						}
						catch (ErrMsgException e) {
							out.print(StrUtil.Alert(e.getMessage()));
							return;
						}
					}
				}
                out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "batch_topic_m.jsp"));
			}
			
			if (operation.equals("moveThreadType")) {
			    String strIds = ParamUtil.get(request, "ids");
				String toTxtBoardCode = ParamUtil.get(request, "toBoardCode");
				int toThreadType = ParamUtil.getInt(request, "toThreadType");
				String[] idsary = StrUtil.split(strIds, ",");
				String name = privilege.getUser(request);
				MsgDb md = new MsgDb();
				
				if (idsary!=null) {
					int len = idsary.length;
					for (int i=0; i<len; i++) {
						try {
							md.ChangeBoardThreadType(request, Long.parseLong(idsary[i]), toTxtBoardCode, toThreadType, name);
						}
						catch (ErrMsgException e) {
							out.print(StrUtil.Alert(e.getMessage()));
							return;
						}
					}
				}
                out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "batch_topic_m.jsp"));
			}
			
			if (operation.equals("delTopic")) {
				String strIds = ParamUtil.get(request, "ids");
				String[] idsary = StrUtil.split(strIds, ",");
				if (idsary!=null) {
					int len = idsary.length;
					for (int i=0; i<len; i++) {
						mm.delTopicAbsolutely(application, request, Long.parseLong(idsary[i]));
					}
				}
                out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "batch_topic_m.jsp"));
			}	
			
			if (operation.equals("msgLevel")) {
				String strIds = ParamUtil.get(request, "ids");
				String[] idsary = StrUtil.split(strIds, ",");
				String msgLevel = ParamUtil.get(request, "msgLevel");
				int value = -1;
				if(msgLevel.equals("levelTopBoard")){
					value = MsgDb.LEVEL_TOP_BOARD;
				}else{
					value = MsgDb.LEVEL_TOP_FORUM;
				}
				if (idsary!=null) {
					int len = idsary.length;
					for (int i=0; i<len; i++) {
						try {			    
							mm.setOnTop(request, Long.parseLong(idsary[i]), value);
						}
						catch (ErrMsgException e) {
							out.print(StrUtil.Alert(e.getMessage()));
							return;
						}
					}
				}
                out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "batch_topic_m.jsp"));
			}	
			
			if (operation.equals("elite")) {
				String strIds = ParamUtil.get(request, "ids");
				String[] idsary = StrUtil.split(strIds, ",");
				if (idsary!=null) {
					int len = idsary.length;
					for (int i=0; i<len; i++) {
						try {
							mm.setElite(request, Long.parseLong(idsary[i]), 1);
						}
						catch (ErrMsgException e) {
							out.print(StrUtil.Alert(e.getMessage()));
							return;
						}
					}
				}
                out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "batch_topic_m.jsp"));
			}	
			
			if (operation.equals("delAttach")) {
				String strIds = ParamUtil.get(request, "ids");
				String[] idsary = StrUtil.split(strIds, ",");
				if (idsary!=null) {
					int len = idsary.length;
					for (int i=0; i<len; i++) {
						MsgDb md = new MsgDb(Integer.parseInt(idsary[i]));
						Attachment am = new Attachment();
						Vector vt_attach = md.getAttachments();
						Iterator ir_attach = vt_attach.iterator();
						while (ir_attach.hasNext()) {
							am = (Attachment)ir_attach.next();
							am.del();
						}
					}
				}
                out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "batch_topic_m.jsp"));
			}	
			
		}
			
		String selboard = ParamUtil.get(request, "selboard");
		if (selboard.equals(""))
			selboard = "allboard";
			
		String title = "", nick = "", sBeginDate = "", sEndDate = "";
		String threadType = "", hitLess = "", hitMore = "", recountLess = "", recountMore = "", sReDate = "", msgLevel = "", isElite = "", attach = "", selBoardCode = "";    	
			
		//搜索主要选项
		title = ParamUtil.get(request, "title");
		nick = ParamUtil.get(request, "nick");
		sBeginDate = ParamUtil.get(request, "beginDate");
		sEndDate = ParamUtil.get(request, "endDate");
		
		//搜索更多选项
		threadType = ParamUtil.get(request, "threadType"); 
		hitLess = ParamUtil.get(request, "hitLess");   
		hitMore = ParamUtil.get(request, "hitMore");  
		recountLess = ParamUtil.get(request, "recountLess");  
		recountMore = ParamUtil.get(request, "recountMore");     
		sReDate = ParamUtil.get(request, "reDate");  
		msgLevel = ParamUtil.get(request, "msgLevel");
		isElite = ParamUtil.get(request, "isElite");
		attach = ParamUtil.get(request, "attach");
		selBoardCode = ParamUtil.get(request, "hBoardCode");
%>
<table width='100%' cellpadding='0' cellspacing='0' >
  <tr>
    <td class="head">批量主体管理</td>
  </tr>
</table>
<br>
<table width="98%" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
 <form name="form1" method="post" action="?op=search">
  <tr> 
    <td height=20 align="left" class="thead">搜索符合条件主题</td>
  </tr>
  <tr> 
    <td valign="top"><br>
      <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999" class="tableframe_gray">  
	  <tr>
        <td width="45%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;所在论坛:</td>
        <td width="55%" height="26" bgcolor="#FFFBFF">&nbsp;
          <select name="selboard">
			<option value="allboard" selected>
				<lt:Label res="res.label.forum.search" key="all_board"/>
			</option>
			<%
				LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
				java.util.Vector vt = dlcm.getChildren();
				Iterator ir = vt.iterator();
				while (ir.hasNext()) {
					Leaf leaf = (Leaf) ir.next();
					String parentCode = leaf.getCode();
			%>
            <optgroup style="BACKGROUND-COLOR: #f8f8f8" label="╋ <%=leaf.getName()%>">
            <%
					LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
					java.util.Vector v = dl.getChildren();
					Iterator ir1 = v.iterator();
					while (ir1.hasNext()) {
						Leaf lf = (Leaf) ir1.next();
			%>
             <option value="<%=lf.getCode()%>"> ├『<%=lf.getName()%>』</option>
			<%
					}
			%>
			</optgroup>
			<%
				}
			%>
        </select>
        <script language=javascript>
		<!--
		var v = "<%=selboard%>";
		if (v!="")
			form1.selboard.value = v;
		//-->
		</script>		</td>
	  </tr>  
	  <tr>
        <td width="45%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;主题作者(多用户名中间请用半角逗号 &quot;,&quot; 分割):</td>
        <td width="55%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;<input type="text" name="nick" value="<%=nick%>" /></td>
	  </tr> 
	  <tr>
        <td width="45%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;标题关键字:</td>
        <td width="55%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;<input type="text" name="title" value="<%=title%>"/></td>
	  </tr>   
	  <tr>
        <td width="45%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;发表时间范围(格式 yyyy-mm-dd,不限制为空):</td>
        <td width="55%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;从<input name="beginDate" value="<%=sBeginDate%>" onclick="showcalendar(event, this)" readonly>到
            <input name="endDate" value="<%=sEndDate%>" onclick="showcalendar(event, this)" readonly></td>
	  </tr>  
	  <tr>
	    <td height="26" bgcolor="#FFFBFF">&nbsp;</td>
	    <td height="26" bgcolor="#FFFBFF" align="right">
	      <input type="checkbox" name="checkAdvanceOption" value="0" onclick="advanceoptionShow(this)"/>
	      更多选项&nbsp;&nbsp;</td>
	    </tr>
	  <tbody id="advanceoption" style="display:none">
	  <tr>
        <td width="45%" height="26" bgcolor="#FFFBFF">&nbsp;&nbsp;所在分类:</td>
        <td width="55%" height="26" bgcolor="#FFFBFF">&nbsp;
          <select name="threadType" onChange="threadTypeChange()">
		  	<option value=""></option>
			<%
			    ThreadTypeDb ttdb = new ThreadTypeDb();
				String boardCode = "", boardName = "";
				vt = ttdb.list();
				ir = vt.iterator();
				int i = 0;
				int len = vt.size();
				String threadTypeArr[][] = new String[len][3]; 
				while (ir.hasNext()) {
					ttdb = (ThreadTypeDb) ir.next();
					boardCode = ttdb.getBoardCode();
					Leaf lf = new Leaf(boardCode);
					threadTypeArr[i][0] = Integer.toString(ttdb.getId());
                    threadTypeArr[i][1] = lf.getName();
					threadTypeArr[i][2] = boardCode;
					
			%>
			<option value="<%=ttdb.getId()%>"><%=ttdb.getName()%></option>
			<%
			        i++;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?