📄 content_prt.jsp
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="com.cyberway.dynaform.form.ejb.Form"%>
<%@ page import="com.cyberway.framework.web.WebUser"%>
<%@ page import="com.cyberway.web.ParamsTable"%>
<%@ page import="com.cyberway.constants.Web"%>
<%@ page import="com.cyberway.dynaform.document.web.DocumentForm"%>
<%@ page import="com.cyberway.dynaform.document.ejb.Document"%>
<%@ page import="com.cyberway.dynaform.form.ejb.ValidateMessage"%>
<%@ page import="com.cyberway.cms.util.CMSCommonUtil"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.util.Iterator"%>
<%@ 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" %>
<%
String contextPath = request.getContextPath();
String currURL = request.getRequestURL().toString();
boolean isEdit = false;
if(currURL.indexOf("edit.do") > 0){
isEdit = true;
}
pageContext.setAttribute("SITE", CMSCommonUtil.getSite());
String formname = request.getParameter("formname");
Document document = null;
Form template = (Form)request.getAttribute("TEMPLATE");
DocumentForm documentForm = (DocumentForm)request.getAttribute("DocumentForm");
Collection errors = (Collection)request.getAttribute("ERRORS");
String errMess = (String)request.getAttribute("ERRMESSAGE");
if (documentForm!=null){
document = (Document)documentForm.getValueObject();
formname = document.getFormname();
}
%>
<html:html>
<head>
<title><s:Language key="docedit"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="<%= contextPath %>/css/default2.css" type="text/css">
<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/xml.js"></script>
<script src="<%= contextPath %>/js/select.js"></script>
<script language="JavaScript">
var contextPath = '<%= contextPath %>';
var ev_beforesave;
<c:choose>
<c:when test="${!empty param.style and param.style eq '2'}">
cmdReturn = '/main2.jsp?tab=4';
</c:when>
<c:when test="${!empty param.style and param.style eq '0'}">
cmdReturn = '/allApprove.do';
</c:when>
<c:when test="${!empty param.style and param.style eq '9'}">
cmdReturn = '/main.jsp';
</c:when>
<c:when test="${!empty param.style and param.style eq '11'}">
cmdReturn = '/dynaform/document/approveByChannel.do';
</c:when>
<c:when test="${!empty param.style and param.style eq '12'}">
cmdReturn = '/dynaform/document/hadApproveByChannel.do';
</c:when>
<c:when test="${!empty param.style and param.style eq '13'}">
cmdReturn = '/dynaform/document/approve.do';
</c:when>
<c:when test="${!empty param.style and param.style eq '99'}">
cmdReturn = '/billflow/docflow/listAll.do?approve=true';
</c:when>
<c:otherwise>
cmdReturn = '/dynaform/document/listbychn.do';
</c:otherwise>
</c:choose>
cmdSave = '/dynaform/document/save.do?formname=<%=formname%>&defipk=<%=request.getParameter("defipk")%>';
cmdEdit = '/dynaform/document/edit.do?formname=<%=formname%>';
cmdLink = '/dynaform/document/flow.do?id=<c:out value="${DocumentForm.valueObject.id}" />&type=dynadocument&formname=<%=formname%>&approve=<c:out value="${param.approve}"/>';
cmdRecalculate = '/dynaform/document/recalculate.do?formname=<%=formname%>&approve=<c:out value="${requestScope.ISAPPROVE}"/>';
cmdPreview = '/dynaform/document/explore.do';
cmdView = '/dynaform/document/view.do';
cmdSaveAndNew = '/dynaform/document/saveAndNew.do';
cmdNew = '/dynaform/document/newchn.do';
function doSaveAndNew(){
cmdSave = addParam(contextPath + cmdSaveAndNew, 'TONEW', 'true');
doSave();
}
function ev_new(){
formItem.id.value = "0";
formItem.formname.value = "";
var url = addParam(contextPath + cmdNew, 'ISEDIT', 'TRUE');
url = addParam(url, 'COMMAND', 'new');
url = addParam(url, 'SAVEANDNEW', 'true');
formItem.action = url;
formItem.submit();
}
function doPress(){
var url = contextPath + '/component/sendmail/pressDynaDocPrc.do?id=<c:out value="${DocumentForm.valueObject.id}" />';
var tmp = window.showModalDialog(url,"","dialogHeight: 300px; dialogWidth: 400px; dialogTop: 200px; dialogLeft: 200px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: no;")
}
function ev_process(){
var url = contextPath + cmdLink;
<c:choose>
<c:when test="${requestScope.ISAPPROVE eq 'TRUE' and !empty param.ISEDIT and param.ISEDIT eq 'TRUE'}">
cmdSave = addParam(cmdSave, "FLOWPROCESSSAVE", "true");
doSave();
</c:when>
<c:otherwise>
doFlowProcess();
</c:otherwise>
</c:choose>
if(document.all("btnProcess") != null){
document.all("btnProcess").disabled = true;
}
// }
// }
// doSaveNoReturn();
// doFlowProcess();
}
function ev_checkval() {
return checkval(window);
}
function ev_return(){
cmdReturn = addParam(cmdReturn, 'channelid', formItem._channelid.value);
doReturn();
}
function ev_link(){
cmdLink = addParam(cmdLink, 'channelid', formItem._channelid.value);
doLink();
}
function ev_recalculate() {
enable();
if(document.all("btnSave") != null){
document.all("btnSave").disabled = true;
}
var url = addParam(contextPath + cmdRecalculate, 'ISEDIT', 'TRUE');
formItem.action = url;
formItem.submit();
}
function ev_preview(){
if(formItem.id.value=='0'){
alert('<s:Language key="draft_not_save"/>!');
return false;
}
if(formItem._defaultdetailtmplname.value==''){
alert('<s:Language key="channel_no_detailtemp_or_draft_notsave"/>!');
return false;
}
var url="previewdoc.jsp?channelid="+formItem._channelid.value+"&docid="+formItem.id.value;
window.open(url);
}
function doPrint2(){
parent.window.frames['_content'].focus();
_content.focus();
try{
topbutton.style.display = 'none';
subform1.style.display = 'none';
subform2.style.display = 'none';
}catch(ex){}
parent.window.frames['_content'].print();
_content.print();
try{
topbutton.style.display = '';
subform1.style.display = '';
subform2.style.display = '';
}catch(ex){}
}
</script>
</head>
<xml id="myXML"></xml>
<body style="background-color: #A4C190;">
<html:form action="/dynaform/document/view.do" styleId="formItem" method="post">
<html:hidden property="id"/>
<html:hidden property="owner"/>
<html:hidden property="formname"/>
<html:hidden property="author"/>
<html:hidden property="_channelid"/>
<html:hidden property="channelids"/>
<html:hidden property="lastmodified"/>
<html:hidden property="_defaultdetailtmplname"/>
<html:hidden property="_defaultsummarytmplname"/>
<html:hidden property="_new"/>
<html:hidden property="state"/>
<html:hidden property="auditdate"/>
<html:hidden property="audituser"/>
<html:hidden property="auditusers"/>
<input type="hidden" name="approve" value="<c:out value='${param.approve}' />">
<input type="hidden" name="style" value="<c:out value="${param.style}"/>">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="topbutton">
<tr>
<td align="right" valign="middle">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<c:if test="${requestScope.ISAPPROVE eq 'TRUE'}">
<input type="button" name="btnSave" value="<s:Language key="save"/>" class="bt-save" onclick="doSave()">
</c:if>
</c:when>
<c:otherwise>
<c:if test="${requestScope.ISAPPROVE eq 'TRUE'}">
<input type="button" name="btnEdit" value="<s:Language key="edit"/>" class="bt-edit" onClick="doEdit()">
</c:if>
</c:otherwise>
</c:choose>
<input type="button" name="btnProcess" value="<s:Language key="flow_process"/>" class="bt-flow" onclick="ev_process();">
<input type="button" name="btnPrint" value="<s:Language key="print"/>" class="bt-print" onclick="doPrint2()">
<input type="button" name="btnReturn" value="<s:Language key="return"/>" class="bt-exit" onclick="ev_return()" >
</td>
</tr>
<html:errors/>
<tr>
<td class="list-datas">
</td>
</tr>
</table>
<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="2" class="dybody" align="left" id="_content">
<tr style="display:none">
<td width="15%" class="content-label"><div class="field-require"><s:Language key="channelin"/>:</div></td>
<td width="75%" class="content-info" colspan="3">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<html:text styleClass="input-text-disable" style="width:70%" property="_channelsname" disabled="true"/>
<input type="button" name="btnSelectMenu" value="" class="srchbt" onclick="selectChannels('0', formItem.channelids,formItem._channelsname)" readonly="true">
</c:when>
<c:otherwise>
<html:text styleClass="input-text-disable" property="_channelsname" disabled="true"/>
</c:otherwise>
</c:choose>
</td>
</td>
</tr>
<tr>
<td width="100%" colspan=4 valign="top">
<%
ParamsTable params = (ParamsTable)request.getAttribute("PARAMSTABLE");
if(params == null){
params = ParamsTable.convertHTTP(request);
}
WebUser user = (WebUser) session.getAttribute(Web.SESSION_ATTRIBUTE_USER);
out.print(template.toHtml(document, params, user, errors));
%>
</td>
</tr>
</table>
<s:KeepCondition form="formItem"/>
</html:form>
<script>
<c:if test="${!empty requestScope.FLOWPROCESS and requestScope.FLOWPROCESS eq 'true'}">
window.returnValue = "true";
window.close();
</c:if>
<c:if test="${!empty requestScope.FLOWPROCESSOPEN and requestScope.FLOWPROCESSOPEN eq 'true'}">
doFlowProcess();
</c:if>
<c:if test="${!empty requestScope.SAVEANDNEW and requestScope.SAVEANDNEW eq 'true'}">
ev_new();
</c:if>
</script>
</body>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -