Author: jleroux
Date: Sun Feb 8 20:58:12 2009 New Revision: 742163 URL: http://svn.apache.org/viewvc?rev=742163&view=rev Log: To close "Providing Functionality of ProductFeatureIactn Entity" https://issues.apache.org/jira/browse/OFBIZ-2170 - OFBIZ-2170 It would have been better if we had prevented to show incompatible options as soon we know it (when we select other features). This means building js functions embedded in groovy and I don't have time for that... Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=742163&r1=742162&r2=742163&view=diff ============================================================================== --- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original) +++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Sun Feb 8 20:58:12 2009 @@ -2637,13 +2637,14 @@ <value xml:lang="fr">Entrer la réservation avant d'ajouter au panier</value> <value xml:lang="it">Inserire informazioni prenotazione prima di aggiungerlo al carrello</value> <value xml:lang="th">à¹à¸à¹à¸²à¸ªà¸¹à¹à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¸à¸à¸à¸à¹à¸à¸à¸à¸µà¹à¸à¸°à¹à¸à¸´à¹à¸¡à¸¥à¸à¸à¸£à¸°à¸à¸£à¹à¸²</value> + </property> + <property key="cart.addToCart.dependencyVariantFeature"> + <value xml:lang="en">Error: a dependency to another feature as not been resolved.</value> + <value xml:lang="fr">Erreur : une dépendance envers une autre option n'a pu être résolue.</value> </property> <property key="cart.addToCart.incompatibilityVariantFeature"> - <value xml:lang="de">Sie können die Auswahl ${productFutureDescription} nicht verwenden </value> - <value xml:lang="en">You cannot use selection ${productFutureDescription} </value> - <value xml:lang="es">No puede usar la selección ${productFutureDescription} </value> - <value xml:lang="fr">Vous ne pouvez pas utiliser la selection ${productFutureDescription} </value> - <value xml:lang="it">Tu non puoi usare la selezione ${productFutureDescription} </value> + <value xml:lang="en">Selected options are incompatible.</value> + <value xml:lang="fr">Les options choisies sont incompatible entre-elles.</value> </property> <property key="cart.addToCart.noProductInfoPassed"> <value xml:lang="de">Keine Produktinformationen übergeben. Warenkorb bleibt unverändert.</value> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=742163&r1=742162&r2=742163&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Sun Feb 8 20:58:12 2009 @@ -267,13 +267,13 @@ productId = variantProductId; } else { request.setAttribute("product_id", productId); - request.setAttribute("_EVENT_MESSAGE_",UtilProperties.getMessage(resource_error,"cart.addToCart.incompatibilityVariantFeature",locale)); + request.setAttribute("_EVENT_MESSAGE_", UtilProperties.getMessage(resource_error, "cart.addToCart.incompatibilityVariantFeature", locale)); return "product"; } } else { request.setAttribute("product_id", productId); - request.setAttribute("_EVENT_MESSAGE_",UtilProperties.getMessage(resource_error,"cart.addToCart.chooseVariationBeforeAddingToCart",locale)); + request.setAttribute("_EVENT_MESSAGE_", UtilProperties.getMessage(resource_error, "cart.addToCart.chooseVariationBeforeAddingToCart", locale)); return "product"; } } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java?rev=742163&r1=742162&r2=742163&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java Sun Feb 8 20:58:12 2009 @@ -29,6 +29,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; @@ -156,6 +157,7 @@ selectedProdcutId = variantProductId; } else { Debug.logWarning("ERROR: Variant product not found!", module); + request.setAttribute("_EVENT_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "cart.addToCart.incompatibilityVariantFeature", UtilHttp.getLocale(request))); } } } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=742163&r1=742162&r2=742163&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Sun Feb 8 20:58:12 2009 @@ -999,11 +999,6 @@ String featurTo = incompatibilityVariant.getString("productFeatureIdTo"); for (String paramValueTo: selectedFeatures) { if(featurTo.equals(paramValueTo)){ - //GenericValue featureFrom = (GenericValue) delegator.findByPrimaryKey("ProductFeature", UtilMisc.toMap("productFeatureId", featur)); - //GenericValue featureTo = (GenericValue) delegator.findByPrimaryKey("ProductFeature", UtilMisc.toMap("productFeatureId", featurTo)); - //String message = UtilProperties.getMessage(resource, "cart.addToCart.incompatibilityVariantFeature", locale) + ":/" + featureFrom.getString("description") + "/ => /" + featureTo.getString("description") +"/"; - //request.setAttribute("_ERROR_MESSAGE_", message); - //return "incompatibilityVariantFeature"; Debug.logWarning("Incompatible features", module); return null; } @@ -1026,11 +1021,7 @@ } } if (!found) { - //GenericValue featureFrom = (GenericValue) delegator.findByPrimaryKey("ProductFeature", UtilMisc.toMap("productFeatureId", featur)); - //GenericValue featureTo = (GenericValue) delegator.findByPrimaryKey("ProductFeature", UtilMisc.toMap("productFeatureId", featurTo)); - //String message = UtilProperties.getMessage(resource, "cart.addToCart.dependencyVariantFeature", locale) + ":/" + featureFrom.getString("description") + "/ => /" + featureTo.getString("description") +"/"; - //request.setAttribute("_ERROR_MESSAGE_", message); - Debug.logWarning("Dependancy features", module); + Debug.logWarning("Dependency features", module); return null; } } |
Free forum by Nabble | Edit this page |