⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opportunitycontactselectavailable.jsp

📁 国外的一套开源CRM
💻 JSP
字号:
<%@ page import="com.sourcetap.sfa.opportunity.OpportunityContactSelectWSS" %>
<%@ page import="com.sourcetap.sfa.opportunity.OpportunityContactAvailableSelect" %>
<%@ page import="com.sourcetap.sfa.ui.UIUtility" %>
<%@ page import="org.ofbiz.base.util.Debug" %>
<%@ include file="/includes/header.jsp" %>

<%
boolean DEBUG = false;
String module = "opportunityContactSelectAvailable";


String accountId = "";
if (request.getParameter("searchValue")!=null) {
	accountId = request.getParameter("searchValue");
} else {
	Debug.logWarning("[activityContactSelectAvailable.jsp] Error. Account ID was not set.", module);
	return;
}

String dealId = "";
if (request.getParameter("dealId")!=null) {
	dealId = request.getParameter("dealId");
} else {
	Debug.logWarning("[opportunityContactSelectAvailable.jsp] Error. Opportunity ID was not set.", module);
	return;
}

// Put the values onto the query values map.
HashMap queryParameterValueMap = new HashMap();
queryParameterValueMap.put("accountId", accountId);
queryParameterValueMap.put("dealId", dealId);
try {
	OpportunityContactAvailableSelect opportunityContactAvailableSelect = new OpportunityContactAvailableSelect();
	List eligibleEntityL = opportunityContactAvailableSelect.getDropDownValues(
		delegator,
		queryParameterValueMap,
		userInfo);

	// Create a list of items already selected.
	int assignedOptionCount = 0;
	if (request.getParameter("assignedOptionCount")!=null) {
		assignedOptionCount = Integer.valueOf(request.getParameter("assignedOptionCount")).intValue();
	}

	ArrayList assignedOptionList = new ArrayList();
	for (int optionNbr = 0; optionNbr < assignedOptionCount; optionNbr++) {
		String paramName = "assignedValue_" + String.valueOf(optionNbr);
		if (request.getParameter(paramName)!=null) {
			String assignedOption = request.getParameter(paramName);
			// Build a primary key from the key string.
			HashMap contactKeyMap = new HashMap();
			contactKeyMap.put("contactId", assignedOption.substring("contactId:".length()));
			GenericPK assignedOptionPK = new GenericPK(delegator.getModelEntity("Contact"), contactKeyMap);
			assignedOptionList.add(assignedOptionPK);
		} else {
			Debug.logVerbose("[opportunityContactSelectAvailable] " + paramName + " parameter not found", module);
		}
	}

	eligibleEntityL = UIUtility.removeSelectedEligibleEntities(
		assignedOptionList,
		eligibleEntityL);

	StringBuffer sb = new StringBuffer("<SELECT NAME=\"OpportunityContactSelectRealTimeAvailSelect\" ID=\"OpportunityContactSelectRealTimeAvailSelect\">\n");
	Iterator eligibleEntityI = eligibleEntityL.iterator();
	while(eligibleEntityI.hasNext()){
		GenericValue eligibleGV = (GenericValue)eligibleEntityI.next();
 		sb.append("<OPTION VALUE=\"contactId:" + eligibleGV.getString("contactId") + "\">" + eligibleGV.getString("firstName") + " " + eligibleGV.getString("lastName") + "</OPTION>\n");
	}
	sb.append("</SELECT>");
	out.write(sb.toString());
} catch (Exception e) {
	Debug.logError("[opportunityContactSelectAvailable] Error executing getEligibleEntities: " + e.getLocalizedMessage(), module);
}

%>
<%@ include file="/includes/footer.jsp" %>

⌨️ 快捷键说明

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