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

📄 editcontactmech.bsh

📁 国外的一套开源CRM
💻 BSH
字号:
import java.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.base.util.*;
import org.ofbiz.securityext.login.*;
import org.ofbiz.common.*;
import org.ofbiz.party.contact.*;
import org.ofbiz.workeffort.workeffort.*;

delegator = request.getAttribute("delegator");
dispatcher = request.getAttribute("dispatcher");

externalLoginKey = LoginEvents.getExternalLoginKey(request);
externalKeyParam = externalLoginKey == null ? "" : "&externalLoginKey=" + externalLoginKey;
context.put("externalKeyParam",externalKeyParam);



workEffortId = request.getParameter("workEffortId");
context.put("workEffortId", workEffortId);

serviceCtx = UtilMisc.toMap(
    "userLogin",context.getSession().getAttribute("userLogin"),
    "workEffortId",workEffortId);
result = dispatcher.runSync("getWorkEffort",serviceCtx);

context.put("workEffort",result.get("workEffort"));
context.put("workEffortId",result.get("workEffortId"));
context.put("partyAssigns",result.get("partyAssigns"));
context.put("canView",result.get("canView"));
context.put("tryEntity",result.get("tryEntity"));
context.put("currentStatusItem",result.get("currentStatusItem"));

partyId = request.getParameter("partyId");
context.put("partyId", partyId);

preContactMechTypeId = request.getParameter("preContactMechTypeId");
if(preContactMechTypeId != null) context.put("preContactMechTypeId", preContactMechTypeId);

if(partyId != null && !"event".equals(partyId)) {
    List partyContactMechValueMaps = ContactMechWorker.getPartyContactMechValueMaps(delegator, partyId, false, preContactMechTypeId);
    context.put("contactMeches", partyContactMechValueMaps);    
}

Map mechMap = new HashMap();
ContactMechWorker.getContactMechAndRelated(request, partyId, mechMap);

context.put("mechMap", mechMap);

String contactMechId = (String) mechMap.get("contactMechId");
if(contactMechId != null) context.put("contactMechId", contactMechId);



String paymentMethodId = request.getParameter("paymentMethodId");
if(paymentMethodId == null) paymentMethodId = (String) request.getAttribute("paymentMethodId");
if(paymentMethodId != null) context.put("paymentMethodId", paymentMethodId);

String donePage = request.getParameter("DONE_PAGE");
if (donePage == null) donePage = (String) request.getAttribute("DONE_PAGE");
if (donePage == null || donePage.length() <= 0) donePage = "viewprofile";
context.put("donePage", donePage);

String cmNewPurposeTypeId = request.getParameter("contactMechPurposeTypeId");
if (cmNewPurposeTypeId == null) cmNewPurposeTypeId = (String) mechMap.get("contactMechPurposeTypeId");
if (cmNewPurposeTypeId != null) {
    context.put("contactMechPurposeTypeId", cmNewPurposeTypeId);
    GenericValue contactMechPurposeType = delegator.findByPrimaryKey("ContactMechPurposeType", UtilMisc.toMap("contactMechPurposeTypeId", cmNewPurposeTypeId));
    if(contactMechPurposeType != null) context.put("contactMechPurposeType", contactMechPurposeType);
}

⌨️ 快捷键说明

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