📄 issuereport.jsp
字号:
<%@ page import="org.ofbiz.entity.*" %>
<%@ page import="org.ofbiz.entity.model.*" %>
<%@ include file="/includes/header.jsp" %>
<%
String ENTITY = "ItIssueHistory";
String action = "";
String issueId = "";
boolean update = false;
String rowClass = "viewManyTR1";
String userLoginId;
String lsIssueId = "";
String lsShortName = "";
String lsStatusId = "";
String lsPriorityId = "";
String lsAssignedTo = "";
String lsDataId = "";
String lsIssueType = "";
String nsIssueId = "";
String nsShortName = "";
String nsStatusId = "";
String nsPriorityId = "";
String nsAssignedTo = "";
String nsDataId = "";
String nsIssueType = "";
String osIssueId = "";
String osShortName = "";
String osStatusId = "";
String osPriorityId = "";
String osAssignedTo = "";
String osIssueType = "";
String lsData = "";
String lsNote = "";
String historyIssueId = "";
int rowNum;
ModelEntity entity = delegator.getModelEntity(ENTITY);
ModelEntity issueEntity = delegator.getModelEntity("ItIssue");
// userLoginId = userLogin.getString("userLoginId");
if(request.getParameter("action") != null){
//actions=search, update, create
action = request.getParameter("action");
}
if(request.getParameter("issueId") != null){
issueId = request.getParameter("issueId");
}
if(request.getParameter("ItIssue_issueId") != null){
issueId = request.getParameter("ItIssue_issueId");
}
%>
<table bgcolor="white" height="20"><tr><td></td></tr></table>
<table width='100%' class="viewManyHeader"><tr><td width='100%' height='100%'>
<table width="100%" class="viewManyHeader"><tr>
<td>
Issue Report
</td>
<td align="right">
</td></tr>
</table>
<table width="100%">
<tr class="viewManyHeaderLabel">
<td width="10%">IssueId</td>
<td width="10%">Issue Type</td>
<td width="15%">Short Name</td>
<td width="10%">Status</td>
<td width="10%">Priority</td>
<td width="10%">Assigned To</td>
<td width="45%">Notes</td>
</tr>
<%
//Get the list of issues to display
HashMap lkMap = new HashMap();
if ( issueId != null && issueId != "" ) {
lkMap.put("issueId", issueId);
} else {
lkMap.put("issueId", "%");
}
ArrayList order = new ArrayList();
order.add("issueId");
List issueList = delegator.findByLike("ItIssue", lkMap, order);
Iterator l = issueList.iterator();
rowNum = 0;
while(l.hasNext()) {
GenericValue issueDetails = (GenericValue)l.next();
historyIssueId = issueDetails.getString("issueId");
lsIssueType = issueDetails.getString("issueTypeId");
lsStatusId = issueDetails.getString("statusId");
HashMap pkMap = new HashMap();
if ( issueId != null && issueId != "" ) {
pkMap.put("issueId", historyIssueId);
} else {
pkMap.put("issueId", historyIssueId);
}
order = new ArrayList();
order.add("issueId");
order.add("modifiedDate");
List issueHistory = delegator.findByLike(ENTITY, pkMap, order);
Iterator i = issueHistory.iterator();
//dont show completed or cancelled issues
if ( !lsStatusId.equals("XXX") ) {
rowClass = (((rowNum++ % 2) != 0) ? "viewManyTR1" : "viewManyTR2");
while(i.hasNext()) {
GenericValue historyDetails = (GenericValue)i.next();
nsIssueId = historyDetails.getString("issueId");
nsShortName = historyDetails.getString("shortName");
nsStatusId = historyDetails.getString("statusId");
nsPriorityId = historyDetails.getString("priorityId");
nsAssignedTo = historyDetails.getString("assignedTo");
nsDataId = historyDetails.getString("dataId");
if ( !osIssueId.equals(nsIssueId) ){
lsIssueId = nsIssueId;
lsShortName = nsShortName;
lsStatusId = nsStatusId;
lsPriorityId = nsPriorityId;
lsAssignedTo = nsAssignedTo;
lsDataId = nsDataId;
} else {
lsIssueId = "";
lsIssueType = "";
if ( !osShortName.equals(nsShortName) ){
lsShortName = nsShortName;
} else {
lsShortName = " ";
}
if ( !osStatusId.equals(nsStatusId)){
lsStatusId = nsStatusId;
} else {
lsStatusId = " ";
}
if ( !osPriorityId.equals( nsPriorityId ) ){
lsPriorityId = nsPriorityId;
} else {
lsPriorityId = " ";
}
if ( !osAssignedTo.equals( nsAssignedTo ) ){
lsAssignedTo = nsAssignedTo;
} else {
lsAssignedTo = " ";
}
}
lsData = historyDetails.getString("modifiedBy");
lsData = "( Submitted by: " + lsData + " / On " + historyDetails.getString("modifiedDate") + " )<br>";
pkMap = new HashMap();
pkMap.put("dataId", nsDataId );
GenericValue issueNote = delegator.findByPrimaryKey("LargeData", pkMap);
if ( issueNote != null ) {
lsNote = issueNote.getString("dataValue");
} else {
lsNote = "";
}
lsData = lsData + lsNote;
//get the issue type text
pkMap = new HashMap();
pkMap.put("codeTypeId", "ISSUE_TYPE_ID" );
pkMap.put("codeId", lsIssueType );
GenericValue issueVal = delegator.findByPrimaryKey("Code", pkMap);
if ( issueVal != null ) {
lsIssueType = issueVal.getString("codeValue");
}
//get the issue status text
pkMap = new HashMap();
pkMap.put("codeTypeId", "STATUS_ID" );
pkMap.put("codeId", lsStatusId );
issueVal = delegator.findByPrimaryKey("Code", pkMap);
if ( issueVal != null ) {
lsStatusId = issueVal.getString("codeValue");
}
//get the issue priority text
pkMap = new HashMap();
pkMap.put("codeTypeId", "PRIORITY_ID" );
pkMap.put("codeId", lsPriorityId );
issueVal = delegator.findByPrimaryKey("Code", pkMap);
if ( issueVal != null ) {
lsPriorityId = issueVal.getString("codeValue");
}
%>
<tr class=<%=rowClass%>>
<td width="10%"><%=lsIssueId%></td>
<td width="10%"><%=lsIssueType%></td>
<td width="15%"><%=lsShortName%></td>
<td width="10%"><%=lsStatusId%></td>
<td width="10%"><%=lsPriorityId%></td>
<td width="10%"><%=lsAssignedTo%></td>
<td width="45%"><%=lsData%></td>
</tr>
<%
osIssueId = nsIssueId;
osShortName = nsShortName;
osStatusId = nsStatusId;
osPriorityId = nsPriorityId;
osAssignedTo = nsAssignedTo;
}
}
}%>
</table>
</table>
<%@ include file="/includes/footer.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -