roaddefect.jsp

来自「Java的框架」· JSP 代码 · 共 300 行

JSP
300
字号
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="mcaps.apps.prrm.roaddefect.model.RoadDefectStatus"%>
<%@ page import="mcaps.apps.prrm.roaddefect.model.RoadDefect"%>
<mcaps:userPreference key="map" name="map" scope="page"/>
<c:set var="datetimeformat"><fmt:message key="datetime.format"/></c:set>
<c:url var="editUrl" 
		value="/roadDefectForm.action?method=edit&roadDefectId=${roadDefect.id}"/>
<c:url var="deleteUrl" 
		value="/deleteRoadDefect.action?method=delete&roadDefectId=${roadDefect.id}"/>
<c:url var="statusOpenUrl" 
		value="/statusRoadDefect.action?method=Opened&roadDefectId=${roadDefect.id}"/>		
<c:url var="statusCloseUrl" 
		value="/statusRoadDefect.action?method=Closed&roadDefectId=${roadDefect.id}"/>	
		
<% RoadDefect roadDefect=(RoadDefect)request.getAttribute("roadDefect"); %>			
<html>
	<head>
		<title><fmt:message key="roadDefect.title"/></title>
		<content tag="heading">
			<fmt:message key="roadDefect.heading"/>
		</content>
	</head>
	<script LANGUAGE="JavaScript">
  		var bboxStr = '<c:out value="${roadDefect.road.bbox}"/>';

			function deleteRoadDefect(){
				bCancel=true;
				if (confirmDelete('Road Defect')) {
					window.location='<c:out value="${deleteUrl}" escapeXml="false"/>';
				}
			}
			
			function getBboxStr(){
				return bboxStr;
			}
			
			
<c:choose>
	<c:when test="${map == 'mb'}">

			//Function called after the mapbuilder scripts have loaded completely
			//This function will set a timer with interval of 100ms to fire
			//the initMap method so that the map is zoomed to the road
			//and the coordinate is set
			function onMbDoLoadComplete() {
				var bbox = bboxStr.replace("BOX(","").replace(")","").replace(/(\s)/g, ",");
				window.cgiArgs['bbox'] = bbox;
				window.cgiArgs["defaultAOI"] = bbox;
			}

	</c:when>
	<c:otherwise>
	
			//Zoom the map to the bbox of the road
			function zoomToBox(bbox){
				mapframe.zoomToBox(bbox);
			}
	
	</c:otherwise>
</c:choose>
	</script>
  <body>
		<c:set var="buttons">			
			<button name="edit" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${editUrl}"/>'">
				<fmt:message key="button.edit"/>
			</button>
			
			
			<% 
			 if((RoadDefectStatus.PENDING.equals(roadDefect.getStatus())) ||
					 (RoadDefectStatus.OPEN.equals(roadDefect.getStatus()))||
					 (RoadDefectStatus.CLOSED.equals(roadDefect.getStatus())))
			{%>			
			<button name="delete" type="button" style="margin-right: 5px" 
				onclick="javascript:deleteRoadDefect();">
				<fmt:message key="button.delete"/>
			</button>
			<%
			}
			%>			

<%--		<button name="cancel" type="button" onclick="window.location='<c:url value="/roadDefects.action" />'">
			<fmt:message key="button.cancel"/>
	 		</button>
--%> 		
			<% 
			 if(RoadDefectStatus.PENDING.equals(roadDefect.getStatus()))
			{%>
				<button name="btnstatus" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${statusOpenUrl}"/>'">
				<fmt:message key="button.roadDefect.open"/>
				</button>
			<%
			}
			%>
			<% 
			if(RoadDefectStatus.DONE.equals(roadDefect.getStatus()))
			{%>
				<button name="btnstatus" type="button" style="margin-right: 5px" 
				onclick="window.location='<c:out value="${statusCloseUrl}"/>'">
				<fmt:message key="button.roadDefect.close"/>
				</button>
			<%
			}
			%>	
			
		</c:set>
		<spring:bind path="roadDefect.id">
		<p><h3>Road Defect ID: <c:out value="${status.value}"/></h3></p>
		</spring:bind> 
		<table>
			<tr>
				<td><fmt:message key="roadDefect.creationTime"/>:</td>
				<td><fmt:formatDate value="${roadDefect.creationTime}" pattern="${datetimeformat}"/></td>
			</tr>
			<tr>
				<td><fmt:message key="roadDefect.lastModifiedTime"/>:</td>
				<td><fmt:formatDate value="${roadDefect.lastModifiedTime}" pattern="${datetimeformat}"/></td>
			</tr>
		</table>	
		<p><h3><fmt:message key="roadDefect.subtitle.contact"/></h3></p>
		<table cellpadding="0" cellspacing="1" width="100%">
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.contact.firstName"/>:
				</td>
				<td width="17%">
					<c:out value="${roadDefect.contact.firstName}"/>
				</td>
				<td width="13%">
					<fmt:message key="roadDefect.contact.lastName"/>:
				<td width="17%">			  
					<c:out value="${roadDefect.contact.lastName}"/>
				</td>
				<td width="9%"></td>
				<td width="30%"></td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.contact.block"/>:
				</td>
				<td width="17%">
				  <c:out value="${roadDefect.contact.block}"/>
				</td>
				<td width="13%">
					<fmt:message key="roadDefect.contact.floor"/>:
				</td>
				<td width="17%">
					<c:out value="${roadDefect.contact.floor}"/>
				</td>
				<td width="9%">
					<fmt:message key="roadDefect.contact.unit"/>:
				</td>
				<td width="30%">
					<c:out value="${roadDefect.contact.unit}"/>
				</td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.contact.roadName"/>:
				</td>
				<td width="17%">
					<c:out value="${roadDefect.contact.roadName}"/>
				</td>
				<td width="13%">
					<fmt:message key="roadDefect.contact.postcode"/>:
				</td>
				<td width="17%">
					<c:out value="${roadDefect.contact.postcode}"/>
				</td>
				<td width="9%">
				</td>
				<td width="30%">
				</td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.contact.country"/>:
				</td>
				<td width="17%">
					<c:out value="${roadDefect.contact.country}"/>
				</td>
				<td width="13%">
				</td>
				<td width="17%">
				</td>
				<td width="9%">
				</td>
				<td width="30%">
				</td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.contact.telephone"/>:
				</td>
				<td width="86%" colspan="5">
					<c:out value="${roadDefect.contact.telephone}"/>
				</td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.contact.email"/>:
				</td>
				<td width="86%" colspan="5">
					<c:out value="${roadDefect.contact.email}"/>
				</td>
			</tr>
		</table>
		<p><h3><fmt:message key="roadDefect.subtitle.roadDefect"/></h3></p>
		<table width="100%">
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.defectType"/>:			
				</td>
				<td width="86%">
					<c:out value="${roadDefect.defectType}"/>
				</td>
			</tr>
			<tr>
				<td width="14%" valign="top">
					<fmt:message key="roadDefect.defectDetail"/>:				
				</td>
				<td width="86%">
					<c:out value="${roadDefect.defectDetail}"/>
				</td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.road.name"/>:			
				</td>
				<td width="86%">
					<c:out value="${roadDefect.road.name}"/>
				</td>
			</tr>
			<tr>
				<td width="14%">
					<fmt:message key="roadDefect.coordinates"/>:			
				</td>
				<td width="86%">
					<c:out value="${roadDefect.coordinates}"/>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<c:choose>
						<c:when test="${map == 'mb'}">
							<c:import url="/map/view/mb/prrmMapView.jsp">
								<c:param name="mapName" value="PRRM Map"/>
								<c:param name="mapTemplate" value="prrm"/>
								<c:param name="customParams" value="view;${roadDefect.road.id};${roadDefect.id}"/>
							</c:import>
						</c:when>
						<c:otherwise>
							<iframe id="mapframe" name="mapframe" src="<c:url value='/map/view/ol/prrmMapView.jsp?customParams=view;${roadDefect.road.id};${roadDefect.id}' />"
			            		width="100%" height="450px" align=top scrolling=no frameborder=0>
			      			[This feature requires IFrame.]</iframe>
						</c:otherwise>
					</c:choose>
				</td>
			</tr>
			<tr>
				<td width="14%" valign="top">
					<fmt:message key="roadDefect.location"/>:				
				</td>
				<td width="86%"> 
					<c:out value="${roadDefect.location}"/>
				</td>
			</tr>
			<tr>
				<td width="14%" valign="top">
					<fmt:message key="roadDefect.severity"/>:				
				</td>
				<td width="86%">
					<c:out value="${roadDefect.severity}"/>
				</td>
			</tr>
			<tr>
				<td width="14%" valign="top">
					<fmt:message key="roadDefect.status"/>:				
				</td>
				<td width="86%">
					<c:out value="${roadDefect.status}"/>
				</td>
			</tr>
			<tr>
				<td width="100%" colspan="2">&nbsp;
				</td>
			</tr>		
			</table>
		<c:out value="${buttons}" escapeXml="false" />
		<%if(!RoadDefectStatus.PENDING.equals(roadDefect.getStatus()))
		{%>
		<div class="separator"></div>
		<jsp:include page="/WEB-INF/pages/prrm/roadDefect/roadDefectTask.jsp"/>
		<%}%>
		
		
	</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?