svn commit: r534757 - /ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

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

svn commit: r534757 - /ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

jacopoc
Author: jacopoc
Date: Thu May  3 02:11:15 2007
New Revision: 534757

URL: http://svn.apache.org/viewvc?view=rev&rev=534757
Log:
Misc formatting cleanups.

Modified:
    ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?view=diff&rev=534757&r1=534756&r2=534757
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Thu May  3 02:11:15 2007
@@ -452,14 +452,8 @@
         LocalDispatcher dispatcher = ctx.getDispatcher();
         Locale locale = (Locale) context.get("locale");
         GenericValue userLogin = (GenericValue) context.get("userLogin");
-        /* TODO: security management  and finishing cleaning (ex copy from PartyServices.java)
-        if (!security.hasEntityPermission(secEntity, secOperation, userLogin)) {
-            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
-            result.put(ModelService.ERROR_MESSAGE, "You do not have permission to perform this operation for this party");
-            return partyId;
-        }
-         */
         String productionRunId = (String) context.get("productionRunId");
+
         if (!UtilValidate.isEmpty(productionRunId)) {
             ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
             if (productionRun.exist()){
@@ -470,24 +464,33 @@
                 }
 
                 Double quantity = (Double) context.get("quantity");
-                if (quantity != null &&  ! quantity.equals(productionRun.getQuantity()))
+                if (quantity != null &&  ! quantity.equals(productionRun.getQuantity())) {
                     productionRun.setQuantity(quantity);
+                }
                 
                 Timestamp  estimatedStartDate =  (Timestamp) context.get("estimatedStartDate");
-                if (estimatedStartDate != null && ! estimatedStartDate.equals(productionRun.getEstimatedStartDate()))
+                if (estimatedStartDate != null && ! estimatedStartDate.equals(productionRun.getEstimatedStartDate())) {
                     productionRun.setEstimatedStartDate(estimatedStartDate);
+                }
                 
                 String  workEffortName = (String) context.get("workEffortName");
-                if (workEffortName != null) productionRun.setProductionRunName(workEffortName);
+                if (workEffortName != null) {
+                    productionRun.setProductionRunName(workEffortName);
+                }
                 
                 String  description = (String) context.get("description");
-                if (description != null) productionRun.setDescription(description);
+                if (description != null) {
+                    productionRun.setDescription(description);
+                }
                 
                 String  facilityId = (String) context.get("facilityId");
-                if (facilityId != null) productionRun.getGenericValue().set("facilityId", facilityId);
+                if (facilityId != null) {
+                    productionRun.getGenericValue().set("facilityId", facilityId);
+                }
 
-                if (productionRun.store()) return ServiceUtil.returnSuccess();
-                else {
+                if (productionRun.store()) {
+                    return ServiceUtil.returnSuccess();
+                } else {
                     Debug.logError("productionRun.store() fail for productionRunId ="+productionRunId,module);
                     return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunNotUpdated", locale));
                 }