📄 batchapprovebychannel.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="com.cyberway.cms.util.CMSCommonUtil"%>
<%@ page import="com.cyberway.utility.CommonUtil,com.cyberway.billflow.engine.FlowState"%>
<%@ page import="com.cyberway.cms.site.web.SiteForm"%>
<%@ page import="com.cyberway.web.ParamsTable"%>
<%@ page import="com.cyberway.dynaform.form.ejb.Form"%>
<%@ page import="com.cyberway.framework.web.WebUser"%>
<%@ page import="com.cyberway.constants.Web"%>
<%@ page import="com.cyberway.dynaform.form.proxy.FormProxy"%>
<%@ page import="java.util.Collection"%>
<%@ page import="com.cyberway.constants.Framework"%>
<%@ page import="com.cyberway.dynaform.document.ejb.Document"%>
<%@ page import="com.cyberway.dynaform.form.ejb.FormField"%>
<%@ 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();
ParamsTable params = ParamsTable.convertHTTP(request);
WebUser user = (WebUser)session.getAttribute(Web.SESSION_ATTRIBUTE_USER);
long channelid = Long.parseLong(request.getParameter("channelid"));
long defipk = CMSCommonUtil.getFlowidByChannel(channelid);
String formname = CMSCommonUtil.getFormtemplateByChannel(channelid);
String channelPathName = CMSCommonUtil.getChannelPathName(channelid);
long siteid=CMSCommonUtil.getSiteidByChannel(channelid);
String httpport=CMSCommonUtil.getSiteHttpAndPort(siteid);
String summarytmpl = (String)request.getAttribute("SUMMARYTMPL");
formname = (formname!=null&&formname.length()>0)?formname.trim():"";
summarytmpl = (summarytmpl!=null&&summarytmpl.length()>0)?summarytmpl.trim():"";
String budgetform = request.getParameter("budgetform");
%>
<html:html>
<head>
<title> <s:Language key="list"/> </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="<%= contextPath %>/css/css.jsp" type="text/css">
<script src="<%= contextPath %>/js/billlist.js"></script>
<script src="<%= contextPath %>/js/util.js"></script>
<script src="<%= contextPath %>/js/category.js"></script>
<script src="<%= contextPath %>/js/xml.js"></script>
<script src="<%= contextPath %>/js/select.js"></script>
<script language="JavaScript">
var contextPath = '<%= contextPath %>';
var channelid = '<%= channelid %>';
var formname = '<%= formname %>';
var defipk = '<%= defipk %>';
var summarytmpl = '<%= summarytmpl %>'
var pathname='<%= channelPathName %>'
var httpport='<%= httpport %>'
cmdNew = '/dynaform/document/newchn.do';
cmdDelete = '/dynaform/document/delete.do?channelid='+channelid;
cmdPreview = '/dynaform/document/explore.do';
cmdBatchCheck = '/dynaform/document/batchCheck.do';
function ev_new() {
if(channelid==''){
alert('<s:Language key="doc_no_module"/>!');
return;
}
if(formname==''){
alert('<s:Language key="module_no_contenttemplate"/>!');
return;
}
if(defipk==''){
alert('<s:Language key="module_no_flow"/>!');
return;
}
cmdNew = addParam(cmdNew, 'defipk', defipk);
cmdNew = addParam(cmdNew, 'formname', formname);
cmdNew = addParam(cmdNew, 'channelid', channelid);
doNew();
return true;
}
function ev_check() {
return true;
}
function ev_resetForm() {
<c:choose>
<c:when test="${!empty requestScope.SUMMARYFIELDLIST}">
<c:forEach var="field" items="${requestScope.SUMMARYFIELDLIST}">
if(formList.<c:out value='${field.name}'/>!=null)
formList.<c:out value='${field.name}'/>.value="";
</c:forEach>
</c:when>
<c:otherwise>
<c:forEach var="field" items="${requestScope.FIELDLIST}">
<c:if test="${field.fieldtype eq 'VALUE_TYPE_VARCHAR'}" >
if(formList.sm_<c:out value='${field.name}'/>!=null);
formList.sm_<c:out value='${field.name}'/>.value="";
</c:if>
<c:if test="${field.fieldtype eq 'VALUE_TYPE_DATE'}" >
if(formList.s_<c:out value='${field.name}'/>!=null);
formList.s_<c:out value='${field.name}'/>.value="";
</c:if>
<c:if test="${field.fieldtype eq 'VALUE_TYPE_NUMBER'}" >
if(formList.i_<c:out value='${field.name}'/>!=null);
formList.i_<c:out value='${field.name}'/>.value="";
</c:if>
</c:forEach>
</c:otherwise>
</c:choose>
resetForm();
}
function ev_preview(){
if(summarytmpl==''){
alert('<s:Language key="module_no_listtemplate"/>!');
return;
}
//cmdPreview = contextPath + addParam(cmdPreview, 'formname', summarytmpl);
cmdPreview = "http://"+httpport+"/$preview$/"+pathname;
alert(cmdPreview);
window.open(cmdPreview);
}
function doBatchCheck(){
formList.action= contextPath + cmdBatchCheck;
formList.submit();
}
function doCheck(id,tp){
if (tp=='approve'){
formList.allapprove.checked = false;
if (document.all('approve'+id).checked){
document.all('hold'+id).checked = false;
document.all('reject'+id).checked = false;
}
}
if (tp=='hold'){
formList.allhold.checked = false;
if (document.all('hold'+id).checked){
document.all('approve'+id).checked = false;
document.all('reject'+id).checked = false;
}
}
if (tp=='reject'){
formList.allreject.checked = false;
if (document.all('reject'+id).checked){
document.all('hold'+id).checked = false;
document.all('hold'+id).checked = false;
}
}
}
function selectAllApprove(b){
for(i=0;i<formList.allapprove.length;++i){
formList.allapprove[i].checked = b;
formList.allreject[i].checked = false;
formList.allhold[i].checked = false;
}
formList.allreject.checked = false;
formList.allhold.checked = false;
}
function selectAllReject(b){
for(i=0;i<formList.allreject.length;++i){
formList.allapprove[i].checked = false;
formList.allreject[i].checked = b;
formList.allhold[i].checked = false;
}
formList.allapprove.checked = false;
formList.allhold.checked = false;
}
function selectAllHold(b){
for(i=0;i<formList.allhold.length;++i){
formList.allapprove[i].checked = false;
formList.allreject[i].checked = false;
formList.allhold[i].checked = b;
}
formList.allapprove.checked = false;
formList.allreject.checked = false;
}
function doSubmit(){
var isOk = true;
try{
isOk = doSearchCheck();
}catch(ex){
}
if(isOk){formList.submit()};
}
</script>
</head>
<xml id="myXML"></xml>
<body>
<html:form styleId="formList" method="post" action="/dynaform/document/batchApproveByChannel.do">
<html:hidden property="n_channelid"/>
<html:hidden property="sm_$channelids"/>
<html:hidden property="_orderby"/>
<html:hidden property="_desc"/>
<html:hidden property="_currpage"/>
<html:hidden property="_pagelines"/>
<input type="hidden" name="_caption" value="<c:out value='${requestScope.CAPTION}' />">
<input type="hidden" name="_rowcount" value="<c:out value='${requestScope.LIST.rowCount}' />">
<input type="hidden" name="_channelid" value="<%= channelid %>">
<input type="hidden" name="channelid" value="<%= channelid %>">
<input type="hidden" name="style" value="11">
<input type="hidden" name="budgetform" value="<c:out value='${param.budgetform}'/>">
<table class="list-table" border="0" cellpadding="4" cellspacing="0">
<tr height="45">
<td class="list-toolbar" colspan="2" align="left" valign="middle">
<input type="button" name="btnReset" value="<s:Language key='submit'/>" class="bt" onclick="doBatchCheck()">
</td>
</tr>
<tr>
<td colspan="2" class="list-srchbar">
<%
if(summarytmpl.length() > 0){
FormProxy formProxy = new FormProxy();
Form form = formProxy.doView(summarytmpl);
form.setEditmodal(true);
Collection errors = (Collection)request.getAttribute("ERRORS");
Document document = form.createDocument(params, user);
out.print(form.toHtml(document, params, user, errors));
}else{
%>
<c:forEach var="field" items="${requestScope.FIELDLIST}">
<c:out value='${field.name}'/>:
<%
FormField formfield = (FormField) pageContext.getAttribute("field");
String fieldname = formfield.getName();
String sm_value = request.getParameter("sm_" + fieldname);
String s_value = request.getParameter("s_" + fieldname);
String i_value = request.getParameter("i_" + fieldname);
sm_value = (sm_value!=null)? sm_value : "";
s_value = (s_value!=null)? s_value : "";
i_value = (i_value!=null)? i_value : "";
%>
<c:if test="${field.fieldtype eq 'VALUE_TYPE_VARCHAR'}" >
<input type="text" name="sm_<c:out value='${field.name}'/>" value="<%=sm_value%>" size="10">
</c:if>
<c:if test="${field.fieldtype eq 'VALUE_TYPE_DATE'}" >
<input type="text" name="s_<c:out value='${field.name}'/>" value="<%=s_value%>" size="10">
</c:if>
<c:if test="${field.fieldtype eq 'VALUE_TYPE_NUMBER'}" >
<input type="text" name="i_<c:out value='${field.name}'/>" value="<%=i_value%>" size="10">
</c:if>
</c:forEach>
<%}%>
<input type="button" value="<s:Language key='query'/>" class="bt" onclick="doSubmit()"/>
<input type="button" name="btnReset" value="<s:Language key='reset'/>" class="bt" onclick="ev_resetForm()">
</td>
</tr>
<tr>
<td colspan="2" class="list-datas"> <table class="list-datas-table" border="0" cellpadding="0" cellspacing="1">
<tr class="row-hd">
<td width="10px" title="<s:Language key='sel_or_clear_all_selected'/>" nowrap><input type="checkbox" name="allbox" onclick="checkAll();"></td>
<!--list all the field in channel selected -->
<c:forEach var="field" items="${requestScope.FIELDLIST}">
<%
FormField formfield = (FormField) pageContext.getAttribute("field");
String fieldname = formfield.getName();
String fieldtype = formfield.getFieldtype();
String ordertag = fieldtype + "@" + fieldname;
%>
<td width="100px" nowrap align="center"><a href="javascript:doOrderby('<c:out value='${field.fieldtype}'/>@<c:out value='${field.name}'/>')"><font class="list-title-font"><c:out value="${field.name}"/></font></a><s:OrderImg form="ParamsTableWrapForm" field="<%=ordertag%>"/></td>
</c:forEach>
<td nowrap width="6%"><s:Language key="state_pass"/><input type="checkbox" name="allapprove" onclick="selectAllApprove(this.checked)"></td>
<td nowrap width="6%"><s:Language key="state_pause"/><input type="checkbox" name="allhold" onclick="selectAllHold(this.checked)"></td>
<td nowrap width="6%"><s:Language key="state_isabort"/><input type="checkbox" name="allreject" onclick="selectAllReject(this.checked)"></td>
<td nowrap><font class="list-title-font"><s:Language key="state"/></font></td>
</tr>
<c:forEach var="item" items="${requestScope.LIST.datas}">
<c:url value="/dynaform/document/view.do" var="urlView">
<c:param name="ISEDIT" value="TRUE"/>
<c:param name="id" value="${item.id}"/>
<c:param name="formname" value="${item.formname}"/>
</c:url>
<%
Document documentVO = (Document) pageContext.getAttribute("item");
%>
<tr class="row-content" height="25" onmouseover="this.className='row-content-mouse'" onmouseout="this.className='row-content'">
<td>
<% if(documentVO.getState().trim().equals("0")){%>
<input type="checkbox" name="_selectitem" value="<c:out value='${item.id}' />" onclick="checkOne(this);"></td>
<%}%>
<!--list all the field value in documents -->
<c:forEach var="field" items="${requestScope.FIELDLIST}" varStatus="status">
<%
String fieldvalue = "";
FormField formfield = (FormField) pageContext.getAttribute("field");
String fieldname = formfield.getName();
if(documentVO!=null&&fieldname!=null&&fieldname.length()>0)
fieldvalue = documentVO.getItemValueAsString(fieldname);
%>
<td>
<c:if test="${status.count eq '1'}">
<a href="javascript:doView('<c:out value="${urlView}"/>')">
</c:if>
<%=fieldvalue%>
<c:if test="${status.count eq '1'}">
</a>
</c:if>
</td>
</c:forEach>
<td nowrap align="center"><input type="checkbox" value='<c:out value="${item.id}"/>' name="approve" id='approve<c:out value="${item.id}"/>' onclick='doCheck("<c:out value="${item.id}"/>","approve")'></td>
<td nowrap align="center"><input type="checkbox" value='<c:out value="${item.id}"/>'name="hold" id='hold<c:out value="${item.id}"/>' onclick='doCheck("<c:out value="${item.id}"/>","hold")'></td>
<td nowrap align="center"><input type="checkbox" value='<c:out value="${item.id}"/>' name="reject" id='reject<c:out value="${item.id}"/>' onclick='doCheck("<c:out value="${item.id}"/>","reject")'></td>
<td><%=FlowState.getName(documentVO.getState())%></td>
</tr>
</c:forEach> </table></td>
</tr>
<tr>
<td colspan="2">
<%
if(budgetform != null && budgetform.length() > 0){
FormProxy formProxy = new FormProxy();
Form form = formProxy.doView(budgetform);
form.setEditmodal(true);
Collection errors = (Collection)request.getAttribute("ERRORS");
Document document = form.createDocument(params, user);
out.print(form.toHtml(document, params, user, errors));
}
%>
</td>
</tr>
<tr>
<td height="25" colspan="2" bgcolor="#FFFFFF" align="right"><s:PageNav dpName="LIST"/></td>
</tr>
</table>
<s:KeepCondition form="formList"/>
</html:form>
</body>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -