2024-12-31 14:05 g/w 및 오류 게시판 작업

This commit is contained in:
myname 2024-12-31 14:05:25 +09:00
parent 759fcb48e7
commit 0dcd0a5f26
5 changed files with 407 additions and 98 deletions

View File

@ -81,6 +81,7 @@ import kcc.let.sym.site.service.EgovSiteManagerService;
import kcc.let.sym.site.service.SiteManagerVO; import kcc.let.sym.site.service.SiteManagerVO;
import kcc.let.uat.uia.service.SsoLoginVO; import kcc.let.uat.uia.service.SsoLoginVO;
import kcc.let.utl.sim.service.EgovClntInfo; import kcc.let.utl.sim.service.EgovClntInfo;
import seed.utils.FairnetUtils;
/** /**
* 게시물 관리를 위한 컨트롤러 클래스 * 게시물 관리를 위한 컨트롤러 클래스
@ -364,6 +365,8 @@ public class EgovBBSManageController {
return modelAndView; return modelAndView;
}*/ }*/
System.out.println("1");
beanValidator.validate(board, bindingResult); beanValidator.validate(board, bindingResult);
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
model.addAttribute("bdMstr", bmvo); model.addAttribute("bdMstr", bmvo);
@ -371,6 +374,8 @@ public class EgovBBSManageController {
return modelAndView; return modelAndView;
} }
System.out.println("12");
String atchFileId = ""; String atchFileId = "";
String isThumbFile = ""; String isThumbFile = "";
if (("BBST05").equals(bmvo.getBbsTyCode()) || ("BBST06").equals(bmvo.getBbsTyCode())) isThumbFile = "thumbFile"; if (("BBST05").equals(bmvo.getBbsTyCode()) || ("BBST06").equals(bmvo.getBbsTyCode())) isThumbFile = "thumbFile";
@ -389,6 +394,7 @@ public class EgovBBSManageController {
board.setAtchFileId(atchFileId); board.setAtchFileId(atchFileId);
} }
System.out.println("13");
board.setFrstRegisterId(user.getUniqId()); board.setFrstRegisterId(user.getUniqId());
@ -403,6 +409,8 @@ public class EgovBBSManageController {
String userIp = EgovClntInfo.getClntIP(multiRequest); String userIp = EgovClntInfo.getClntIP(multiRequest);
board.setNtcrIp(userIp); board.setNtcrIp(userIp);
System.out.println("14");
if(null !=board.getFrstRegisterPnttm() && !"".equals(board.getFrstRegisterPnttm()) ) { if(null !=board.getFrstRegisterPnttm() && !"".equals(board.getFrstRegisterPnttm()) ) {
board.getFrstRegisterPnttm(); board.getFrstRegisterPnttm();
String tempDete = board.getFrstRegisterPnttm().split("-")[0]+board.getFrstRegisterPnttm().split("-")[1]+board.getFrstRegisterPnttm().split("-")[2]; String tempDete = board.getFrstRegisterPnttm().split("-")[0]+board.getFrstRegisterPnttm().split("-")[1]+board.getFrstRegisterPnttm().split("-")[2];
@ -410,13 +418,15 @@ public class EgovBBSManageController {
} }
bbsMngService.insertBoardArticle(board); bbsMngService.insertBoardArticle(board);
System.out.println("15");
redirectAttributes.addAttribute("pageIndex", boardVO.getPageIndex()); redirectAttributes.addAttribute("pageIndex", boardVO.getPageIndex());
redirectAttributes.addAttribute("searchCnd", boardVO.getSearchCnd()); redirectAttributes.addAttribute("searchCnd", boardVO.getSearchCnd());
redirectAttributes.addAttribute("searchWrd", boardVO.getSearchWrd()); redirectAttributes.addAttribute("searchWrd", boardVO.getSearchWrd());
redirectAttributes.addAttribute("bbsId", boardVO.getBbsId()); redirectAttributes.addAttribute("bbsId", boardVO.getBbsId());
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.insert")); redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.insert"));
modelAndView.addObject("result", "success"); modelAndView.addObject("result", "success");
System.out.println("16");
return modelAndView; return modelAndView;
} }
@ -664,7 +674,24 @@ public class EgovBBSManageController {
// 관리권한, 사용여부 // 관리권한, 사용여부
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
System.out.println("+++++++++++++++++++user+++++++++++++++++++");
System.out.println(user);
/*
model.put("siteIdx", "case");
model.put("url", "/web/user/mypage/case/01/168/myCheck.do");
model.put("umessage", "본인인증이 필요합니다.");
model.put("opener", "");
model.put("append", "");
model.put("self", "");
return "/_common/jsp/umessage";
*/
if(!"ROLE_ADMIN".equals(user.getAuthority())){ //관리자 제외 if(!"ROLE_ADMIN".equals(user.getAuthority())){ //관리자 제외
if (bdMstr == null || ("N").equals(bdMstr.getUseAt()) if (bdMstr == null || ("N").equals(bdMstr.getUseAt())
|| !isBBSAuthFlag(bdMstr.getManageAuth(), bdMstr.getBbsId(), null)) { || !isBBSAuthFlag(bdMstr.getManageAuth(), bdMstr.getBbsId(), null)) {
@ -1301,6 +1328,146 @@ public class EgovBBSManageController {
return "/web/cop/bbs/EgovNoticeList"; return "/web/cop/bbs/EgovNoticeList";
} }
/**
* (사용자)게시물에 대한 목록을 조회한다. - 오류 게시판 임시
*
* @param boardVO
* @param sessionVO
* @param model
* @return
* @throws Exception
*/
@RequestMapping(value= {"/web/cop/bbsWeb/selectBoardErrorList.do" })
public String selectBoardErrorList(HttpServletRequest request, @ModelAttribute("searchVO") BoardVO boardVO, ModelMap model
,RedirectAttributes redirectAttributes
, ModelMap mapz, HttpSession session
) throws Exception {
// CI 체크
if(!FairnetUtils.ciCheck(mapz, session)) {
//return new ModelAndView("/_common/jsp/umessage");
//redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("fail.common.imposbl"));
//return "redirect:/web/main/mainPage.do";
model.put("siteIdx", "case");
model.put("url", "/web/user/mypage/case/01/168/myCheck.do");
model.put("umessage", "본인인증이 필요합니다.");
model.put("opener", "");
model.put("append", "");
model.put("self", "");
return "/_common/jsp/umessage";
}
boolean b_ret_u = true;
mapz = FairnetUtils.myCheck(mapz, session);
b_ret_u = (boolean)mapz.get("b_ret");
if (!b_ret_u) {
//return new ModelAndView("/_common/jsp/umessage");
//redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("fail.common.imposbl"));
//return "redirect:/web/main/mainPage.do";
model.put("siteIdx", "case");
model.put("url", "/web/user/mypage/case/01/168/myCheck.do");
model.put("umessage", "본인인증이 필요합니다.");
model.put("opener", "");
model.put("append", "");
model.put("self", "");
return "/_common/jsp/umessage";
}
setSessionMessageRemove(session);
Map<String, ?> flashMap =RequestContextUtils.getInputFlashMap(request);
if(flashMap!=null && flashMap.get("boardVO") != null) {
boardVO = (BoardVO)flashMap.get("boardVO");
}
BoardMasterVO bmVO = new BoardMasterVO();
bmVO.setBbsId(boardVO.getBbsId());
bmVO = bbsAttrbService.selectBBSMasterInf(bmVO);
UserVO userVO = (UserVO)request.getSession().getAttribute("userVO"); // 사용자 정보
SsoLoginVO ssoLoginVO = (SsoLoginVO) request.getSession().getAttribute("SSOLoginVO");
if (bmVO == null || ("N").equals(bmVO.getUseAt())) {
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("fail.common.imposbl"));
return "redirect:/web/main/mainPage.do";
}
boardVO.setPageUnit(Integer.parseInt(bmVO.getListNum()));
boardVO.setPageSize(Integer.parseInt(bmVO.getPageNum()));
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(boardVO.getPageIndex());
paginationInfo.setRecordCountPerPage(boardVO.getPageUnit());
paginationInfo.setPageSize(boardVO.getPageSize());
boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
boardVO.setLastIndex(paginationInfo.getLastRecordIndex());
boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
if (("BBST05").equals(bmVO.getBbsTyCode())){ //사진게시판 8개씩 9개조회후 9개면 더보기
boardVO.setRecordCountPerPage(8); //리스트
boardVO.setFirstIndex( (boardVO.getPageIndex()-1)*8); //offset
paginationInfo.setRecordCountPerPage(boardVO.getRecordCountPerPage()); // 접근성 획득 롤백
}
// 공지사항
if (("Y").equals(bmVO.getNoticeYn())) {
List<BoardVO> notifyList = bbsMngService.selectBoardNotifyArticles(boardVO, null);
model.addAttribute("notifyList", notifyList);
boardVO.setNoticeAt("N"); //다음에 공지사항 아닌것만 검색
}
if("BBST05".equals(bmVO.getBbsTyCode())){ //재단소식
boardVO.setSearchSortCnd("FRST_REGIST_PNTTM");
boardVO.setSearchSortOrd("desc");
}
Map<String, Object> map = bbsMngService.selectBoardArticlesWeb(boardVO, null);
int totCnt = Integer.parseInt((String) map.get("resultCnt"));
paginationInfo.setTotalRecordCount(totCnt);
List<BoardVO> resultList = (List<BoardVO>)map.get("resultList");
PaginationInfo paginationInfoMobile = new PaginationInfo();
paginationInfoMobile.setCurrentPageNo(paginationInfo.getCurrentPageNo());
paginationInfoMobile.setTotalRecordCount(paginationInfo.getTotalRecordCount());
paginationInfoMobile.setPageSize(5);
paginationInfoMobile.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
model.addAttribute("resultList", resultList);
model.addAttribute("resultCnt", map.get("resultCnt"));
model.addAttribute("boardVO", boardVO);
model.addAttribute("brdMstrVO", bmVO);
model.addAttribute("paginationInfo", paginationInfo);
model.addAttribute("paginationInfoMobile", paginationInfoMobile);
if("BBST05".equals(bmVO.getBbsTyCode())){
if(resultList.size()>8) { //더보기 더튼 추가
model.addAttribute("more", true);
}else {
model.addAttribute("more", false);
}
if("/web/cop/bbsWeb/selectMoreListAjax.do".equals(request.getRequestURI())) { //더보기
return "/web/cop/bbs/EgovNoticePhotoListAjax";
}
System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
return "/web/cop/bbs/EgovNoticePhotoList"; //메인
}
System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb");
return "/web/cop/bbs/EgovNoticeList";
}
/** /**
* (사용자)게시물 등록을 위한 등록페이지로 이동한다.(묻고답하기) * (사용자)게시물 등록을 위한 등록페이지로 이동한다.(묻고답하기)
* *
@ -1397,6 +1564,24 @@ public class EgovBBSManageController {
for(BoardMasterVO tempMasterVO : boardMenuList ) { for(BoardMasterVO tempMasterVO : boardMenuList ) {
tempMasterVO.setBbsNm(tempMasterVO.getBbsNm().split("\\(")[1].split("\\)")[0]) ; tempMasterVO.setBbsNm(tempMasterVO.getBbsNm().split("\\(")[1].split("\\)")[0]) ;
}*/ }*/
//SsoLoginVO ssoLoginVO = new SsoLoginVO();
System.out.println("+++++++++++++++++++user+++++++++++++++++++");
System.out.println( request.getSession().getAttribute("SSOLoginVO"));
System.out.println( FairnetUtils.ciCheck(model, session));
//System.out.println(user);
if (!FairnetUtils.ciCheck(model, session)) {
model.put("siteIdx", "case");
model.put("url", "/web/user/mypage/case/01/168/myCheck.do");
model.put("umessage", "본인인증이 필요합니다.");
model.put("opener", "");
model.put("append", "");
model.put("self", "");
return "/_common/jsp/umessage";
}
BoardMasterVO bmVO = new BoardMasterVO(); BoardMasterVO bmVO = new BoardMasterVO();
bmVO.setBbsId(boardVO.getBbsId()); bmVO.setBbsId(boardVO.getBbsId());
bmVO = bbsAttrbService.selectBBSMasterInf(bmVO); bmVO = bbsAttrbService.selectBBSMasterInf(bmVO);
@ -2080,6 +2265,8 @@ public class EgovBBSManageController {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
System.out.println("1====");
BoardMasterVO bmVO = new BoardMasterVO(); BoardMasterVO bmVO = new BoardMasterVO();
bmVO.setBbsId(boardVO.getBbsId()); bmVO.setBbsId(boardVO.getBbsId());
bmVO = bbsAttrbService.selectBBSMasterInf(bmVO); bmVO = bbsAttrbService.selectBBSMasterInf(bmVO);
@ -2091,6 +2278,8 @@ public class EgovBBSManageController {
return modelAndView; return modelAndView;
} }
System.out.println("1===2=");
beanValidator.validate(board, bindingResult); beanValidator.validate(board, bindingResult);
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
// 공통코드 Set // 공통코드 Set
@ -2101,6 +2290,8 @@ public class EgovBBSManageController {
return modelAndView; return modelAndView;
} }
System.out.println("1===3=");
List<FileVO> result = null; List<FileVO> result = null;
String atchFileId = ""; String atchFileId = "";
String isThumbFile = ""; String isThumbFile = "";
@ -2120,6 +2311,8 @@ public class EgovBBSManageController {
atchFileId = fileMngService.insertFileInfs(result); atchFileId = fileMngService.insertFileInfs(result);
} }
System.out.println("1==4==");
board.setAtchFileId(atchFileId); board.setAtchFileId(atchFileId);
board.setBbsId(board.getBbsId()); board.setBbsId(board.getBbsId());
board.setNttCn(unscript(board.getNttCn())); // XSS 방지 board.setNttCn(unscript(board.getNttCn())); // XSS 방지
@ -2134,6 +2327,9 @@ public class EgovBBSManageController {
redirectAttributes.addAttribute("bbsId", boardVO.getBbsId()); redirectAttributes.addAttribute("bbsId", boardVO.getBbsId());
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.insert")); redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.insert"));
modelAndView.addObject("result", "success"); modelAndView.addObject("result", "success");
System.out.println("1==5==");
return modelAndView; return modelAndView;
} }
@ -3567,4 +3763,12 @@ public class EgovBBSManageController {
} }
return day ; return day ;
} }
private void setSessionMessageRemove(HttpSession session){
session.removeAttribute("url");
session.removeAttribute("message");
session.removeAttribute("opener");
session.removeAttribute("append");
session.removeAttribute("self");
}
} }

View File

@ -1,7 +1,6 @@
package seed.com.gtm.base; package seed.com.gtm.base;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.net.URLDecoder;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ -198,6 +197,19 @@ public class BaseController {
//mav.addObject("data", bservice.list(params)); //mav.addObject("data", bservice.list(params));
params.put("data", JSPUtil.fixNull(bservice.list(params))); params.put("data", JSPUtil.fixNull(bservice.list(params)));
}else if("S".equals(type)){ }else if("S".equals(type)){
//기안자 GW ID 받아오기
//params.put("sql", "join.selectNewOne");
try {
//params.put("gwData", JSPUtil.fixNull(service.memberNewOne(params)));
Map<String, Object> tmap = (Map<String, Object>) JSPUtil.fixNull(memberService.memberNewOne(params));
//params.put("gwId", tmap.get("MEMBER_ITEM_F6").toString());
params.put("gwId", this.getGWID(tmap));
}catch(Exception ex) {
ex.printStackTrace();
}
//mav.addObject("data", bservice.select(params)); //mav.addObject("data", bservice.select(params));
params.put("data", JSPUtil.fixNull(bservice.select(params))); params.put("data", JSPUtil.fixNull(bservice.select(params)));
}else if("I".equals(type)){ }else if("I".equals(type)){
@ -728,4 +740,14 @@ public class BaseController {
return "/_common/jsp/message"; return "/_common/jsp/message";
} }
private String getGWID(Map<String, Object> p_tmap) {
//Map<String, Object> tmap = (Map<String, Object>) JSPUtil.fixNull(memberService.memberNewOne(params));
//return p_tmap.get("MEMBER_ITEM_F6").toString();
if ("seed".equals(p_tmap.get("MEMBER_ID").toString())) {
return "test04";
}
return p_tmap.get("MEMBER_ID").toString();
//params.put("gwId", tmap.get("MEMBER_ID").toString());
//params.put("gwId", tmap.get("MEMBER_ITEM_F6").toString());
}
} }

View File

@ -3531,7 +3531,7 @@ function nanumCall_bef(p_no, p_name, p_fileKey){
function nanumApi(jobID, codeNo, nanumSubject, obj1, obj2, obj3, obj4, function nanumApi(jobID, codeNo, nanumSubject, obj1, obj2, obj3, obj4,
obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15){ obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15){
alert(jobID+":"+codeNo+":"+nanumSubject); //alert(jobID+":"+codeNo+":"+nanumSubject);
//alert(obj4+":"+obj5); //alert(obj4+":"+obj5);
//alert(obj6+":"+obj7); //alert(obj6+":"+obj7);

View File

@ -83,7 +83,7 @@ var _searchYear = "<c:out value='${boardVO.searchYear}'/>";
<!-- page_location --> <!-- page_location -->
<ul class="page_location"> <ul class="page_location">
<li><i class="icon home"></i></li> <li><i class="icon home"></i></li>
<li>게시판</li>bbb <li>게시판</li>
<li>${brdMstrVO.bbsNm}</li> <li>${brdMstrVO.bbsNm}</li>
</ul> </ul>
<!-- //page_location --> <!-- //page_location -->
@ -105,19 +105,19 @@ var _searchYear = "<c:out value='${boardVO.searchYear}'/>";
<input type="hidden" id= "password" name="password" value=""/> <input type="hidden" id= "password" name="password" value=""/>
<input type="hidden" id="pubDetail" name="pubDetail" value=""/> <input type="hidden" id="pubDetail" name="pubDetail" value=""/>
<div class="search_wrap"> <!-- <div class="search_wrap"> -->
<select name="searchCnd" id="subSearch" class="select"> <!-- <select name="searchCnd" id="subSearch" class="select"> -->
<option value="" <c:if test="${searchVO.searchCnd == ''}">selected="selected"</c:if>>전체</option> <%-- <option value="" <c:if test="${searchVO.searchCnd == ''}">selected="selected"</c:if>>전체</option> --%>
<option value="0" <c:if test="${searchVO.searchCnd == '0'}">selected="selected"</c:if>>제목</option> <%-- <option value="0" <c:if test="${searchVO.searchCnd == '0'}">selected="selected"</c:if>>제목</option> --%>
<option value="1" <c:if test="${searchVO.searchCnd == '1'}">selected="selected"</c:if>>내용</option> <%-- <option value="1" <c:if test="${searchVO.searchCnd == '1'}">selected="selected"</c:if>>내용</option> --%>
</select> <!-- </select> -->
<input type="text" name="searchWrd" class="input_text" title="검색어 입력" placeholder="검색어를 입력하세요" onfocus="this.placeholder=''" value='<c:out value="${searchVO.searchWrd}"/>'> <%-- <input type="text" name="searchWrd" class="input_text" title="검색어 입력" placeholder="검색어를 입력하세요" onfocus="this.placeholder=''" value='<c:out value="${searchVO.searchWrd}"/>'> --%>
<button type="button" class="btn btn_text btn_40 darkblue_fill btn_search" onclick="javascript:linkPage('1'); return false;">검색</button> <!-- <button type="button" class="btn btn_text btn_40 darkblue_fill btn_search" onclick="javascript:linkPage('1'); return false;">검색</button> -->
</div> <!-- </div> -->
</form> </form>
<div class="table_top"> <!-- <div class="table_top"> -->
<p class="list_total_number">전체 <span class="color_blue">${resultCnt}</span>건</p> <%-- <p class="list_total_number">전체 <span class="color_blue">${resultCnt}</span>건</p> --%>
</div> <!-- </div> -->
<!-- list --> <!-- list -->
<div class="table_type_cols"> <div class="table_type_cols">
@ -233,7 +233,7 @@ var _searchYear = "<c:out value='${boardVO.searchYear}'/>";
<button type="button" class="btnType09" onclick="javascript:fn_egov_addNotice(); return false;">글쓰기</button> <button type="button" class="btnType09" onclick="javascript:fn_egov_addNotice(); return false;">글쓰기</button>
</c:if> </c:if>
<button type="button" class="btn btn_text btn_40 darkblue_fill btn_search" onclick="javascript:fn_egov_addNotice(); return false;">글쓰기</button> <button type="button" class="btn btn_text btn_40 darkblue_fill btn_search" onclick="javascript:fn_egov_addNotice(); return false;">글쓰기</button>
<button type="button" class="btn btn_text btn_40 darkblue_fill btn_search" onclick="javascript:linkPage('1'); return false;">검색</button> <!-- <button type="button" class="btn btn_text btn_40 darkblue_fill btn_search" onclick="javascript:linkPage('1'); return false;">검색</button> -->
</div> </div>
<!-- //하단 버튼 --> <!-- //하단 버튼 -->
</div> </div>

View File

@ -24,6 +24,7 @@
<head> <head>
<!-- 첨부파일용 CSS --> <!-- 첨부파일용 CSS -->
<script type="text/javascript" src="<c:url value="/validator.do"/>"></script> <script type="text/javascript" src="<c:url value="/validator.do"/>"></script>
<script src="/js/ncms_common.js"></script>
<validator:javascript formName="board" staticJavascript="false" xhtml="true" cdata="false" /> <validator:javascript formName="board" staticJavascript="false" xhtml="true" cdata="false" />
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
@ -39,7 +40,7 @@
}); });
$(".lnb").hide();// 메뉴 색상 숨기기
}); });
function fn_egov_regist_notice() { function fn_egov_regist_notice() {
@ -61,74 +62,28 @@
function moveFunc(type){ function moveFunc(type){
if(type == "step02"){ if(type == "step02"){
$("#moveFrm").attr("action", "/web/main/mainPage.do"); location.href="/web/main/mainPage.do";
$("#moveFrm").submit(); //$("#moveFrm").attr("action", "/web/cop/bbsWeb/selectBoardErrorList.do?bbsId=BBSMSTR_000000000010");
//$("#moveFrm").submit();
}else if(type == "step03"){ }else if(type == "step03"){
if($("#reserveTel01").val() == ""){ if($("#nttSj").val() == ""){
alert("전화번호를 입력해 주세요"); alert("오류제목을 입력해 주세요");
$("#reserveTel01").focus(); $("#nttSj").focus();
return false; return false;
} }
if($("#reserveTel02").val() == ""){ if($("#nttCn").val() == ""){
alert("전화번호를 입력해 주세요"); alert("오류내용을 입력해 주세요");
$("#reserveTel02").focus();
return false;
}
if($("#reserveTel03").val() == ""){
alert("전화번호를 입력해 주세요");
$("#reserveTel03").focus();
return false;
}
/*
if($("#caseGubun").val() == ""){
alert("조정유형을 선택해 주세요");
$("#caseGubun").focus();
return false;
}
*/
if($("#applcntTel01").val() == ""){
alert("전화번호를 입력해 주세요");
$("#applcntTel01").focus();
return false;
}
if($("#applcntTel02").val() == ""){
alert("전화번호를 입력해 주세요");
$("#applcntTel02").focus();
return false;
}
if($("#applcntTel03").val() == ""){
alert("전화번호를 입력해 주세요");
$("#applcntTel03").focus();
return false;
}
if($("#applcntEmail").val() == ""){
alert("이메일을 입력해 주세요");
$("#applcntEmail").focus();
return false;
}
if($("#counselTitle").val() == ""){
alert("상담제목을 입력해 주세요");
$("#counselTitle").focus();
return false;
}
if($("#editorParam_counselContent").val() == ""){
alert("상담내용을 입력해 주세요");
return false; return false;
} }
$("#writeFrm").attr("action", "/web/user/lawCounsel/${siteIdx}/02/${siteMenuIdx}/lawWrite.do"); //$("#writeFrm").attr("action", "/web/user/lawCounsel/${siteIdx}/02/${siteMenuIdx}/lawWrite.do");
$("#writeFrm").submit(); //$("#writeFrm").submit();
goSave();
}else if(type == "list"){ }else if(type == "list"){
$("#examNo").remove(); $("#examNo").remove();
$("#fileFuncType").remove(); $("#fileFuncType").remove();
@ -144,6 +99,73 @@
} }
} }
} }
/* 글 저장 function */
function goSave(method_parm ){ //method_parm :관리자로그 메소드에서 사용.(파일업로드 부분 공통으로 사용하여, 페이지 구분을 위해)
if($('#content').length > 0){ //팝업존에서 타이틀 무조건 체크
if('' == $('#content').val()){
alert("이미지 등록시 타이틀은 필수입니다.");
return false;
}
}
/*if(undefined !=$("input[name=limitcount]").val() && ""!=$("input[name=limitcount]").val() ){
if($('#atchFileNece').length > 0 ){
if($('#tbody_fiielist').find('tr').length == 0){
alert("첨부파일을 추가해 주십시오");
return false;
}
}
}*/
var msg;
msg = "해당 첨부파일을 수정하시겠습니까?";
var data = new FormData(document.writeForm == undefined ? document.board : document.writeForm);
_fileForm2.forEach(function(obj, idx) {
if (obj) data.append("file"+idx, obj.fileObj);
});
var url = "";
url = "/web/cop/bbs/insertBoardArticleAjax.do";
/*
if($("#pageType").val() == "insert"){//게시판저장
url = "/cop/bbs/insertBoardArticleAjax.do";
}else if($("#pageType").val() == "replay"){ //게시판 답변
url = "/cop/bbs/replyBoardArticleAjax.do";
}else{
url = document.writeForm == undefined ? "/cop/bbs/updateBoardArticleAjax.do" : "/uss/ion/fms/FmsFileInsertAjax.do?logParam="+method_parm;
}
*/
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: url,
data: data,
dataType:'json',
async: false,
processData: false,
contentType: false,
cache: false,
//timeout: 600000,
success: function (returnData, status) {
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
if("fail"==returnData.result){
alert(returnData.message);
return;
}
alert("저장 되었습니다.11");
moveFunc('step02');
//goList();
} else if(status== 'fail'){
alert("저장에 실패하였습니다. 22!!");
}
},
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
});
}
</script> </script>
<form action="" method="get" id="moveFrm"> <form action="" method="get" id="moveFrm">
@ -185,7 +207,7 @@
<!-- page_location --> <!-- page_location -->
<ul class="page_location"> <ul class="page_location">
<li><i class="icon home"></i></li> <li><i class="icon home"></i></li>
<li>게시판</li>bbb <li>게시판</li>
<li>${brdMstrVO.bbsNm}</li> <li>${brdMstrVO.bbsNm}</li>
</ul> </ul>
<!-- //page_location --> <!-- //page_location -->
@ -208,35 +230,96 @@
<p class="required_text">*<span>필수입력</span></p>오류제목 <p class="required_text">*<span>필수입력</span></p>오류제목
</th> </th>
<td colspan="3"> <td colspan="3">
<input type="text" class="input_text w100per" placeholder="ex) 가맹사업거래 상담 신청합니다." id="counselTitle" name="counselTitle"> <input type="text" class="input_text w100per" id="nttSj" name="nttSj">
</td> </td>
</tr> </tr>
<tr> <tr>
<th>오류내용</th> <th>오류내용</th>
<td colspan="3"> <td colspan="3">
<div class="length_wrap"> <div class="length_wrap">
<textarea name="editorParam_counselContent" id="editorParam_counselContent" class="input_text"></textarea> <textarea name="nttCn" id="nttCn" class="input_text" placeholder="ex) 연락처를 남겨주시면 연락드리겠습니다."></textarea>
<p class="length"><span class="color_red">0</span>/ 1300자</p> <p class="length"><span class="color_red">0</span>/ 1300자</p>
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<th> <tr>
첨부파일 <th class="req_text">
</th> <p>첨부파일</p>
<td colspan="3"> </th>
<div class="file_upload_wrap"> <td class="upload_area">
<div class="file_button"> <!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> --><!-- <button type="button" class="btnType01 btn_add_file">파일 첨부하기</button> -->
<input type="file" id="file" class="input_file"> <input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display:none"/>
<label for="file" class="file btn btn_text btn_40 darkblue_border">파일선택</label> <button type="button" id="filebutton" class="btn btn_text btn_30 blue_border btnType01 btn_add_file">파일 첨부하기</button>
</div> <div class="file_wrap file_upload_box no_img_box" style="width:700px;">
<ul class="file_list fill"> <table class="tbType02">
<li><a href="#none" download="download"><i class="icon file clip"></i><span class="file_name">분쟁조정신청 관련_필요한 첨부이미지_10310.png </span><span class="file_size">457kb</span></a> <button type="button" class="btn btn_only_icon round"><i class="icon delete gray_fill"></i></button></li> <caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
</ul> <colgroup>
</div> <col style="width: 60%;">
</td> <col style="width: auto;">
</tr> <col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th style="text-align:center;">파일 명</th>
<th style="text-align:center;">종류</th>
<th style="text-align:center;">크기</th>
<th style="text-align:center;">삭제</th>
</thead>
<tbody class="tb_file_before">
<tr>
<td colspan="4">
<p>첨부하실 파일을 <span>마우스로 끌어서</span> 넣어주세요.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="file_wrap fileAfter file_list_div" style="width:700px;">
<table class="tbType02">
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 10%">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th style="text-align:center;">파일 명</th>
<th style="text-align:center;">종류</th>
<th style="text-align:center;">크기</th>
<th style="text-align:center;">삭제</th>
</thead>
<tbody id="tbody_fiielist" class="tb_file_after">
<c:forEach var="fileList" items="${fileList}" varStatus="status">
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
<td class="td_filename">
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
</td>
<td class="td_filesort">
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>"><c:out value="${fileList.fileExtsn}"/></span>
</td>
<td class="td_filesize">
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>"><c:out value="${fileList.fileMg}"/></span>
</td>
<td>
<button type="button" class="btn btn_text btn_30 red_border btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;" title="파일삭제">삭제</button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</td>
</tr>
</tbody> </tbody>
</table> </table>