📄 content.jsp
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page buffer="50kb"%>
<%@ page import="billflow.*, java.util.*,com.cyberway.utility.*,com.cyberway.utility.sequence.*"%>
<%@ page import="com.cyberway.info.info.web.InfoForm"%>
<%@ page import="com.cyberway.info.info.ejb.InfoVO"%>
<%@ page import="com.cyberway.info.info.ejb.InfoState"%>
<%@ page import="com.cyberway.utility.property.DefaultProperty"%>
<%@ page import="com.cyberway.constants.Web, com.cyberway.framework.web.WebUser"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/smartweb" prefix="s" %>
<c:set var="id" value="${InfoForm.id}" />
<%
String contextPath = request.getContextPath();
WebUser user = (WebUser)session.getAttribute(Web.SESSION_ATTRIBUTE_USER);
String outpath = pageContext.getServletContext().getInitParameter("OUTURL");
String path = contextPath + DefaultProperty.getProperty("WEB_DOCPATH");
path = StringUtil.replace(path,"\\","\\\\");
System.out.println(path);
session.setAttribute("pageContext",pageContext);
%>
<html:html>
<head>
<title> {*[Infomation edit]*} </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="<%= contextPath %>/css/info.css" type="text/css">
<script src="<%= contextPath %>/js/billlist.js"></script>
<script src="<%= contextPath %>/js/billitem.js"></script>
<script src="<%= contextPath %>/js/check.js"></script>
<script src="<%= contextPath %>/js/util.js"></script>
<script src="<%= contextPath %>/js/info.js"></script>
<script src="<%= contextPath %>/js/ntkoocx.js"></script>
<script src="<%= contextPath %>/js/word.js"></script>
<script language="JavaScript">
<!--
var contextPath = '<%= contextPath %>';
var outpath = '<%= outpath %>';
var path = '<%= path %>';
var sq = '<%= Sequence.getSequence()%>';
cmdReturn = '/info/info/list.do';
if(<c:out value="${id}"/>=='0'){
cmdSave = contextPath + '/info/info/save.do?infoid='+sq+'&isNew=yes';
cmdSaveocxfiles = contextPath + '/info/info/saveocxfiles.do?infoid='+sq+'&contextPath=<%=contextPath%>&isNew=yes';
cmdPublish = contextPath + '/info/info/publish.do?infoid='+sq+'&contextPath=<%=contextPath%>&isNew=yes';
}else{
cmdSave = contextPath + '/info/info/save.do?infoid=<c:out value="${id}"/>&isNew=no';
cmdSaveocxfiles = contextPath + '/info/info/saveocxfiles.do?infoid=<c:out value="${id}"/>&contextPath=<%=contextPath%>&isNew=no';
cmdPublish = contextPath + '/info/info/publish.do?infoid=<c:out value="${id}"/>&contextPath=<%=contextPath%>&isNew=no';
}
cmdEdit = '/info/info/edit.do?id=<c:out value="${id}"/>';
cmdAction = '/info/info/action.do';
cmdChange = '/info/info/change.do';
cmdOut = outpath + contextPath + '/info/info/savedataout.do?infoid=<%= Sequence.getSequence()%>&contextPath=<%=contextPath%>';
info='<c:out value="${id}"/>';
function ev_checkval() {
if(formItem.title.value == ""){
alert("{*[Subject must be inputed ]*}");
return false;
}else if (formItem.publishtime.value==""){
alert("{*[Publish Date must be checked]*}");
return false;
}
return true;
}
function ev_save() {
if(ev_checkval()) {
var num = formItem.attachmentnum.value;
var attach ='';
var tmp;
for(var i=1; i<=num; i++){
tmp = eval("formItem.attachment"+i);
attach = attach + tmp.value +";";
}
formItem.attachment.value = attach;
<%if (DefaultProperty.getProperty("WEB_EDITOR").trim().equals("WORD")) {%>
TANGER_OCX_OBJ.ActiveDocument.AcceptAllRevisions();
TANGER_OCX_OBJ.SaveToURL(cmdSaveocxfiles, "DOCFILES", "", "0.doc", "formItem");
<%}%>
var url = addParam( cmdSave, 'ISEDIT', 'TRUE');
formItem.action = url;
formItem.submit();
}
}
function ev_publish() {
if(ev_checkval()) {
var num = formItem.attachmentnum.value;
var attach ='';
var tmp;
for(var i=1; i<=num; i++){
tmp = eval("formItem.attachment"+i);
attach = attach + tmp.value +";";
}
formItem.attachment.value = attach;
<%if (DefaultProperty.getProperty("WEB_EDITOR").trim().equals("WORD")) {%>
TANGER_OCX_OBJ.ActiveDocument.AcceptAllRevisions();
TANGER_OCX_OBJ.PublishAsHTMLToURL(cmdSaveocxfiles, "HTMLFILES", "", "0", "formItem");
<%}%>
var url = addParam(cmdPublish, 'ISEDIT', 'TRUE');
formItem.action = url;
formItem.submit();
}
}
function ev_edit() {
var url = addParam(contextPath + cmdEdit, 'ISEDIT', 'TRUE');
formItem.action = url;
formItem.submit();
}
function ev_OpenFromURL(docid) {
<%if (DefaultProperty.getProperty("WEB_EDITOR").trim().equals("WORD")) {%>
TANGER_OCX_OBJ.OpenFromURL (path + docid);
<%}%>
//TANGER_OCX_OBJ.OpenFromURL('/agileuploads/uploads/' + docid);
}
function ev_onLoad() {
//{*[Initial display]*}
ev_changesheet("BASEINFO");
<%if (DefaultProperty.getProperty("WEB_EDITOR").trim().equals("WORD")) {%>
//{*[Initial word document]*}
TANGER_OCX_OpenDoc('<c:out value="${InfoForm.content}" />');
TANGER_OCX_OBJ.IsNoCopy=false;
TANGER_OCX_OBJ.Menubar=false;
TANGER_OCX_OBJ.Titlebar=false;
<c:choose>
<c:when test="${empty param.ISEDIT or param.ISEDIT ne 'TRUE'}" >
TANGER_OCX_SetReadOnly(true);
TANGER_OCX_EnableFileNewMenu(false);
TANGER_OCX_EnableFileOpenMenu(false);
TANGER_OCX_EnableFileCloseMenu(false);
TANGER_OCX_EnableFileSaveMenu(false);
</c:when>
<c:otherwise>
<c:if test="${!empty param.ISEDIT and (empty param.COMMAND or param.COMMAND ne 'new')}">
TANGER_OCX_SetReadOnly(false);
TANGER_OCX_SetMarkModify(true);
TANGER_OCX_ShowRevisions(false);
</c:if>
</c:otherwise>
</c:choose>
<%}%>
}
function doLoadTemplate() {
if (confirm('{*[The import module will replace original contents, Are You Sure?]*}?')) {
var data = selectTemplate();
if (data && data != '') {
// richedit.setHTML(data);
TANGER_OCX_OpenDoc(data);
}
}
}
function ev_changesheet(type) {
if (type == "BASEINFO") {
document.all("BASEINFO").style.display = "";
document.all("CONTEXT").style.display = "none";
}
if (type == "CONTEXT") {
document.all("BASEINFO").style.display = "none";
document.all("CONTEXT").style.display = "";
}
}
//-->
</script>
<script src="<%= contextPath %>/js/attachments.js"></script>
</head>
<body onLoad="ev_onLoad();">
<table width="95%" border="0" cellpadding="2" cellspacing="1" id="b1">
<html:form action="/info/info/view.do" styleId="formItem" method="post" enctype="multipart/form-data">
<html:hidden property="state"/>
<html:hidden property="reader"/>
<html:hidden property="writer"/>
<html:hidden property="infofile"/>
<html:hidden property="attachment"/>
<html:hidden property="content"/>
<tr><td>
<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td height="38" class="list-toolbar">
<c:choose>
<c:when test="${empty param.ISEDIT or param.ISEDIT ne 'TRUE'}" >
<input type="button" name="btnEdit" value="{*[Modify]*}" class="bt" onClick="ev_edit();">
</c:when>
<c:otherwise>
<input type='button' name='btnSave' value='{*[Save]*}' class='bt' onclick='ev_save()'>
</c:otherwise>
</c:choose>
<c:if test="${(empty param.COMMAND or param.COMMAND ne 'new') and !empty param.ISEDIT}">
<input type='button' name='btnSave' value='{*[Publish]*}' class='bt' onclick='ev_publish()'>
<%if (DefaultProperty.getProperty("WEB_EDITOR").trim().equals("WORD")) {%>
<input type="button" name="btnSee" value="{*[Show track]*}" class="bt" onclick="TANGER_OCX_ShowRevisions(true)" >
<%}%>
</c:if>
<c:if test="${!empty param.COMMAND and param.COMMAND eq 'new'}" >
<input type="button" name="btnLoad" value="Module" class="bt" onclick="doLoadTemplate();">
</c:if>
<input type="button" name="btnPrint" value="{*[Print]*}" class="bt" onclick="doPrint();">
<input type="button" name="btnReturn" value="{*[Exit]*}" class="bt" onclick="doReturn();" >
</td>
</tr>
<tr class="row-hd">
<td height="2"> </td>
</tr>
<html:errors/>
</table>
</td></tr>
<tr><td>
<table width="200" border="0">
<tr>
<td><input type="button" class="btslt" name="btnBaseinfo" onClick="ev_changesheet('BASEINFO')" value="{*[Basic info]*}"></td>
<td><input type="button" class="btslt" name="btnContext" onClick="ev_changesheet('CONTEXT')" value="Content"></td>
</tr>
</table>
</td></tr>
<tr id="BASEINFO"><td>
<table width="100%" border="0" cellspacing="4" cellpadding="4">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -