opportunitydetailaction.wml.jsp

来自「国外的一套开源CRM」· JSP 代码 · 共 56 行

JSP
56
字号
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.3//EN" "http://www.phone.com/dtd/wml13.dtd">
<%@ page contentType="text/vnd.wap.wml" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="org.ofbiz.entity.*" %>
<%@ page import="org.ofbiz.entity.model.*" %>

<jsp:useBean id="delegator" type="org.ofbiz.entity.GenericDelegator" scope="application" />

<%!
  String getFieldValue(List l, String fieldName, String equalsValue, String returnFieldName){
    Iterator i = l.iterator();
    GenericEntity genericEntity = null;
    String retVal = "";
    while(i.hasNext()){
      genericEntity = (GenericValue)i.next();
      if(String.valueOf(genericEntity.get(fieldName)).equals(equalsValue))
        retVal = String.valueOf(genericEntity.get(returnFieldName));
    }
    return retVal;
  }
%>


<%

   HashMap opportunityFields = new HashMap();
   opportunityFields.put("dealId", request.getParameter("opportunityId"));
   GenericValue opportunityDetail = delegator.findByPrimaryKey("Deal", opportunityFields);

   List dealStageList = delegator.findAll("DealStage", null);
   List dealStatusList = delegator.findAll("DealStatus", null);

   DecimalFormat decimalFormat = new DecimalFormat("#,###.##");

%>

<wml>
<head>
  <meta http-equiv="Cache-Control" content="max-age=0" forua="true"/>
</head>
 <card id="opportunityDetail" title="m7 CRM">
   <p>
     <b>Name:</b><br/><%=opportunityDetail.get("dealName")%><br/>
     <b>Amount:</b><br/>$$<%=decimalFormat.format(opportunityDetail.get("amount"))%><br/>
     <b>Stage:</b><br/><%=getFieldValue(dealStageList, "stageId", String.valueOf(opportunityDetail.get("stageId")), "stageName") %><br/>
     <b>Status:</b><br/><%=getFieldValue(dealStatusList, "dealStatusId", String.valueOf(opportunityDetail.get("dealStatusId")), "dealStatusName")  %><br/>
     <b>Projected Close Date:</b><br/><%=opportunityDetail.get("projectedCloseDate")%><br/>
  </p>
  <do type="accept" label="back">
    <prev/>
  </do>
 </card>
</wml>

⌨️ 快捷键说明

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