You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/10/22 14:02:31 UTC
svn commit: r828667 - in /ofbiz/trunk/specialpurpose/pos:
data/PosSecurityData.xml src/org/ofbiz/pos/PosTransaction.java
Author: jleroux
Date: Thu Oct 22 12:02:30 2009
New Revision: 828667
URL: http://svn.apache.org/viewvc?rev=828667&view=rev
Log:
Code simplification in searchClientProfile
Remove trailing blanks in PosSecurityData.xml
Modified:
ofbiz/trunk/specialpurpose/pos/data/PosSecurityData.xml
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
Modified: ofbiz/trunk/specialpurpose/pos/data/PosSecurityData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/data/PosSecurityData.xml?rev=828667&r1=828666&r2=828667&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/data/PosSecurityData.xml (original)
+++ ofbiz/trunk/specialpurpose/pos/data/PosSecurityData.xml Thu Oct 22 12:02:30 2009
@@ -23,7 +23,7 @@
<SecurityGroupPermission groupId="POSCLERK" permissionId="ORDERMGR_VIEW"/>
<SecurityGroupPermission groupId="POSCLERK" permissionId="ORDERMGR_NOTE"/>
<SecurityGroupPermission groupId="POSCLERK" permissionId="ORDERMGR_UPDATE"/>
- <SecurityGroupPermission groupId="POSCLERK" permissionId="ORDERMGR_CREATE"/>
+ <SecurityGroupPermission groupId="POSCLERK" permissionId="ORDERMGR_CREATE"/>
<SecurityGroupPermission groupId="POSCLERK" permissionId="PARTYMGR_PCM_CREATE"/>
<SecurityGroupPermission groupId="POSCLERK" permissionId="PARTYMGR_VIEW"/>
<SecurityGroupPermission groupId="POSCLERK" permissionId="PARTYMGR_CREATE"/>
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=828667&r1=828666&r2=828667&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Thu Oct 22 12:02:30 2009
@@ -1555,7 +1555,6 @@
dynamicView.addAlias("PE", "cardId");
dynamicView.addViewLink("PT", "PE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("partyId"));
- Boolean onlyPhone = UtilValidate.isEmpty(name) && UtilValidate.isEmpty(email) && UtilValidate.isNotEmpty(phone) && UtilValidate.isEmpty(card);
if (UtilValidate.isNotEmpty(email)) {
// ContactMech (email)
dynamicView.addMemberEntity("PM", "PartyContactMechPurpose");
@@ -1667,27 +1666,27 @@
partyMap.put("partyId", party.getString("partyId"));
partyMap.put("lastName", party.getString("lastName"));
partyMap.put("cardId", party.getString("cardId"));
- if (!onlyPhone && UtilValidate.isNotEmpty(email)) {
+ if (UtilValidate.isNotEmpty(email)) {
partyMap.put("infoString", party.getString("infoString"));
partyMap.put("contactNumber", "");
- } else if (UtilValidate.isEmpty(email) && !onlyPhone) {
+ } else if (UtilValidate.isNotEmpty(phone)) {
partyMap.put("infoString", "");
- partyMap.put("contactNumber", "");
- } else {
partyMap.put("contactNumber", party.getString("contactNumber"));
+ } else { // both empty
partyMap.put("infoString", "");
+ partyMap.put("contactNumber", "");
}
resultList.add(partyMap);
}
- if (!onlyPhone && UtilValidate.isNotEmpty(email)) {
+ if (UtilValidate.isNotEmpty(email)) {
resultList = searchContactMechs(delegator, pos, resultList, phone, "TELECOM_NUMBER");
- } else if (UtilValidate.isEmpty(email) && !onlyPhone){
- resultList = searchContactMechs(delegator, pos, resultList, "", "TELECOM_NUMBER"); // "" is more clear than phone which is by definition here is empty
+ } else if (UtilValidate.isNotEmpty(phone)) {
resultList = searchContactMechs(delegator, pos, resultList, "", "EMAIL_ADDRESS"); // "" is more clear than email which is by definition here is empty
- } else { // onlyPhone
- resultList = searchContactMechs(delegator, pos, resultList, "", "EMAIL_ADDRESS");
+ } else { // both empty
+ resultList = searchContactMechs(delegator, pos, resultList, "", "TELECOM_NUMBER"); // "" is more clear than phone which is by definition here is empty
+ resultList = searchContactMechs(delegator, pos, resultList, "", "EMAIL_ADDRESS");
}
} else {
resultList = FastList.newInstance();