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.
 
 
 
 
 
 

426 lines
24 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")),"");
String findOption = clearXSS(request.getParameter("findOption"),null);
String findWord = clearXSS(Encoder.toJava(request.getParameter("findWord")),null);
/*********** 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 = TagFilter.unconvertedMeta(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"%><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 type="text/javascript" src="/test/jquery-1.6.4.js"></script>
<script type="text/javascript" src="/totsys/common/js/jquery.custom.indicator.js"></script>
<SCRIPT language="JAVASCRIPT">
function boardDel(regID){
if(regID == '<%=usID%>' || '<%=sysAuth%>'=='<%=Moumi.SYSADM%>'){
if(confirm("삭제 하시겠습니까?")){
$.customIndicator.show(window.self);
document.f_delete.target = "hiddenFrame";
document.f_delete.submit();
}
}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;
}
<%}%>
}
/*
* 목록페이지로 이동처리하는 함수
* @returns {undefined}
*/
function fn_goToList() {
document.f_list.submit();
}
/*
* 수정페이지로 이동처리하는 함수
* @returns {undefined}
*/
function fn_goToModify(regID) {
if(regID == '<%=usID%>' || '<%=sysAuth%>'=='<%=Moumi.SYSADM%>'){
document.f_modify.submit();
}else{
alert("수정 권한이 없습니다.!");
return;
}
}
</SCRIPT>
</HEAD>
<body style='' BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<form name="f_list" method="post" action="./board_list.jsp">
<input type="hidden" name="strPage" value="<%= strPage %>">
<input type="hidden" name="boardGroupID" value="<%= boardGroupID %>">
<input type="hidden" name="findWord" value="<%= findWord %>">
<input type="hidden" name="findOption" value="<%= findOption %>">
</form>
<form name="f_modify" method="post" action="./board_modify.jsp">
<input type="hidden" name="boardID" value="<%= boardID %>">
<input type="hidden" name="strPage" value="<%= strPage %>">
<input type="hidden" name="boardGroupID" value="<%= boardGroupID %>">
<input type="hidden" name="findWord" value="<%= findWord %>">
<input type="hidden" name="findOption" value="<%= findOption %>">
</form>
<form name="f_delete" method="post" action="/servlet/kr.co.kihyun.beans.totsys.board.HttpBoardDelete">
<input type="hidden" name="boardID" value="<%= boardID %>">
<input type="hidden" name="callbackFunc" value="parent.fn_goToList()">
</form>
<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:include>
<!---- 리스트 시작 ---->
<tr>
<td height="31" valign="top">
<table border="1px" bordercolor="#e3e3e3" class="kecttep_list_table" width="100%" cellpadding="0" cellspacing="0">
<!---- 제목 시작 ---->
<tr>
<td width="130" class="kecttep_tdmenu" height="31">
<span style="width: 130px; padding-left:20px;">제목</span>
</td>
<td class="kecttep_last_graytd" style="padding-left: 10px; padding-top: 4px">
<%= boardTitle %>
</td>
</tr>
<!---- 제목 끝 ---->
<!---- 내용 ---->
<tr valign="top">
<td width="130" class="kecttep_tdmenu" style="padding-top: 10px; height: 200px; padding-left:20px;">
내용
</td>
<td class="kecttep_last_graytd" style="padding-left: 10px; padding-top: 10px; padding-bottom: 10px; padding-right: 10px;">
<%= boardContents %>
</td>
</tr>
<!---- 내용 끝 ---->
<!---- 파일첨부 ---->
<tr valign="top">
<td width="130" class="kecttep_tdmenu" style="padding-top: 20px; padding-left:20px;">
관련자료 첨부
</td>
<td class="kecttep_last_graytd" style="padding-left: 10px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px;">
<!---- 파일첨부 테이블 시작 ---->
<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) %>&nbsp;:&nbsp; <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_last_graytd" height="20" style="padding-left: 3; border-bottom:none;">
<font color="#FF6600"><b>+</b><%= Moumi.getMessageBundle().getString("moumi.message.file") %>
<%= (i+1) %>&nbsp;:&nbsp; <a
href="/servlet/kr.co.kihyun.text.html.HttpViewer?fileName=<%=URLEncoder.encode(svrFilenameList[i], "UTF-8")%>&boardID=<%=boardID%>"
target="hiddenIframe"><%= usrFilenameList[i] %></a>
</font>
</td>
</tr>
<%
}
%>
</table>
<!---- 파일첨부 테이블 끝 ---->
</td>
</tr>
<!-- 팝업공지 -->
<% if("ID_SYSTEM_NOTICE".equals(boardGroupID)) { %>
<tr>
<td width="130" class="kecttep_tdmenu" height="31" style="">
<span style="width: 130px; padding-left:20px;">팝업공지</span>
</td>
<td class="kecttep_last_graytd" style="vertical-align: middle; padding-left: 10px;">
<input type="checkbox" disabled name="checkPopup" <% if(checkPopup=="Y") { %> checked <% }%>>
</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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=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>&nbsp;<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();">&nbsp;<span
style="width: 40px; cursor: hand;">입력</span></a> <!---- 파일첨부 테이블 끝 ---->
</td>
</tr>
</form>
<%}%>
<!---- 파일첨부 끝 ---->
</table>
</td>
<td width="10"></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0 0 0;">
<tr class="toolbar">
<td align="center">
<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>-->
<a class="" href="#" onclick="fn_goToList();" title="목록">
<img src="/totsys/common/images/bt_list.gif" alt="목록" />
</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>-->
<a class="" href="#" onclick="fn_goToModify('<%=regID%>');" title="수정">
<img src="/totsys/common/images/bt_modify.gif" alt="수정" />
</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>-->
<a class="" href="#" onclick="boardDel('<%=regID%>');" title="삭제">
<img src="/totsys/common/images/bt_del.gif" alt="삭제" />
</a>
</td>
<%}%>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!---- topbar 버튼 끝 ---->
</table>
</td>
</tr>
<!------------------------------- top menu start ------------------------------->
<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
<!------------------------------- top menu end ------------------------------->
</table>
<iframe name='hiddenFrame' width=0 height=0 style='display:none;'></iframe>
</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();
}
%>