svn commit: r612431 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties src/org/ofbiz/product/category/CategoryWorker.java src/org/ofbiz/product/product/ProductSearchSession.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r612431 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties src/org/ofbiz/product/category/CategoryWorker.java src/org/ofbiz/product/product/ProductSearchSession.java

jleroux@apache.org
Author: jleroux
Date: Wed Jan 16 04:17:47 2008
New Revision: 612431

URL: http://svn.apache.org/viewvc?rev=612431&view=rev
Log:
A patch from Jeremy Wickersheimer "Product keyword search doesn't search in all child categories" (https://issues.apache.org/jira/browse/OFBIZ-1572) - OFBIZ-1572
Update to show only in search
+ fix a typo in labels

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?rev=612431&r1=612430&r2=612431&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Wed Jan 16 04:17:47 2008
@@ -656,7 +656,7 @@
 ProductFacilityRoleMemberMaintenance=Facility Role Member Maintenance
 ProductFacilityType=Facility Type
 ProductFacilityTypeId=Facility Type ID
-ProductFacilityPermissionError=Security Error\: to run ${resourceDescription} you must have the CATALOG_${mainAction} or CATALOG_ADMIN or FACILITY_${mainAction} or FACILITY_ADMIN permission
+ProductFacilityPermissionError=Security Error : to run ${resourceDescription} you must have the CATALOG_${mainAction} or CATALOG_ADMIN or FACILITY_${mainAction} or FACILITY_ADMIN permission
 ProductFacilityViewPermissionError=You do not have permission to view this page. ("FACILITY_VIEW" or "FACILITY_ADMIN" needed)
 ProductFacilityDefaultWeightUnit=Default Weight Unit
 ProductFastLoadCatalogIntoCache=Fast Load Catalog into Cache

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=612431&r1=612430&r2=612431&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Wed Jan 16 04:17:47 2008
@@ -154,6 +154,10 @@
     }
 
     public static List getRelatedCategoriesRet(ServletRequest request, String attributeName, String parentId, boolean limitView, boolean excludeEmpty) {
+        return getRelatedCategoriesRet(request, attributeName, parentId, limitView, excludeEmpty, false);
+    }
+
+    public static List getRelatedCategoriesRet(ServletRequest request, String attributeName, String parentId, boolean limitView, boolean excludeEmpty, boolean recursive) {
         List categories = FastList.newInstance();
 
         if (Debug.verboseOn()) Debug.logVerbose("[CategoryWorker.getRelatedCategories] ParentID: " + parentId, module);
@@ -192,11 +196,15 @@
                         if (!isCategoryEmpty(cv)) {
                             //Debug.log("Child : " + cv.getString("productCategoryId") + " is not empty.", module);
                             categories.add(cv);
-                            categories.addAll(getRelatedCategoriesRet(request, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty));
+                            if (recursive) {
+                                categories.addAll(getRelatedCategoriesRet(request, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty, recursive));
+                            }
                         }
                     } else {
                         categories.add(cv);
-                        categories.addAll(getRelatedCategoriesRet(request, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty));
+                        if (recursive) {
+                            categories.addAll(getRelatedCategoriesRet(request, attributeName, cv.getString("productCategoryId"), limitView, excludeEmpty, recursive));
+                        }
                     }
                 }
             }

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=612431&r1=612430&r2=612431&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Wed Jan 16 04:17:47 2008
@@ -586,7 +586,7 @@
         if (UtilValidate.isNotEmpty((String) parameters.get("SEARCH_CATALOG_ID"))) {    
             String searchCatalogId = (String) parameters.get("SEARCH_CATALOG_ID");
             if (searchCatalogId != null && !searchCatalogId.equalsIgnoreCase("")) {
-                List categories = CategoryWorker.getRelatedCategoriesRet(request, "topLevelList", CatalogWorker.getCatalogTopCategoryId(request, searchCatalogId), true);
+                List categories = CategoryWorker.getRelatedCategoriesRet(request, "topLevelList", CatalogWorker.getCatalogTopCategoryId(request, searchCatalogId), true, false, true);
                 searchAddConstraint(new ProductSearch.CatalogConstraint(searchCatalogId, categories), session);
                 constraintsChanged = true;              
             }