You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
392 lines
16 KiB
392 lines
16 KiB
|
|
<%@page import="kr.co.kihyun.text.html.TagFilter"%> |
|
<% |
|
/********************************************************************************** |
|
프로그램명 : popup_view.jsp |
|
프로그램설명 : 공지사항 보기 |
|
작 성 자 : 강 원 중 |
|
작 성 일 : 2004. 06.07 |
|
최신변경일 : 2005. 05.11 |
|
***********************************************************************************/ |
|
%> |
|
<%@ page contentType="text/html; charset=euc-kr"%> |
|
|
|
<%@ page import="kr.co.kihyun.text.html.ServletUtil"%> |
|
<%@ page import="kr.co.kihyun.lang.StringConverter"%> |
|
<%@ page import="kr.co.kihyun.moumi.Moumi"%> |
|
<%@ page import="kr.co.kihyun.beans.user.HttpSSOLogin"%> |
|
<%@ page import="java.net.URLEncoder"%> |
|
<%@ page import="kr.co.kihyun.lang.Encoder"%> |
|
<%@ page import="kr.co.kihyun.lang.MString" |
|
import="kr.co.kihyun.lang.MLong" import="javax.jdo.PersistenceManager" |
|
import="javax.jdo.Transaction" |
|
import="kr.co.kihyun.beans.entity.util.*" |
|
import="kr.co.kihyun.beans.entity.Board"%> |
|
<%@ page import="java.util.Map.Entry"%> |
|
<%@ page import="java.util.List"%> |
|
|
|
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%> |
|
|
|
<% |
|
PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); |
|
Transaction tx = pm.currentTransaction(); |
|
try{ |
|
/*********** User HttpSSOLogin check ***********/ |
|
if(!HttpSSOLogin.isLogin(request)){ |
|
//login 성공후 되돌아올 주소 |
|
String connURL="opener.location='/totsys/login/login.jsp';"; |
|
out.println(ServletUtil.getJavaScript(connURL)); |
|
out.println(ServletUtil.getJavaScript("window.close();")); |
|
return; |
|
} |
|
|
|
/********** session내의 userId **********/ |
|
String usID = HttpSSOLogin.getLoginID(request); |
|
String dtID = HttpSSOLogin.getDeptID(request); |
|
int sysAuth = HttpSSOLogin.getSysAuth(request); |
|
|
|
/*********** Parameter values ***********/ |
|
|
|
int currentPage = 0; |
|
|
|
String strPage = clearXSS(request.getParameter("strPage"), ""); |
|
Long boardID = MLong.parseLong(request.getParameter("boardID"),null); |
|
String boardUserID = clearXSS(Encoder.toJava(request.getParameter("boardUserID")),""); |
|
|
|
|
|
/*********** Board View vlaues ***********/ |
|
tx.begin(); |
|
Board board = pm.getObjectById(Board.class, boardID); |
|
String regID = board.getUser(pm) == null ? null : board.getUser(pm).getId(); |
|
String boardGroupID = board.getCategory().getId(); |
|
|
|
String boardTitle = board.getTitle(); |
|
String boardContents = StringConverter.toHtmlBr(board.getContents()); |
|
boardContents=TagFilter.unconvertedMeta(boardContents); |
|
String checkPopup=board.getPopupYn(); |
|
|
|
String usrFilenames = ""; |
|
String svrFilenames = ""; |
|
for (Entry<String, List<Byte>> entry : board.getAttachments().entrySet()) { |
|
usrFilenames += entry.getKey() + ";"; |
|
svrFilenames += entry.getKey() + ";"; |
|
} |
|
int visit = board.getVisit(); |
|
List<Board> replies = board.getChildBoards(); |
|
board.setVisit(visit+1); |
|
pm.makePersistent(board); |
|
tx.commit(); |
|
|
|
String boardType = ""; |
|
if("ID_SYSTEM_NOTICE".equals(boardGroupID)){ |
|
boardType = Moumi.getMessageBundle().getString("moumi.message.board.notice"); |
|
}else if("ID_FAQ".equals(boardGroupID)){ |
|
boardType = Moumi.getMessageBundle().getString("moumi.message.board.faq"); |
|
}else if("ID_QNA".equals(boardGroupID)){ |
|
boardType = Moumi.getMessageBundle().getString("moumi.message.board.qna"); |
|
}else if("ID_PDS".equals(boardGroupID)){ |
|
boardType = Moumi.getMessageBundle().getString("moumi.message.board.pds"); |
|
} |
|
/*********** append file name vlaues ***********/ |
|
String[] usrFilenameList = usrFilenames.split(";"); |
|
String[] svrFilenameList = svrFilenames.split(";"); |
|
|
|
/****** 본인 유무 처리 ******/ |
|
boolean isManager = false; |
|
if(usID.equals(regID)){ |
|
isManager = true; |
|
} |
|
session.setAttribute("delTargetURI", "location.href='/totsys/sysadm/board/board_list.jsp?boardGroupID=" + boardGroupID+"&strPage="+strPage+"'"); |
|
%> |
|
|
|
|
|
<%@page import="java.util.Set"%> |
|
<%@page import="java.util.List"%> |
|
<%@page import="java.text.SimpleDateFormat"%> |
|
<!DCOTYPE html> |
|
<HTML> |
|
<HEAD> |
|
<TITLE><%=Moumi.getTitle()%></TITLE> |
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=euc-kr"> |
|
<link rel="stylesheet" href="/totsys/common/css/text.css" type="text/css"> |
|
<link rel="stylesheet" href="/totsys/common/css/SquareButtons.css" type="text/css"> |
|
<link rel="stylesheet" href="/totsys/common/css/kecttep.css" type="text/css"> |
|
<script src="/totsys/common/js/rollover.js"></script> |
|
<SCRIPT language="JAVASCRIPT"> |
|
function boardDel(regID){ |
|
if(regID == '<%=usID%>' || '<%=sysAuth%>'=='<%=Moumi.SYSADM%>'){ |
|
if(confirm("삭제 하시겠습니까?")){ |
|
location.href = "/servlet/kr.co.kihyun.beans.totsys.board.HttpBoardDelete?boardID=<%= boardID %>"; |
|
} |
|
}else{ |
|
alert("삭제 권한이 없습니다.!"); |
|
return; |
|
} |
|
} |
|
|
|
function boardModify(regID){ |
|
if(regID == '<%=usID%>' || '<%=sysAuth%>'=='<%=Moumi.SYSADM%>'){ |
|
location.href = "./board_modify.jsp?boardID=<%=boardID%>"; |
|
}else{ |
|
alert("수정 권한이 없습니다.!"); |
|
return; |
|
} |
|
} |
|
function boardLIst(regID, id){ |
|
location.href = "./board_list.jsp?boardGroupID=<%=boardGroupID%>&boardID="+id+""+"&strPage=<%=strPage%>"; |
|
} |
|
function conInsert(){ |
|
document.dform.submit(); |
|
} |
|
|
|
function conDelete(id){ |
|
location.href = "/servlet/kr.co.kihyun.beans.totsys.board.HttpBoardDelete?boardGroupID=<%=boardGroupID%>&boardID="+id; |
|
} |
|
|
|
function changeEditShow(showNumber){ |
|
<%for(int i=0; i<replies.size(); i++){%> |
|
if(showNumber == <%=i%>){ |
|
viewContents<%=i%>.style.display='none'; |
|
editContents<%=i%>.style.display=''; |
|
} |
|
<%}%> |
|
} |
|
|
|
function changeViewShow(showNumber){ |
|
<%for(int i=0; i<replies.size(); i++){%> |
|
if(showNumber == <%=i%>){ |
|
viewContents<%=i%>.style.display=''; |
|
editContents<%=i%>.style.display='none'; |
|
} |
|
<%}%> |
|
} |
|
|
|
function conUpdate(updateNumber,id){ |
|
var contents = ""; |
|
<%for(int i=0; i<replies.size(); i++){%> |
|
if(updateNumber == <%=i%>){ |
|
contents = document.dform.updateContents<%=i%>.value; |
|
location.href = "/servlet/kr.co.kihyun.beans.totsys.board.HttpBoardModify?id=<%=boardID%>&boardGroupID=<%=boardGroupID%>&userID=<%=usID%>&contents="+contents+"&boardID="+id; |
|
} |
|
<%}%> |
|
} |
|
</SCRIPT> |
|
</HEAD> |
|
<body style='' BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> |
|
<table width="100%" height="70" border="0" cellpadding="0" cellspacing="0"> |
|
<jsp:include page="/totsys/common/inc/sysadm/top/top.jsp" flush="true" /> |
|
<tr> |
|
<td nowrap width="0"></td> |
|
<td valign="top"> |
|
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
<jsp:include page="/totsys/common/inc/title/title.jsp" flush="true"> |
|
<jsp:param value='<%= URLEncoder.encode(boardType, "UTF-8")%>' name="title" /> |
|
<jsp:param value='<%= URLEncoder.encode(boardTitle, "UTF-8")%>' name="desc" /> |
|
<jsp:param value='99' name="flag" /> |
|
</jsp:include> |
|
<%-- |
|
<tr> |
|
<td> |
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
<tr class="toolbar"> |
|
<td align="left"> |
|
<table border="0" cellspacing="0" cellpadding="0"> |
|
<!---- 버튼 (공지사항목록) ----> |
|
<tr> |
|
<td class="keecttep_button_td"><a class="simplebutton" href="#" |
|
onclick="boardLIst('<%=regID%>', id);"><span class="modify"><%= Moumi.getMessageBundle().getString("moumi.message.button.boardList") %></span></a> |
|
</td> |
|
<%if(sysAuth == Moumi.SYSADM ||(sysAuth == Moumi.SUB_SYSADM && regID.equals(usID)) || (sysAuth == Moumi.TOTPER && regID.equals(usID))){%> |
|
<td class="kecttep_button_td"><a class="simplebutton" href="#" |
|
onclick="boardModify('<%=regID%>');"><span class="modify"><%= Moumi.getMessageBundle().getString("moumi.message.button.boardModify") %></span></a> |
|
</td> |
|
<td class="kecttep_button_td"><a class="simplebutton" |
|
href="#" onclick="boardDel('<%=regID%>');"><span class="no"><%= Moumi.getMessageBundle().getString("moumi.message.button.boardDelete") %></span></a> |
|
</td> |
|
<%}%> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
--%> |
|
<!---- topbar 버튼 끝 ----> |
|
|
|
<!--1픽셀 띄우기--> |
|
<tr> |
|
<td height="1"></td> |
|
</tr> |
|
|
|
|
|
|
|
|
|
|
|
<!---- 리스트 시작 ----> |
|
<tr> |
|
<td height="31" valign="top"> |
|
<table border="1px" bordercolor="#e3e3e3" class="kecttep_list_table" |
|
width="100%" cellpadding="0" cellspacing="0"> |
|
<%-- |
|
<tr> |
|
<td width="180" class="kecttep_tdmenu" height="31"> |
|
<span style="width: 130px"><img src="/totsys/common/images/reg_icon.gif" align="middle">팝업공지</span></td> |
|
<td class="kecttep_last_tdmenu" style="padding-left: 10; padding-top: 4"> |
|
<input type="checkbox" disabled name="checkPopup" <% if(checkPopup==true) { %> checked <% }%>></td> |
|
</tr> |
|
--%> |
|
<!---- 제목 시작 ----> |
|
<tr> |
|
<%-- |
|
<td width="180" class="kecttep_tdmenu" height="31"><span |
|
style="width: 130px"><img |
|
src="/totsys/common/images/reg_icon.gif" align="middle">제목</span></td> |
|
--%> |
|
<td class="kecttep_last_tdmenu" |
|
style="padding-left: 10; padding-top: 4"><%= boardTitle %></td> |
|
</tr> |
|
<!---- 제목 끝 ----> |
|
|
|
<!---- 내용 ----> |
|
<tr valign="top"> |
|
<%-- |
|
<td width="180" class="kecttep_list_tdmenu" |
|
style="padding-top: 10; height: 200"><img |
|
src="/totsys/common/images/reg_icon.gif" align="middle">내용</td> |
|
--%> |
|
|
|
|
|
<td class="kecttep_last_graytd" |
|
style="padding-left: 10; padding-top: 10; padding-bottom: 10; padding-right: 10"> |
|
<%= boardContents %></td> |
|
</tr> |
|
<!---- 내용 끝 ----> |
|
|
|
<!---- 파일첨부 ----> |
|
<tr valign="top"> |
|
<%-- |
|
<td width="180" class="kecttep_list_tdmenu" |
|
style="padding-top: 10;"><img |
|
src="/totsys/common/images/reg_icon.gif" align="middle">관련자료 |
|
첨부</td> |
|
--%> |
|
|
|
|
|
<td class="kecttep_last_graytd" |
|
style="padding-left: 10; padding-right: 10; padding-top: 10; padding-bottom: 10;"> |
|
<!---- 파일첨부 테이블 시작 ----> |
|
<table width="100%" border="0" cellspacing="0" cellpadding="0" |
|
align="center"> |
|
<% |
|
for(int i=0; i < svrFilenameList.length; i++){ |
|
%> |
|
<tr> |
|
<!-- <td class="kecttep_last_graytd" height="20" |
|
style="padding-left: 3;"><font color="#FF6600"><b>+</b><%= Moumi.getMessageBundle().getString("moumi.message.file") %> |
|
<%= (i+1) %> : <a |
|
href="/servlet/kr.co.kihyun.text.html.HttpViewer?<%=URLEncoder.encode(usrFilenameList[i], "UTF-8")%>&fileName=<%=URLEncoder.encode(svrFilenameList[i], "UTF-8")%>&boardID=<%=boardID%>" |
|
target="new"><%= usrFilenameList[i] %></a></font></td>--> |
|
<td class="kecttep_list_graytd" height="20" |
|
style="padding-left: 3;"><font color="#FF6600"><b>+</b><%= Moumi.getMessageBundle().getString("moumi.message.file") %> |
|
<%= (i+1) %> : <a |
|
href="/servlet/kr.co.kihyun.text.html.HttpViewer?fileName=<%=URLEncoder.encode(svrFilenameList[i], "UTF-8")%>&boardID=<%=boardID%>" |
|
target="new"><%= usrFilenameList[i] %></a></font></td> |
|
</tr> |
|
<% |
|
} |
|
%> |
|
</table> |
|
<!---- 파일첨부 테이블 끝 ----></td> |
|
</tr> |
|
|
|
<%if("ID_QNA".equals(boardGroupID)){%> |
|
<form name="dform" method="post" |
|
action="/servlet/kr.co.kihyun.beans.totsys.board.HttpBoardWrite"> |
|
<input type="hidden" name="boardID" value="<%=boardID%>"> <input |
|
type="hidden" name="userID" value="<%=usID%>"> <input |
|
type="hidden" name="deptID" value="<%=dtID%>"> <INPUT |
|
type="hidden" name="boardGroupID" value="<%= boardGroupID %>"> |
|
<input type="hidden" name="strPage" value="<%= strPage%>"> |
|
<INPUT type="hidden" name="fileCount"> <INPUT type="hidden" |
|
name="usrFilenames"> <INPUT type="hidden" |
|
name="svrFilenames"> <INPUT type="hidden" name="fileInfos"> |
|
<INPUT type="hidden" name="title"> <INPUT type="hidden" |
|
name="tmp1" value="1"> <% |
|
tx.begin(); |
|
|
|
for(int i=replies.size()-1; i >=0; i--){ |
|
|
|
%> |
|
<tr> |
|
<td width="180" class="kecttep_list_tdmenu" |
|
style="padding-top: 10;"><img |
|
src="/totsys/common/images/reg_icon.gif" align="absmiddle"><font |
|
color="black"><strong><%=replies.get(i).getUser(pm).getUpperDept(pm).getName()%></strong></font><br> |
|
<%=replies.get(i).getUser(pm).getName(pm)%></td> |
|
<td class="kecttep_last_graytd" |
|
style="padding-left: 10; padding-top: 10; padding-bottom: 10; padding-right: 10"> |
|
<table> |
|
<tr> |
|
<td style="padding-left: 10; padding-right: 10; " |
|
class="kecttep_last_graytd"><span id="viewContents<%=i%>"><%=replies.get(i).getContents()%> |
|
<%if(replies.get(i).getUser(pm).getId().equals(usID) || sysAuth == 9){%> |
|
<a href="#" onClick='changeEditShow("<%=i%>");'>수정</a> <a |
|
href="#" onClick='conDelete("<%=replies.get(i).getId()%>");'>삭제</a> |
|
<%}%> </span> <span id="editContents<%=i%>" style="display: none;" |
|
class="kecttep_last_graytd"> <input type="text" |
|
name="updateContents<%=i%>" |
|
value="<%=replies.get(i).getContents()%>" size="90"> <a |
|
href="#" |
|
onClick='conUpdate("<%=i%>","<%=replies.get(i).getId()%>");'>변경</a> |
|
<a href="#" onClick='changeViewShow("<%=i%>");'>취소</a> </span></td> |
|
<td style="padding-left: 10; padding-right: 10;" |
|
class="kecttep_last_graytd"><%=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(replies.get(i).getWriteDate())%></td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
<%} |
|
tx.rollback(); |
|
%> |
|
<tr valign="top"> |
|
<td width="150" class="kecttep_list_tdmenu" |
|
style="padding-top: 10;"><img |
|
src="/totsys/common/images/reg_icon.gif" align="absmiddle">의견</td> |
|
<td class="kecttep_last_graytd" |
|
style="padding-left: 10; padding-right: 10; padding-top: 10; padding-bottom: 10;"> |
|
<!---- 파일첨부 테이블 시작 ----> <input type="text" name="contents" |
|
size="90"><a href="#" onClick="conInsert();"> <span |
|
style="width: 40px; cursor: hand;">입력</span></a> <!---- 파일첨부 테이블 끝 ----></td> |
|
</tr> |
|
</form> |
|
<%}%> |
|
|
|
<!---- 파일첨부 끝 ----> |
|
</table> |
|
</td> |
|
<!--<td width="10"></td>--> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
<!------------------------------- top menu start -------------------------------> |
|
<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%> |
|
<!------------------------------- top menu end -------------------------------> |
|
</table> |
|
</BODY> |
|
</HTML> |
|
<% |
|
}catch(Exception ex){ |
|
//38.오류메세지를 통한 정보 노출(getMessage)_CWE-209 : Update by YOUNGJUN,CHO |
|
//out.println(ex);//앤개 |
|
ex.printStackTrace(); |
|
//out.println("<html><body style='overflow=auto' bgcolor='white'><h1>Can't contact servlet runner</h1><br><br>Message : "+ex.getMessage()+"</body></html>"); |
|
//out.println("<META HTTP-EQUIV='refresh' CONTENT='0.1; URL=/error/exception.jsp'>"); |
|
//================================================ |
|
}finally{ |
|
if(tx.isActive()) |
|
tx.rollback(); |
|
pm.close(); |
|
} |
|
%> |