diff --git a/src/main/webapp/WEB-INF/jsp/nlib/collection/searchItemDetail.jsp b/src/main/webapp/WEB-INF/jsp/nlib/collection/searchItemDetail.jsp index b9c8a46a..f87902ab 100644 --- a/src/main/webapp/WEB-INF/jsp/nlib/collection/searchItemDetail.jsp +++ b/src/main/webapp/WEB-INF/jsp/nlib/collection/searchItemDetail.jsp @@ -224,7 +224,7 @@ function goList(){ - + diff --git a/src/main/webapp/WEB-INF/jsp/nlib/sample/listRentItem.jsp b/src/main/webapp/WEB-INF/jsp/nlib/sample/listRentItem.jsp deleted file mode 100644 index 4b215809..00000000 --- a/src/main/webapp/WEB-INF/jsp/nlib/sample/listRentItem.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<% -/** - *
- * @Class Name : listRentItem.jsp (샘플)
- * 
- * @Description : RESTful API 호출 샘플
- * 
- * 
- * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
- *
- * 
- * - * @ ------------ -------- --------------------------- - * @ 수정일 수정자 수정내용 - * @ ------------ -------- --------------------------- - * @ 2021. 6. 15. KNKIM 최초 생성 - * - * - * @author 이씨플라자 * DIGITALSHIP KNKIM - * @since 2021. 6. 15. - * @version 1.0 - * - */ - %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> -대출목록 - - - - -${pageTitle} - - - - - - - - -
- -
- -

${pageTitle}

- -
Server Protocol : ${serverProtocol}
-
Server IP : ${serverIp}
-
Server PORT : ${serverPort}
- -
  - 카트
-
  -
- - rows :
- page :
- mngOrgCd :
- mbInfoId :
- -------------------------------------------------------------------------- -
- resultCode :
- resultMessage :
- totPages :
- records :
- list :
- -      > -----------------------------------------------------------
-      > mngOrgCd = ${record.mngOrgCd}
-      > operReadRangeCd = ${record.operReadRangeCd}
-      > bookLtRvStatusCd = ${record.bookLtRvStatusCd}
-      > title = ${record.title}
-      > typeCodeNm = ${record.typeCodeNm}
-      > awaiterCnt = ${record.awaiterCnt}
-      > useStatus = ${record.useStatus}
-      > masterId = ${record.masterId}
- - -
-
- -
- -
- - - -
- -
- - - diff --git a/src/main/webapp/js/cart.js b/src/main/webapp/js/cart.js index b55e6bbd..cdb7274f 100644 --- a/src/main/webapp/js/cart.js +++ b/src/main/webapp/js/cart.js @@ -6,61 +6,27 @@ * */ -function fn_addRentCart(masterId, lentYn , onReqYn ) { - - /* useStatus - 01 : 이용가능 - 02 : 대출중 (대기자 0명) - 03 : 대출중 (대기자 1명) - 04 : 열람대기(대출가능) - 05 : 이용가능 - 06 : 열람대기(대출불가능) - 07 : 온라인열람만" - */ - fn_addRentCartItem(masterId, lentYn, onReqYn - , function(data) { - if(data.code == "S") { - if(confirm(data.message + "\n카트로 이동하시겠습니까?")) { - fn_gotoCart(); - } - } else { - alert(data.message); - } - } - , function(error) { - alert(error.message); - } - ); - - return false; -} +function fn_addRentCart(masterId, ableRent , ableRead ) { -function fn_gotoCart() { - location.href = "/cart/listCartItems.do"; -} - -function fn_addRentCartItem(masterId, lentYn, onReqYn, resolve, reject) { - - var cartTypeCd = null; if(masterId == "undefined" || masterId == "") { - reject(new Error("선택된 자료 정보가 없습니다.")); + alert("선택된 자료 정보가 없습니다."); return; } - if((lentYn == "undefined" || lentYn == "") || (onReqYn == "undefined" || onReqYn == "")) { - reject(new Error("선택된 자료의 상태 정보를 확인할 수 없습니다.")); + if((ableRent === undefined || ableRent == "") || (ableRead === undefined || ableRead == "")) { + alert("선택된 자료의 상태 정보를 확인할 수 없습니다."); return; } - if(lentYn == "Y") { + if(ableRent) { cartTypeCd = "1"; // 대출 - } else if(onReqYn == "Y") { + } else if(ableRead) { cartTypeCd = "2"; // 방문열람 } else { - reject(new Error("해당 자료의 상태를 확인할 수 없습니다.")); - return null; + alert("대출 또는 방문열람이 가능한 자료만 카트에 추가 가능합니다."); + return; } $.ajax({ @@ -73,12 +39,24 @@ function fn_addRentCartItem(masterId, lentYn, onReqYn, resolve, reject) { cartTypeCd : cartTypeCd }), success : function(data) { - resolve(JSON.parse(data)); + var jsonData = JSON.parse(data); + if(jsonData.code == "S") { + if(confirm(jsonData.message + "\n카트로 이동하시겠습니까?")) { + fn_gotoCart(); + } + } else { + alert(jsonData.message); + } }, error : function(error) { - reject(error); + alert(error.message); } }); + +} + +function fn_gotoCart() { + location.href = "/cart/listCartItems.do"; } function fn_addReserveCart() {