
<%
            /************************************************************@@
             * Program Name	: base_info_modify.jsp
             * Description		: 집계문서 기본정보 변경
             * Author				: 강원중
             * Create Date		: 2004-11-11
             * History				:
            @@************************************************************/
%>

<%@ page contentType="text/html; charset=UTF-8" import="java.util.Date"
         import="java.text.SimpleDateFormat" import="kr.co.kihyun.lang.MInteger"
         import="kr.co.kihyun.moumi.report.MReport"
         import="kr.co.kihyun.beans.totsys.report.ReportList"
         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.*"%>

<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>

<%            PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
            try {
                /****** Parameter ******/
                Long docID = MLong.parseLong(request.getParameter("docID"), null);

                /****** Doc list data get ******/
                TotDoc totDoc = pm.getObjectById(TotDoc.class, docID);
                String docName = totDoc.getName();
                Date regDate = totDoc.getRegDate();
                AccessAuth accAuth = totDoc.getAccessAuth();
                int groupID = totDoc.getType().ordinal();

%>
<script src="/totsys/common/js/rollover.js"></script>
<script src="/totsys/common/js/util.js"></script>
<script language="javascript">
    function formSubmit(){
        if (docForm.docName.value == '') {
            alert('문서 명을 입력하지 않으셨습니다.');
            docForm.docName.focus();
            return;
            //}else if (containsChars(docForm.docName,'￦/?"<>|!,*&^%$#@~;')) {
        }else if (containsChars(docForm.docName,'￦/&^%$#@')) {
            alert('문서명에는 특수(￦/&^%$#@) 문자를 사용할 수 없습니다.');
            docForm.docName.focus();
            return;
        }else if (docForm.accAuth[0].checked == false && docForm.accAuth[1].checked == false && docForm.accAuth[2].checked == false) {
            alert('문서권한을 입력하지 않으셨습니다.');
            return;
        }else{
            docForm.submit();
        }
    }

    function containsChars(input,chars) {
        for (var inx = 0; inx < input.value.length; inx++) {
            if (chars.indexOf(input.value.charAt(inx)) != -1)
                return true;
        }
        return false;
    }
</script>

<form name="docForm"
      action="/servlet/kr.co.kihyun.beans.totsys.doc.HttpDocModifyer"
      method="post">
    <INPUT type="hidden" name="docID" value="<%= docID%>">
    <input type="hidden" name="docGroupID" value="<%= groupID%>">
    <input type="hidden" name="userID" value="usID">
    <input type="hidden" name="repDocID" value="repDocID">
    <tr>
        <td><img src="images/s_form_info.gif"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td colspan="4">
            <table border="1" bordercolor="#abbddd" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="149" class="kecttep_tdmenu">
                        <img src="images/reg_icon.gif" align="absmiddle">양식명</td>
                    <td width="326" style="padding-left: 15; padding-top: 4;">
                        <input name="docName" value="<%= docName%>" type="text" class="inputtxt" STYLE="ime-mode: active; width: 300"></td>
                    <td width="149" class="kecttep_tdmenu">
                        <img src="images/reg_icon.gif" align="absmiddle">양식권한</td>
                    <td width="326" style="padding-left: 15;">
                        <input name="accAuth" value="0" type="radio"
                               <%if (accAuth == AccessAuth.PER) {%> checked <%}%>>개인
                        <input name="accAuth" value="1" type="radio"
                               <%if (accAuth == AccessAuth.DEPT) {%> checked <%}%>>부서
                        <input name="accAuth" value="2" type="radio"
                               <%if (accAuth == AccessAuth.PART) {%> checked <%}%>>전체</td>
                </tr>
                <tr>
                    <td width="149" class="kecttep_tdmenu">
                        <img src="images/reg_icon.gif" align="absmiddle">등록일</td>
                    <td style="padding-left: 15; padding-top: 4;"><%= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(regDate)%></td>
                    <td width="149" class="kecttep_tdmenu">
                        <img src="images/reg_icon.gif" align="absmiddle">기타</td>
                    <td width="326" style="padding-left: 15;">&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>


    <tr>
        <td height="50" colspan="4" align="center">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td><a href="#" onMouseOut="MM_swapImgRestore()"
                           onMouseOver="MM_swapImage('bt_enter','','/totsys/common/inc/documents/tot_doc/images/bt_enter.gif',1)">
                            <img onclick="formSubmit();"
                                src="/totsys/common/inc/documents/tot_doc/images/bt_enter.gif"
                                name="bt_enter" border="0"></a></td>
                    <td>&nbsp;</td>
                    <td><a href="#" onMouseOut="MM_swapImgRestore()"
                           onMouseOver="MM_swapImage('bt_cancel3','','/totsys/common/inc/documents/tot_doc/images/bt_cancel3.gif',1)">
                            <img onclick="history.go(-1);"
                                src="/totsys/common/inc/documents/tot_doc/images/bt_cancel3.gif"
                                name="bt_cancel3" border="0"></a></td>
                </tr>
            </table>
        </td>
    </tr>
</form>

<%
            } catch (Exception ex) {
                ex.printStackTrace();
                out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';"));
            } finally {
                pm.close();
            }
%>
