svn commit: r1767764 [30/33] - in /ofbiz/trunk: applications/accounting/groovyScripts/admin/ applications/accounting/groovyScripts/ap/invoices/ applications/accounting/groovyScripts/ar/ applications/accounting/groovyScripts/chartofaccounts/ application...

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

svn commit: r1767764 [30/33] - in /ofbiz/trunk: applications/accounting/groovyScripts/admin/ applications/accounting/groovyScripts/ap/invoices/ applications/accounting/groovyScripts/ar/ applications/accounting/groovyScripts/chartofaccounts/ application...

Arun Patidar-4
Modified: ofbiz/trunk/specialpurpose/example/groovyScripts/FindExampleFeatures.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/groovyScripts/FindExampleFeatures.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/groovyScripts/FindExampleFeatures.groovy (original)
+++ ofbiz/trunk/specialpurpose/example/groovyScripts/FindExampleFeatures.groovy Wed Nov  2 19:09:13 2016
@@ -17,24 +17,24 @@
  * under the License.
  */
 
-import org.apache.ofbiz.entity.condition.EntityCondition;
-import org.apache.ofbiz.entity.condition.EntityFieldValue;
-import org.apache.ofbiz.entity.condition.EntityFunction;
-import org.apache.ofbiz.entity.condition.EntityOperator;
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityFieldValue
+import org.apache.ofbiz.entity.condition.EntityFunction
+import org.apache.ofbiz.entity.condition.EntityOperator
 
-delegator = request.getAttribute("delegator");
+delegator = request.getAttribute("delegator")
 
-andExprs = [];
-fieldValue = request.getParameter("exampleFeatureId");
+andExprs = []
+fieldValue = request.getParameter("exampleFeatureId")
 if (fieldValue) {
     andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER(EntityFieldValue.makeFieldValue("exampleFeatureId")),
-            EntityOperator.LIKE, "%" + fieldValue.toUpperCase() + "%"));
+            EntityOperator.LIKE, "%" + fieldValue.toUpperCase() + "%"))
 }
 
-autocompleteOptions = [];
+autocompleteOptions = []
 if (andExprs) {
-    autocompleteOptions = select("exampleFeatureId", "description").from("ExampleFeature").where(andExprs).orderBy("-exampleFeatureId").queryList();
-    //context.autocompleteOptions = autocompleteOptions;
-    request.setAttribute("autocompleteOptions", autocompleteOptions);
+    autocompleteOptions = select("exampleFeatureId", "description").from("ExampleFeature").where(andExprs).orderBy("-exampleFeatureId").queryList()
+    //context.autocompleteOptions = autocompleteOptions
+    request.setAttribute("autocompleteOptions", autocompleteOptions)
 }
-return "success";
+return "success"

Modified: ofbiz/trunk/specialpurpose/example/groovyScripts/PrepareLocalesForDropDown.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/groovyScripts/PrepareLocalesForDropDown.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/groovyScripts/PrepareLocalesForDropDown.groovy (original)
+++ ofbiz/trunk/specialpurpose/example/groovyScripts/PrepareLocalesForDropDown.groovy Wed Nov  2 19:09:13 2016
@@ -18,5 +18,5 @@ under the License.
 */
 
 def localeMap = []
-org.apache.ofbiz.base.util.UtilMisc.availableLocales().each { localeMap.add(localeId:it.toString()) };
-parameters.localeList = localeMap;
\ No newline at end of file
+org.apache.ofbiz.base.util.UtilMisc.availableLocales().each { localeMap.add(localeId:it.toString()) }
+parameters.localeList = localeMap

Modified: ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductList.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductList.groovy (original)
+++ ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductList.groovy Wed Nov  2 19:09:13 2016
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-productList = request.getAttribute("productList");
+productList = request.getAttribute("productList")
 if (productList) {
-    context.productList = productList;
+    context.productList = productList
 }

Modified: ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductStockTake.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductStockTake.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductStockTake.groovy (original)
+++ ofbiz/trunk/specialpurpose/hhfacility/groovyScripts/ProductStockTake.groovy Wed Nov  2 19:09:13 2016
@@ -17,79 +17,79 @@
  * under the License.
  */
 
-productId = request.getParameter("productId");
+productId = request.getParameter("productId")
 if (!productId) {
-    productId = session.getAttribute("productId");
+    productId = session.getAttribute("productId")
 }
 
 if (productId) {
-    product = from("Product").where("productId", productId).cache(true).queryOne();
-    context.product = product;
+    product = from("Product").where("productId", productId).cache(true).queryOne()
+    context.product = product
 
-    facilityId = request.getParameter("facilityId");
-    resultOutput = runService('getInventoryAvailableByFacility', [productId : productId, facilityId : facilityId]);
-    quantitySummary = [:];
-    quantitySummary.facilityId = facilityId;
+    facilityId = request.getParameter("facilityId")
+    resultOutput = runService('getInventoryAvailableByFacility', [productId : productId, facilityId : facilityId])
+    quantitySummary = [:]
+    quantitySummary.facilityId = facilityId
     quantitySummary.atp_qoh = ((Double)resultOutput.availableToPromiseTotal).intValue() + " / " +
-            ((Double)resultOutput.quantityOnHandTotal).intValue();
-    context.quantitySummary = quantitySummary;
+            ((Double)resultOutput.quantityOnHandTotal).intValue()
+    context.quantitySummary = quantitySummary
 
     // For now this just generates a visual list of locations set against the product for this facility.
     // todo: Will need to be able to edit and change these values at some point in the future.
-    productFacilityLocList = from("ProductFacilityLocation").where("productId", productId, "facilityId", facilityId).queryList();
-    facStr = null;
+    productFacilityLocList = from("ProductFacilityLocation").where("productId", productId, "facilityId", facilityId).queryList()
+    facStr = null
     productFacilityLocList.each { facilityLoc ->
         if (!facStr) {
-            facStr = facilityLoc.locationSeqId;
+            facStr = facilityLoc.locationSeqId
         } else {
-            facStr = facStr + ", " + facilityLoc.locationSeqId;
+            facStr = facStr + ", " + facilityLoc.locationSeqId
         }
     }
-    context.productFacilityLocations = facStr;
+    context.productFacilityLocations = facStr
 
 
     // Now we build a list of locations for inventory items against the facility.
     // todo: change this to a select from inv_items where productId and facilityId matches distinct (locationSeqId).
-    invItemList = from("InventoryItem").where("productId", productId, "facilityId", facilityId).queryList();
+    invItemList = from("InventoryItem").where("productId", productId, "facilityId", facilityId).queryList()
 
-    locations = [:];
+    locations = [:]
 
-    boolean negativeQOH = false;
+    boolean negativeQOH = false
     invItemList.each { invItem ->
-        int qoh = ((Double)invItem.quantityOnHandTotal).intValue();
+        int qoh = ((Double)invItem.quantityOnHandTotal).intValue()
         if (qoh < 0) {
-            negativeQOH = true;
+            negativeQOH = true
         }
-        locationFound = (String)invItem.locationSeqId;
+        locationFound = (String)invItem.locationSeqId
         if (!locationFound) {
-            locationFound = "nullField";
+            locationFound = "nullField"
         }
         if (!locations.get(locationFound)) {
-            locations.put(locationFound, locationFound);
+            locations.put(locationFound, locationFound)
         }
     }
 
     // Go through and build the list of atp/qoh against each location
-    productFacilityLocations = new ArrayList();
-    locationsIter = locations.keySet().iterator();
+    productFacilityLocations = new ArrayList()
+    locationsIter = locations.keySet().iterator()
     while (locationsIter.hasNext()) {
-        location = locationsIter.next();
-        resultOutput = runService('getInventoryAvailableByLocation', [productId : productId, facilityId : facilityId, locationSeqId : location]);
-        quantitySummary = [:];
-        quantitySummary.productId = productId;
-        quantitySummary.facilityId = facilityId;
+        location = locationsIter.next()
+        resultOutput = runService('getInventoryAvailableByLocation', [productId : productId, facilityId : facilityId, locationSeqId : location])
+        quantitySummary = [:]
+        quantitySummary.productId = productId
+        quantitySummary.facilityId = facilityId
         if ("nullField".equals( location ) == true) {
-            quantitySummary.locationSeqId = "";
+            quantitySummary.locationSeqId = ""
         } else {
-            quantitySummary.locationSeqId = location;
+            quantitySummary.locationSeqId = location
         }
         quantitySummary.atp_qoh = ((Double)resultOutput.availableToPromiseTotal).intValue() + " / " +
-                ((Double)resultOutput.quantityOnHandTotal).intValue();
-        productFacilityLocations.add(quantitySummary);
+                ((Double)resultOutput.quantityOnHandTotal).intValue()
+        productFacilityLocations.add(quantitySummary)
     }
 
-    context.productQtyByLocations = productFacilityLocations;
+    context.productQtyByLocations = productFacilityLocations
     if (negativeQOH) {
-        context.negativeQOH = "true";
+        context.negativeQOH = "true"
     }
 }

Modified: ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/AdvancedSearchPrep.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/AdvancedSearchPrep.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/AdvancedSearchPrep.groovy (original)
+++ ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/AdvancedSearchPrep.groovy Wed Nov  2 19:09:13 2016
@@ -17,22 +17,22 @@
  * under the License.
  */
 
-import org.apache.ofbiz.product.feature.ParametricSearch;
-import org.apache.ofbiz.product.product.ProductSearchSession;
+import org.apache.ofbiz.product.feature.ParametricSearch
+import org.apache.ofbiz.product.product.ProductSearchSession
 
-productFeaturesByTypeMap = ParametricSearch.getAllFeaturesByType(delegator, 2000);
-productFeatureTypeIdsOrdered = new ArrayList(new TreeSet(productFeaturesByTypeMap.keySet()));
+productFeaturesByTypeMap = ParametricSearch.getAllFeaturesByType(delegator, 2000)
+productFeatureTypeIdsOrdered = new ArrayList(new TreeSet(productFeaturesByTypeMap.keySet()))
 
-searchOperator = request.getParameter("SEARCH_OPERATOR");
+searchOperator = request.getParameter("SEARCH_OPERATOR")
 if (!"AND".equals(searchOperator) && !"OR".equals(searchOperator)) {
-  searchOperator = "OR";
+  searchOperator = "OR"
 }
 
-searchConstraintStrings = ProductSearchSession.searchGetConstraintStrings(false, session, delegator);
-searchSortOrderString = ProductSearchSession.searchGetSortOrderString(false, request);
+searchConstraintStrings = ProductSearchSession.searchGetConstraintStrings(false, session, delegator)
+searchSortOrderString = ProductSearchSession.searchGetSortOrderString(false, request)
 
-context.productFeaturesByTypeMap = productFeaturesByTypeMap;
-context.productFeatureTypeIdsOrdered = productFeatureTypeIdsOrdered;
-context.searchOperator = searchOperator;
-context.searchConstraintStrings = searchConstraintStrings;
-context.searchSortOrderString = searchSortOrderString;
+context.productFeaturesByTypeMap = productFeaturesByTypeMap
+context.productFeatureTypeIdsOrdered = productFeatureTypeIdsOrdered
+context.searchOperator = searchOperator
+context.searchConstraintStrings = searchConstraintStrings
+context.searchSortOrderString = searchSortOrderString

Modified: ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/IndexProducts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/IndexProducts.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/IndexProducts.groovy (original)
+++ ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/IndexProducts.groovy Wed Nov  2 19:09:13 2016
@@ -29,7 +29,7 @@ if (pi) {
     beganTransaction = TransactionUtil.begin()
     EntityListIterator products
     try {
-        products = select("productId").from("Product").queryIterator();
+        products = select("productId").from("Product").queryIterator()
         while (product = products.next()) {
             pi.queue(new ProductDocument(product.productId))
             productsCounter++

Modified: ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/Search.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/Search.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/Search.groovy (original)
+++ ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/Search.groovy Wed Nov  2 19:09:13 2016
@@ -27,87 +27,87 @@ import org.apache.ofbiz.content.search.S
 import org.apache.ofbiz.product.feature.ParametricSearch
 import org.apache.lucene.search.*
 import org.apache.lucene.index.DirectoryReader
-import org.apache.ofbiz.base.util.UtilProperties;
+import org.apache.ofbiz.base.util.UtilProperties
 
-queryLine = parameters.queryLine;
+queryLine = parameters.queryLine
 
-siteId = parameters.lcSiteId;
+siteId = parameters.lcSiteId
 
-searchFeature1 = (String) parameters.SEARCH_FEAT;
-searchFeature2 = (String) parameters.SEARCH_FEAT2;
-searchFeature3 = (String) parameters.SEARCH_FEAT3;
+searchFeature1 = (String) parameters.SEARCH_FEAT
+searchFeature2 = (String) parameters.SEARCH_FEAT2
+searchFeature3 = (String) parameters.SEARCH_FEAT3
 
-featureIdByType = ParametricSearch.makeFeatureIdByTypeMap(UtilHttp.getParameterMap(request));
+featureIdByType = ParametricSearch.makeFeatureIdByTypeMap(UtilHttp.getParameterMap(request))
 
-combQuery = new BooleanQuery();
+combQuery = new BooleanQuery()
 
 try {
-    DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new File(SearchWorker.getIndexPath("content")).toPath()));
-    searcher = new IndexSearcher(reader);
-    analyzer = new StandardAnalyzer();
+    DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new File(SearchWorker.getIndexPath("content")).toPath()))
+    searcher = new IndexSearcher(reader)
+    analyzer = new StandardAnalyzer()
 } catch (java.io.FileNotFoundException e) {
-    context.errorMessageList.add(UtilProperties.getMessage("ContentErrorUiLabels", "ContentSearchNotIndexed", locale));
-    return;
+    context.errorMessageList.add(UtilProperties.getMessage("ContentErrorUiLabels", "ContentSearchNotIndexed", locale))
+    return
 }
 
 if (queryLine || siteId) {
-    Query query = null;
+    Query query = null
     if (queryLine) {
-        QueryParser parser = new QueryParser("content", analyzer);
-        query = parser.parse(queryLine);
-        combQuery.add(query, BooleanClause.Occur.MUST);
+        QueryParser parser = new QueryParser("content", analyzer)
+        query = parser.parse(queryLine)
+        combQuery.add(query, BooleanClause.Occur.MUST)
     }
     if (siteId) {
-        termQuery = new TermQuery(new Term("site", siteId.toString()));
-        combQuery.add(termQuery, BooleanClause.Occur.MUST);
+        termQuery = new TermQuery(new Term("site", siteId.toString()))
+        combQuery.add(termQuery, BooleanClause.Occur.MUST)
     }
 }
 
 if (searchFeature1 || searchFeature2 || searchFeature3 || !featureIdByType.isEmpty()) {
-    featureQuery = new BooleanQuery();
-    featuresRequired = BooleanClause.Occur.MUST;
+    featureQuery = new BooleanQuery()
+    featuresRequired = BooleanClause.Occur.MUST
     if ("any".equals(parameters.any_or_all)) {
-        featuresRequired = BooleanClause.Occur.SHOULD;
+        featuresRequired = BooleanClause.Occur.SHOULD
     }
 
     if (searchFeature1) {
-        termQuery = new TermQuery(new Term("feature", searchFeature1));
-        featureQuery.add(termQuery, featuresRequired);
+        termQuery = new TermQuery(new Term("feature", searchFeature1))
+        featureQuery.add(termQuery, featuresRequired)
     }
 
     if (searchFeature2) {
-        termQuery = new TermQuery(new Term("feature", searchFeature2));
-        featureQuery.add(termQuery, featuresRequired);
+        termQuery = new TermQuery(new Term("feature", searchFeature2))
+        featureQuery.add(termQuery, featuresRequired)
     }
 
     if (searchFeature3) {
-        termQuery = new TermQuery(new Term("feature", searchFeature3));
-        featureQuery.add(termQuery, featuresRequired);
+        termQuery = new TermQuery(new Term("feature", searchFeature3))
+        featureQuery.add(termQuery, featuresRequired)
     }
 
   if (featureIdByType) {
     featureIdByType.each { key, value ->
-            termQuery = new TermQuery(new Term("feature", value));
-            featureQuery.add(termQuery, featuresRequired);
+            termQuery = new TermQuery(new Term("feature", value))
+            featureQuery.add(termQuery, featuresRequired)
         }
-    combQuery.add(featureQuery, featuresRequired);
+    combQuery.add(featureQuery, featuresRequired)
     }
 }
 if (searcher) {
-    TopScoreDocCollector collector = TopScoreDocCollector.create(100); //defaulting to 100 results
-    searcher.search(combQuery, collector);
-    ScoreDoc[] hits = collector.topDocs().scoreDocs;
+    TopScoreDocCollector collector = TopScoreDocCollector.create(100) //defaulting to 100 results
+    searcher.search(combQuery, collector)
+    ScoreDoc[] hits = collector.topDocs().scoreDocs
 
-    contentList = [] as ArrayList;
-    hitSet = [:] as HashSet;
+    contentList = [] as ArrayList
+    hitSet = [:] as HashSet
     for (int start = 0; start < collector.getTotalHits(); start++) {
         Document doc = searcher.doc(hits[start].doc)
-        contentId = doc.get("contentId");
-        content = from("Content").where("contentId", contentId).cache(true).queryOne();
+        contentId = doc.get("contentId")
+        content = from("Content").where("contentId", contentId).cache(true).queryOne()
         if (!hitSet.contains(contentId)) {
-            contentList.add(content);
-            hitSet.add(contentId);
+            contentList.add(content)
+            hitSet.add(contentId)
         }
     }
-    context.queryResults = contentList;
+    context.queryResults = contentList
 }

Modified: ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/SearchProducts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/SearchProducts.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/SearchProducts.groovy (original)
+++ ofbiz/trunk/specialpurpose/lucene/groovyScripts/content/SearchProducts.groovy Wed Nov  2 19:09:13 2016
@@ -23,7 +23,7 @@ import org.apache.ofbiz.content.search.S
 
 import org.apache.lucene.document.Document
 import org.apache.lucene.index.DirectoryReader
-import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.queryparser.classic.ParseException
 import org.apache.lucene.queryparser.classic.QueryParser
 import org.apache.lucene.search.BooleanClause
 import org.apache.lucene.search.BooleanQuery
@@ -34,40 +34,40 @@ import org.apache.lucene.search.TopScore
 import org.apache.lucene.store.FSDirectory
 
 if (parameters.luceneQuery) {
-    Query combQuery = new BooleanQuery();
-    IndexSearcher searcher;
-    WhitespaceAnalyzer analyzer;
+    Query combQuery = new BooleanQuery()
+    IndexSearcher searcher
+    WhitespaceAnalyzer analyzer
     try {
-        DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new File(SearchWorker.getIndexPath("products")).toPath()));
-        searcher = new IndexSearcher(reader);
-        analyzer = new WhitespaceAnalyzer();
+        DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new File(SearchWorker.getIndexPath("products")).toPath()))
+        searcher = new IndexSearcher(reader)
+        analyzer = new WhitespaceAnalyzer()
     } catch (FileNotFoundException e) {
-        context.errorMessageList.add(e.getMessage());
-        return;
+        context.errorMessageList.add(e.getMessage())
+        return
     }
 
-    QueryParser parser = new QueryParser("fullText", analyzer);
-    parser.setLocale(locale);
-    Query query;
+    QueryParser parser = new QueryParser("fullText", analyzer)
+    parser.setLocale(locale)
+    Query query
     try {
-        query = parser.parse(parameters.luceneQuery);
+        query = parser.parse(parameters.luceneQuery)
     } catch(ParseException pe) {
-        context.errorMessageList.add(pe.getMessage());
-        return;
+        context.errorMessageList.add(pe.getMessage())
+        return
     }
-    combQuery.add(query, BooleanClause.Occur.MUST);
+    combQuery.add(query, BooleanClause.Occur.MUST)
 
-    TopScoreDocCollector collector = TopScoreDocCollector.create(100); // defaulting to 100 results
-    searcher.search(combQuery, collector);
-    ScoreDoc[] hits = collector.topDocs().scoreDocs;
+    TopScoreDocCollector collector = TopScoreDocCollector.create(100) // defaulting to 100 results
+    searcher.search(combQuery, collector)
+    ScoreDoc[] hits = collector.topDocs().scoreDocs
     productList = []
     hits.each { hit ->
         Document doc = searcher.doc(hit.doc)
         productId = doc.productId
-        product = from("Product").where("productId", productId).cache(true).queryOne();
+        product = from("Product").where("productId", productId).cache(true).queryOne()
         if (product) {
             productList.add(product)
         }
     }
-    context.queryResults = productList;
+    context.queryResults = productList
 }

Modified: ofbiz/trunk/specialpurpose/passport/groovyScripts/login/GetThirdPartyLogins.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/passport/groovyScripts/login/GetThirdPartyLogins.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/passport/groovyScripts/login/GetThirdPartyLogins.groovy (original)
+++ ofbiz/trunk/specialpurpose/passport/groovyScripts/login/GetThirdPartyLogins.groovy Wed Nov  2 19:09:13 2016
@@ -17,33 +17,33 @@
  * under the License.
  */
 
-package org.apache.ofbiz.passport;
+package org.apache.ofbiz.passport
 
-import org.apache.ofbiz.entity.util.EntityUtil;
-import org.apache.ofbiz.product.store.ProductStoreWorker;
+import org.apache.ofbiz.entity.util.EntityUtil
+import org.apache.ofbiz.product.store.ProductStoreWorker
 
 final String module = "GetThirdPartyLogins.groovy"
 
-adminErrorInfo = context.adminErrorInfo;
-productStoreId = context.productStoreId;
+adminErrorInfo = context.adminErrorInfo
+productStoreId = context.productStoreId
 if (!productStoreId) {
-    productStore = ProductStoreWorker.getProductStore(request);
-    productStoreId = productStore.productStoreId;
+    productStore = ProductStoreWorker.getProductStore(request)
+    productStoreId = productStore.productStoreId
 }
 
 if (!adminErrorInfo || !adminErrorInfo.hasError()) {
-    storePassportLoginMethList = null;
+    storePassportLoginMethList = null
     // Get lists of passport login methods
     if (productStoreId) {
-        storePassportLoginMethList = delegator.findByAnd("ThirdPartyLogin", ["productStoreId": productStoreId], ["sequenceNum ASC"], false);
-        storePassportLoginMethList = EntityUtil.filterByDate(storePassportLoginMethList);
+        storePassportLoginMethList = delegator.findByAnd("ThirdPartyLogin", ["productStoreId": productStoreId], ["sequenceNum ASC"], false)
+        storePassportLoginMethList = EntityUtil.filterByDate(storePassportLoginMethList)
     }
         
     // Extra data preparation for each login method.
     if (storePassportLoginMethList) {
         storeLoginMethList = []
         for (storeLoginMeth in storePassportLoginMethList) {
-            storeLoginMethDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd(storeLoginMeth.loginMethTypeId + storeLoginMeth.loginProviderId, ["productStoreId": productStoreId], null, false)));
+            storeLoginMethDetail = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd(storeLoginMeth.loginMethTypeId + storeLoginMeth.loginProviderId, ["productStoreId": productStoreId], null, false)))
             storeLoginMethList.add(storeLoginMethDetail)
         }
         context.storeLoginMethList = storeLoginMethList

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/EditWeekTimesheet.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/EditWeekTimesheet.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/EditWeekTimesheet.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/EditWeekTimesheet.groovy Wed Nov  2 19:09:13 2016
@@ -25,181 +25,181 @@ import org.apache.ofbiz.entity.condition
 import org.apache.ofbiz.entity.condition.EntityOperator
 import org.apache.ofbiz.entity.util.EntityUtil
 
-uiLabelMap = UtilProperties.getResourceBundleMap("ProjectMgrUiLabels", locale);
+uiLabelMap = UtilProperties.getResourceBundleMap("ProjectMgrUiLabels", locale)
 
-partyId = parameters.partyId;
+partyId = parameters.partyId
 if (!partyId) {
-    partyId = parameters.userLogin.partyId;
+    partyId = parameters.userLogin.partyId
 }
 
 // show the requested timesheet, otherwise the current , if not exist create
-timesheet = null;
-timesheetId = parameters.timesheetId;
+timesheet = null
+timesheetId = parameters.timesheetId
 if (timesheetId) {
-    timesheet = from("Timesheet").where("timesheetId", timesheetId).queryOne();
-    partyId = timesheet.partyId; // use the party from this timesheet
+    timesheet = from("Timesheet").where("timesheetId", timesheetId).queryOne()
+    partyId = timesheet.partyId // use the party from this timesheet
 } else {
     // make sure because of timezone changes, not a duplicate timesheet is created
-    midweek = UtilDateTime.addDaysToTimestamp(UtilDateTime.getWeekStart(UtilDateTime.nowTimestamp()),3);
+    midweek = UtilDateTime.addDaysToTimestamp(UtilDateTime.getWeekStart(UtilDateTime.nowTimestamp()),3)
     entryExprs = EntityCondition.makeCondition([
         EntityCondition.makeCondition("fromDate", EntityComparisonOperator.LESS_THAN, midweek),
         EntityCondition.makeCondition("thruDate", EntityComparisonOperator.GREATER_THAN, midweek),
         EntityCondition.makeCondition("partyId", EntityComparisonOperator.EQUALS, partyId)
-        ], EntityOperator.AND);
-    entryIterator = from("Timesheet").where(entryExprs).queryIterator();
-    timesheet = entryIterator.next();
-    entryIterator.close();
+        ], EntityOperator.AND)
+    entryIterator = from("Timesheet").where(entryExprs).queryIterator()
+    timesheet = entryIterator.next()
+    entryIterator.close()
     if (timesheet == null) {
-        result = runService('createProjectTimesheet', ["userLogin" : parameters.userLogin, "partyId" : partyId]);
+        result = runService('createProjectTimesheet', ["userLogin" : parameters.userLogin, "partyId" : partyId])
         if (result && result.timesheetId) {
-            timesheet = from("Timesheet").where("timesheetId", result.timesheetId).queryOne();
+            timesheet = from("Timesheet").where("timesheetId", result.timesheetId).queryOne()
         }
     }
 }
-if (!timesheet) return;
-context.timesheet = timesheet;
-context.weekNumber = UtilDateTime.weekNumber(timesheet.fromDate);
+if (!timesheet) return
+context.timesheet = timesheet
+context.weekNumber = UtilDateTime.weekNumber(timesheet.fromDate)
 
 // get the user names
-context.partyNameView = from("PartyNameView").where("partyId", partyId).queryOne();
+context.partyNameView = from("PartyNameView").where("partyId", partyId).queryOne()
 // get the default rate for this person
-rateTypes = from("PartyRate").where("partyId", partyId, "defaultRate", "Y").filterByDate().queryList();
+rateTypes = from("PartyRate").where("partyId", partyId, "defaultRate", "Y").filterByDate().queryList()
 if (rateTypes) {
-    context.defaultRateTypeId = rateTypes[0].rateTypeId;
+    context.defaultRateTypeId = rateTypes[0].rateTypeId
 }
 
-entries = [];
-entry = ["timesheetId" : timesheet.timesheetId];
-taskTotal = 0.00;
-day0Total = 0.00; day1Total=0.00; day2Total=0.00; day3Total=0.00; day4Total=0.00; day5Total=0.00; day6Total=0.00;
-pHours = 0.00;
-timeEntry = null;
-lastTimeEntry = null;
+entries = []
+entry = ["timesheetId" : timesheet.timesheetId]
+taskTotal = 0.00
+day0Total = 0.00; day1Total=0.00; day2Total=0.00; day3Total=0.00; day4Total=0.00; day5Total=0.00; day6Total=0.00
+pHours = 0.00
+timeEntry = null
+lastTimeEntry = null
 
 // retrieve work effort data when the workeffortId has changed.
 void retrieveWorkEffortData() {
         // get the planned number of hours
-        entryWorkEffort = lastTimeEntry.getRelatedOne("WorkEffort", false);
+        entryWorkEffort = lastTimeEntry.getRelatedOne("WorkEffort", false)
         if (entryWorkEffort) {
-            plannedHours = entryWorkEffort.getRelated("WorkEffortSkillStandard", null, null, false);
-            pHours = 0.00;
+            plannedHours = entryWorkEffort.getRelated("WorkEffortSkillStandard", null, null, false)
+            pHours = 0.00
             plannedHours.each { plannedHour ->
                 if (plannedHour.estimatedDuration) {
-                    pHours += plannedHour.estimatedDuration;
+                    pHours += plannedHour.estimatedDuration
                 }
             }
-            entry.plannedHours = pHours;
-            actualHours = entryWorkEffort.getRelated("TimeEntry", null, null, false);
-            aHours = 0.00;
+            entry.plannedHours = pHours
+            actualHours = entryWorkEffort.getRelated("TimeEntry", null, null, false)
+            aHours = 0.00
             actualHours.each { actualHour ->
                 if (actualHour.hours) {
-                    aHours += actualHour.hours;
+                    aHours += actualHour.hours
                 }
             }
-            entry.actualHours = aHours;
+            entry.actualHours = aHours
             // get party assignment data to be able to set the task to complete
-            workEffortPartyAssigns = EntityUtil.filterByDate(entryWorkEffort.getRelated("WorkEffortPartyAssignment", ["partyId" : partyId], null, false));
+            workEffortPartyAssigns = EntityUtil.filterByDate(entryWorkEffort.getRelated("WorkEffortPartyAssignment", ["partyId" : partyId], null, false))
             if (workEffortPartyAssigns) {
-                workEffortPartyAssign = workEffortPartyAssigns[0];
-                entry.fromDate = workEffortPartyAssign.getTimestamp("fromDate");
-                entry.roleTypeId = workEffortPartyAssign.roleTypeId;
+                workEffortPartyAssign = workEffortPartyAssigns[0]
+                entry.fromDate = workEffortPartyAssign.getTimestamp("fromDate")
+                entry.roleTypeId = workEffortPartyAssign.roleTypeId
                 if ("PAS_COMPLETED".equals(workEffortPartyAssign.statusId)) {
-                    entry.checkComplete = "Y";
+                    entry.checkComplete = "Y"
                 }
             }
 
             // get project/phase information
-            entry.workEffortId = entryWorkEffort.workEffortId;
-            entry.workEffortName = entryWorkEffort.workEffortName;
-            result = runService('getProjectIdAndNameFromTask', ["userLogin" : parameters.userLogin,"taskId" : entryWorkEffort.workEffortId]);
-                entry.phaseId = result.phaseId;
-                entry.phaseName = result.phaseName;
-                entry.projectId = result.projectId;
-                entry.projectName = result.projectName;
-                entry.taskWbsId = result.taskWbsId;
+            entry.workEffortId = entryWorkEffort.workEffortId
+            entry.workEffortName = entryWorkEffort.workEffortName
+            result = runService('getProjectIdAndNameFromTask', ["userLogin" : parameters.userLogin,"taskId" : entryWorkEffort.workEffortId])
+                entry.phaseId = result.phaseId
+                entry.phaseName = result.phaseName
+                entry.projectId = result.projectId
+                entry.projectName = result.projectName
+                entry.taskWbsId = result.taskWbsId
 
         }
-        entry.total = taskTotal;
+        entry.total = taskTotal
         //Drop Down Lists
-        entries.add(entry);
+        entries.add(entry)
         // start new entry
-        taskTotal = 0.00;
-        entry = ["timesheetId" : timesheet.timesheetId];
+        taskTotal = 0.00
+        entry = ["timesheetId" : timesheet.timesheetId]
 }
 
-timeEntries = timesheet.getRelated("TimeEntry", null, ["workEffortId", "rateTypeId", "fromDate"], false);
-te = timeEntries.iterator();
+timeEntries = timesheet.getRelated("TimeEntry", null, ["workEffortId", "rateTypeId", "fromDate"], false)
+te = timeEntries.iterator()
 while (te.hasNext()) {
     // only fill lastTimeEntry when not the first time
     if (timeEntry!=void) {
-        lastTimeEntry = timeEntry;
+        lastTimeEntry = timeEntry
     }
-    timeEntry = te.next();
+    timeEntry = te.next()
 
     if (lastTimeEntry &&
             (!lastTimeEntry.workEffortId.equals(timeEntry.workEffortId) ||
             !lastTimeEntry.rateTypeId.equals(timeEntry.rateTypeId))) {
-            retrieveWorkEffortData();
+            retrieveWorkEffortData()
         }
     if (timeEntry.hours) {
-        dayNumber = "d" + (timeEntry.fromDate.getTime() - timesheet.fromDate.getTime()) / (24*60*60*1000);
-        hours = timeEntry.hours.doubleValue();
-        entry.put(String.valueOf(dayNumber), hours);
-        if (dayNumber.equals("d0")) day0Total += hours;
-        if (dayNumber.equals("d1")) day1Total += hours;
-        if (dayNumber.equals("d2")) day2Total += hours;
-        if (dayNumber.equals("d3")) day3Total += hours;
-        if (dayNumber.equals("d4")) day4Total += hours;
-        if (dayNumber.equals("d5")) day5Total += hours;
-        if (dayNumber.equals("d6")) day6Total += hours;
-        taskTotal += hours;
+        dayNumber = "d" + (timeEntry.fromDate.getTime() - timesheet.fromDate.getTime()) / (24*60*60*1000)
+        hours = timeEntry.hours.doubleValue()
+        entry.put(String.valueOf(dayNumber), hours)
+        if (dayNumber.equals("d0")) day0Total += hours
+        if (dayNumber.equals("d1")) day1Total += hours
+        if (dayNumber.equals("d2")) day2Total += hours
+        if (dayNumber.equals("d3")) day3Total += hours
+        if (dayNumber.equals("d4")) day4Total += hours
+        if (dayNumber.equals("d5")) day5Total += hours
+        if (dayNumber.equals("d6")) day6Total += hours
+        taskTotal += hours
     }
-    entry.rateTypeId = timeEntry.rateTypeId;
+    entry.rateTypeId = timeEntry.rateTypeId
 }
 
 if (timeEntry) {
-    lastTimeEntry = timeEntry;
-    retrieveWorkEffortData();
+    lastTimeEntry = timeEntry
+    retrieveWorkEffortData()
     }
 
 // add empty lines if timesheet not completed
 if (!timesheet.statusId.equals("TIMESHEET_COMPLETED")) {
     for (c=0; c < 3; c++) { // add empty lines
-        entries.add(["timesheetId" : timesheet.timesheetId]);
+        entries.add(["timesheetId" : timesheet.timesheetId])
     }
 }
 
 // add the totals line if at least one entry
 if (timeEntry) {
-    entry = ["timesheetId" : timesheet.timesheetId];
-    entry.d0 = day0Total;
-    entry.d1 = day1Total;
-    entry.d2 = day2Total;
-    entry.d3 = day3Total;
-    entry.d4 = day4Total;
-    entry.d5 = day5Total;
-    entry.d6 = day6Total;
-    entry.phaseName = uiLabelMap.ProjectMgrTotals;
-    entry.workEffortId = "Totals";
-    entry.total = day0Total + day1Total + day2Total + day3Total + day4Total + day5Total + day6Total;
-    entries.add(entry);
+    entry = ["timesheetId" : timesheet.timesheetId]
+    entry.d0 = day0Total
+    entry.d1 = day1Total
+    entry.d2 = day2Total
+    entry.d3 = day3Total
+    entry.d4 = day4Total
+    entry.d5 = day5Total
+    entry.d6 = day6Total
+    entry.phaseName = uiLabelMap.ProjectMgrTotals
+    entry.workEffortId = "Totals"
+    entry.total = day0Total + day1Total + day2Total + day3Total + day4Total + day5Total + day6Total
+    entries.add(entry)
 }
-context.timeEntries = entries;
+context.timeEntries = entries
 // get all timesheets of this user, including the planned hours
-timesheetsDb = from("Timesheet").where("partyId", partyId).orderBy("fromDate DESC").queryList();
-timesheets = new LinkedList();
+timesheetsDb = from("Timesheet").where("partyId", partyId).orderBy("fromDate DESC").queryList()
+timesheets = new LinkedList()
 timesheetsDb.each { timesheetDb ->
-    timesheet = [:];
-    timesheet.putAll(timesheetDb);
-    entries = timesheetDb.getRelated("TimeEntry", null, null, false);
-    hours = 0.00;
+    timesheet = [:]
+    timesheet.putAll(timesheetDb)
+    entries = timesheetDb.getRelated("TimeEntry", null, null, false)
+    hours = 0.00
     entries.each { timeEntry ->
         if (timeEntry.hours) {
-            hours += timeEntry.hours.doubleValue();
+            hours += timeEntry.hours.doubleValue()
         }
     }
-    timesheet.weekNumber = UtilDateTime.weekNumber(timesheetDb.fromDate);
-    timesheet.hours = hours;
-    timesheets.add(timesheet);
+    timesheet.weekNumber = UtilDateTime.weekNumber(timesheetDb.fromDate)
+    timesheet.hours = hours
+    timesheets.add(timesheet)
 }
-context.timesheets = timesheets;
+context.timesheets = timesheets

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GanttChart.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GanttChart.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GanttChart.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GanttChart.groovy Wed Nov  2 19:09:13 2016
@@ -23,118 +23,118 @@ import org.apache.ofbiz.base.util.UtilVa
 import org.apache.ofbiz.entity.condition.EntityCondition
 import org.apache.ofbiz.entity.condition.EntityOperator
 
-projectId = parameters.projectId;
-userLogin = parameters.userLogin;
+projectId = parameters.projectId
+userLogin = parameters.userLogin
 
 //project info
-result = runService('getProject', [projectId : projectId, userLogin : userLogin]);
-project = result.projectInfo;
+result = runService('getProject', [projectId : projectId, userLogin : userLogin])
+project = result.projectInfo
 if (project && project.startDate)
-    context.chartStart = project.startDate;
+    context.chartStart = project.startDate
 else
-    context.chartStart = UtilDateTime.nowTimestamp(); // default todays date
+    context.chartStart = UtilDateTime.nowTimestamp() // default todays date
 if (project && project.completionDate)
-    context.chartEnd = project.completionDate;
+    context.chartEnd = project.completionDate
 else
-    context.chartEnd = UtilDateTime.addDaysToTimestamp(UtilDateTime.nowTimestamp(), 14); // default 14 days long
+    context.chartEnd = UtilDateTime.addDaysToTimestamp(UtilDateTime.nowTimestamp(), 14) // default 14 days long
 
-if (project == null) return;
+if (project == null) return
 
-ganttList = new LinkedList();
-result = runService('getProjectPhaseList', [userLogin : userLogin , projectId : projectId]);
-phases = result.phaseList;
+ganttList = new LinkedList()
+result = runService('getProjectPhaseList', [userLogin : userLogin , projectId : projectId])
+phases = result.phaseList
 if (phases) {
     phases.each { phase ->
-        newPhase = phase;
-        newPhase.phaseNr = phase.phaseId;
+        newPhase = phase
+        newPhase.phaseNr = phase.phaseId
         if (!newPhase.estimatedStartDate && newPhase.actualStartDate) {
-            newPhase.estimatedStartDate = newPhase.actualStartDate;
+            newPhase.estimatedStartDate = newPhase.actualStartDate
         }
         if (!newPhase.estimatedStartDate) {
-            newPhase.estimatedStartDate = context.chartStart;
+            newPhase.estimatedStartDate = context.chartStart
         }
         if (!newPhase.estimatedCompletionDate && newPhase.actualCompletionDate) {
-            newPhase.estimatedCompletionDate = newPhase.actualCompletionDateDate;
+            newPhase.estimatedCompletionDate = newPhase.actualCompletionDateDate
         }
         if (!newPhase.estimatedCompletionDate) {
-            newPhase.estimatedCompletionDate = UtilDateTime.addDaysToTimestamp(newPhase.estimatedStartDate, 3);
+            newPhase.estimatedCompletionDate = UtilDateTime.addDaysToTimestamp(newPhase.estimatedStartDate, 3)
         }
-        newPhase.workEffortTypeId = "PHASE";
-        ganttList.add(newPhase);
+        newPhase.workEffortTypeId = "PHASE"
+        ganttList.add(newPhase)
         cond = EntityCondition.makeCondition(
                 [
                 EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "PTS_CANCELLED"),
                 EntityCondition.makeCondition("workEffortParentId", EntityOperator.EQUALS, phase.phaseId)
-                ], EntityOperator.AND);
-        tasks = from("WorkEffort").where(cond).orderBy("sequenceNum","workEffortName").queryList();
+                ], EntityOperator.AND)
+        tasks = from("WorkEffort").where(cond).orderBy("sequenceNum","workEffortName").queryList()
         if (tasks) {
             tasks.each { task ->
-                resultTaskInfo = runService('getProjectTask', [userLogin : userLogin , taskId : task.workEffortId]);
-                taskInfo = resultTaskInfo.taskInfo;
-                taskInfo.taskNr = task.workEffortId;
-                taskInfo.phaseNr = phase.phaseId;
+                resultTaskInfo = runService('getProjectTask', [userLogin : userLogin , taskId : task.workEffortId])
+                taskInfo = resultTaskInfo.taskInfo
+                taskInfo.taskNr = task.workEffortId
+                taskInfo.phaseNr = phase.phaseId
                 if (taskInfo.plannedHours && !taskInfo.currentStatusId.equals("PTS_COMPLETED") && taskInfo.plannedHours > taskInfo.actualHours) {
-                    taskInfo.resource = taskInfo.plannedHours + " Hrs";
+                    taskInfo.resource = taskInfo.plannedHours + " Hrs"
                 } else {
-                    taskInfo.resource = taskInfo.actualHours + " Hrs";
+                    taskInfo.resource = taskInfo.actualHours + " Hrs"
                 }
-                Double duration = resultTaskInfo.plannedHours;
+                Double duration = resultTaskInfo.plannedHours
                 if (taskInfo.currentStatusId.equals("PTS_COMPLETED")) {
-                    taskInfo.completion = 100;
+                    taskInfo.completion = 100
                 } else {
                     if (taskInfo.actualHours && taskInfo.plannedHours) {
-                        taskInfo.completion = new BigDecimal(taskInfo.actualHours * 100 / taskInfo.plannedHours).setScale(0, BigDecimal.ROUND_UP);
+                        taskInfo.completion = new BigDecimal(taskInfo.actualHours * 100 / taskInfo.plannedHours).setScale(0, BigDecimal.ROUND_UP)
                     } else {
-                        taskInfo.completion = 0;
+                        taskInfo.completion = 0
                     }
                 }
                 if (!taskInfo.estimatedStartDate && taskInfo.actualStartDate) {
-                    taskInfo.estimatedStartDate = taskInfo.actualStartDate;
+                    taskInfo.estimatedStartDate = taskInfo.actualStartDate
                 }
                 if (!taskInfo.estimatedStartDate) {
-                    taskInfo.estimatedStartDate = newPhase.estimatedStartDate;
+                    taskInfo.estimatedStartDate = newPhase.estimatedStartDate
                 }
                 if (!taskInfo.estimatedCompletionDate && taskInfo.actualCompletionDate) {
-                    taskInfo.estimatedCompletionDate = taskInfo.actualCompletionDate;
+                    taskInfo.estimatedCompletionDate = taskInfo.actualCompletionDate
                 }
                 if (!taskInfo.estimatedCompletionDate && !duration) {
-                    taskInfo.estimatedCompletionDate = UtilDateTime.addDaysToTimestamp(newPhase.estimatedStartDate, 3);
+                    taskInfo.estimatedCompletionDate = UtilDateTime.addDaysToTimestamp(newPhase.estimatedStartDate, 3)
                 } else if (!taskInfo.estimatedCompletionDate && duration) {
-                    taskInfo.estimatedCompletionDate = UtilDateTime.addDaysToTimestamp(newPhase.estimatedStartDate, duration/8);
+                    taskInfo.estimatedCompletionDate = UtilDateTime.addDaysToTimestamp(newPhase.estimatedStartDate, duration/8)
                 }
-                taskInfo.estimatedStartDate = UtilDateTime.toDateString(taskInfo.estimatedStartDate, "MM/dd/yyyy");
-                taskInfo.estimatedCompletionDate = UtilDateTime.toDateString(taskInfo.estimatedCompletionDate, "MM/dd/yyyy");
-                taskInfo.workEffortTypeId = task.workEffortTypeId;
+                taskInfo.estimatedStartDate = UtilDateTime.toDateString(taskInfo.estimatedStartDate, "MM/dd/yyyy")
+                taskInfo.estimatedCompletionDate = UtilDateTime.toDateString(taskInfo.estimatedCompletionDate, "MM/dd/yyyy")
+                taskInfo.workEffortTypeId = task.workEffortTypeId
                 if (security.hasEntityPermission("PROJECTMGR", "_READ", session) || security.hasEntityPermission("PROJECTMGR", "_ADMIN", session)) {
-                    taskInfo.url = "/projectmgr/control/taskView?workEffortId="+task.workEffortId;
+                    taskInfo.url = "/projectmgr/control/taskView?workEffortId="+task.workEffortId
                 } else {
-                    taskInfo.url = "";
+                    taskInfo.url = ""
                 }
 
                 // dependency can only show one in the ganttchart, so onl show the latest one..
-                preTasks = from("WorkEffortAssoc").where("workEffortIdTo", task.workEffortId).orderBy("workEffortIdFrom").queryList();
-                latestTaskIds = new LinkedList();
+                preTasks = from("WorkEffortAssoc").where("workEffortIdTo", task.workEffortId).orderBy("workEffortIdFrom").queryList()
+                latestTaskIds = new LinkedList()
                 preTasks.each { preTask ->
-                    wf = preTask.getRelatedOne("FromWorkEffort", false);
-                    latestTaskIds.add(wf.workEffortId);
+                    wf = preTask.getRelatedOne("FromWorkEffort", false)
+                    latestTaskIds.add(wf.workEffortId)
                 }
-                count = 0;
+                count = 0
                 if (UtilValidate.isNotEmpty(latestTaskIds)) {
-                    taskInfo.preDecessor = "";
+                    taskInfo.preDecessor = ""
                     for (i in latestTaskIds) {
                         if (count > 0) {
-                            taskInfo.preDecessor = taskInfo.preDecessor +", " + i;
+                            taskInfo.preDecessor = taskInfo.preDecessor +", " + i
                         } else {
-                            taskInfo.preDecessor = taskInfo.preDecessor + i;
+                            taskInfo.preDecessor = taskInfo.preDecessor + i
                         }
-                        count ++;
+                        count ++
                     }
                 }
-                ganttList.add(taskInfo);
+                ganttList.add(taskInfo)
             }
         }
     }
 }
 
-context.phaseTaskList = ganttList;
+context.phaseTaskList = ganttList
 

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetLastRequestAssignment.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetLastRequestAssignment.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetLastRequestAssignment.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetLastRequestAssignment.groovy Wed Nov  2 19:09:13 2016
@@ -20,17 +20,17 @@
 
 // get last request from this user and use that project/task assignment as default on the screen
 
-custRequestList = from("CustRequest").where("fromPartyId", fromPartyId).orderBy("-createdDate").queryList();
+custRequestList = from("CustRequest").where("fromPartyId", fromPartyId).orderBy("-createdDate").queryList()
 if (custRequestList) {
-    custReqTaskList = custRequestList.get(0).getRelated("CustRequestWorkEffort", null, null, false);
+    custReqTaskList = custRequestList.get(0).getRelated("CustRequestWorkEffort", null, null, false)
     if (custReqTaskList) {
-        custReqTask = custReqTaskList.get(0).getRelatedOne("WorkEffort", false);  // phase
-        projectChildWorkEffort = custReqTask.getRelatedOne("ParentWorkEffort", false);  // phase name
+        custReqTask = custReqTaskList.get(0).getRelatedOne("WorkEffort", false) // phase
+        projectChildWorkEffort = custReqTask.getRelatedOne("ParentWorkEffort", false) // phase name
         if (projectChildWorkEffort) {
-            partyList = custReqTask.getRelated("WorkEffortPartyAssignment", null, null, false);
+            partyList = custReqTask.getRelated("WorkEffortPartyAssignment", null, null, false)
             if (partyList) {
-                context.childWorkEffortId = projectChildWorkEffort.workEffortId;
-                context.partyId= partyList.get(0).partyId;
+                context.childWorkEffortId = projectChildWorkEffort.workEffortId
+                context.partyId= partyList.get(0).partyId
             }
         }
     }

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetProjectId.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetProjectId.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetProjectId.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/GetProjectId.groovy Wed Nov  2 19:09:13 2016
@@ -17,14 +17,14 @@
  * under the License.
  */
 
-import org.apache.ofbiz.base.util.UtilValidate;
+import org.apache.ofbiz.base.util.UtilValidate
 
 if (parameters.workEffortId) {
-    workEffortId = parameters.workEffortId;
-    projects = from("ProjectAndPhaseAndTask").where("workEffortId", workEffortId).queryList();
+    workEffortId = parameters.workEffortId
+    projects = from("ProjectAndPhaseAndTask").where("workEffortId", workEffortId).queryList()
     if (UtilValidate.isNotEmpty(projects)) {
-        context.put("projectId", projects.get(0).getString("projectId"));
-        context.put("projectName", projects.get(0).getString("projectName"));
-        context.put("phaseName", projects.get(0).getString("phaseName"));
+        context.put("projectId", projects.get(0).getString("projectId"))
+        context.put("projectName", projects.get(0).getString("projectName"))
+        context.put("phaseName", projects.get(0).getString("phaseName"))
     }
 }

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListCurrentProjects.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListCurrentProjects.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListCurrentProjects.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListCurrentProjects.groovy Wed Nov  2 19:09:13 2016
@@ -25,20 +25,20 @@ import org.apache.ofbiz.entity.condition
 cond = EntityCondition.makeCondition([
         EntityCondition.makeCondition ("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"),
         EntityCondition.makeCondition ("currentStatusId", EntityOperator.NOT_EQUAL, "PRJ_CLOSED")
-        ], EntityJoinOperator.AND);
-allProjects = select("workEffortId").from("WorkEffort").where(cond).orderBy("workEffortName").queryList();
+        ], EntityJoinOperator.AND)
+allProjects = select("workEffortId").from("WorkEffort").where(cond).orderBy("workEffortName").queryList()
 
-projects = [];
+projects = []
 allProjects.each { project ->
-    result = runService('getProject', ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId]);
+    result = runService('getProject', ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId])
     if (result.projectInfo) {
-        resultAssign = from("WorkEffortPartyAssignment").where("partyId", parameters.userLogin.partyId, "workEffortId", project.workEffortId).queryList();
+        resultAssign = from("WorkEffortPartyAssignment").where("partyId", parameters.userLogin.partyId, "workEffortId", project.workEffortId).queryList()
         if (security.hasEntityPermission("PROJECTMGR", "_ADMIN", session)
         || ((security.hasEntityPermission("PROJECTMGR", "_ROLE_ADMIN", session) || security.hasEntityPermission("PROJECTMGR", "_ROLE_VIEW", session)) && resultAssign)) {
-            projects.add(result.projectInfo);
+            projects.add(result.projectInfo)
         }
     }
 }
 if (projects) {
-    context.projects = projects;
+    context.projects = projects
 }

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListResourceBillingHours.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListResourceBillingHours.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListResourceBillingHours.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ListResourceBillingHours.groovy Wed Nov  2 19:09:13 2016
@@ -17,15 +17,15 @@
  * under the License.
  */
 
-allProjects = select("workEffortId").from("WorkEffortAndPartyAssign").where("workEffortTypeId", "PROJECT", "partyId", parameters.partyId).orderBy("workEffortName").cache(true).queryList();
+allProjects = select("workEffortId").from("WorkEffortAndPartyAssign").where("workEffortTypeId", "PROJECT", "partyId", parameters.partyId).orderBy("workEffortName").cache(true).queryList()
 
-projects = [];
+projects = []
 allProjects.each { project ->
-    result = runService('getProject', ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId, partyId : parameters.partyId]);
-    projects.add(result.projectInfo);
+    result = runService('getProject', ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId, partyId : parameters.partyId])
+    projects.add(result.projectInfo)
 }
 if (projects) {
-    context.billingList = projects;
+    context.billingList = projects
 }
 
 

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectBilling.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectBilling.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectBilling.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectBilling.groovy Wed Nov  2 19:09:13 2016
@@ -23,13 +23,13 @@ import org.apache.ofbiz.base.util.UtilDa
 import org.apache.ofbiz.entity.condition.EntityCondition
 import org.apache.ofbiz.entity.condition.EntityOperator
 
-projectId = parameters.projectId;
+projectId = parameters.projectId
 entryExprs =
     EntityCondition.makeCondition([
         EntityCondition.makeCondition("projectId", EntityOperator.EQUALS, projectId),
         EntityCondition.makeCondition("invoiceId", EntityOperator.NOT_EQUAL, null),
-        ], EntityOperator.AND);
-orderBy = ["-fromDate"];
+        ], EntityOperator.AND)
+orderBy = ["-fromDate"]
 // check if latest invoice generated is still in process so allow re-generation to correct errors
 entryIterator = from("ProjectPhaseTaskAndTimeEntryTimeSheet")
                     .where(EntityCondition.makeCondition([
@@ -37,16 +37,16 @@ entryIterator = from("ProjectPhaseTaskAn
                                 EntityCondition.makeCondition("invoiceId", EntityOperator.NOT_EQUAL, null),
                             ], EntityOperator.AND))
                     .orderBy("-fromDate")
-                    .queryIterator();
+                    .queryIterator()
 while (entryItem = entryIterator.next()) {
-    invoice = entryItem.getRelatedOne("Invoice", false);
+    invoice = entryItem.getRelatedOne("Invoice", false)
     if (invoice.getString("statusId").equals("INVOICE_IN_PROCESS")) {
-        context.partyIdFrom = invoice.partyIdFrom;
-        context.partyId = invoice.partyId;
-        context.invoiceId = invoice.invoiceId;
-        break;
+        context.partyIdFrom = invoice.partyIdFrom
+        context.partyId = invoice.partyId
+        context.invoiceId = invoice.invoiceId
+        break
         }
     }
-entryIterator.close();
+entryIterator.close()
 //start of this month
-context.thruDate = UtilDateTime.getMonthStart(UtilDateTime.nowTimestamp());
+context.thruDate = UtilDateTime.getMonthStart(UtilDateTime.nowTimestamp())

Modified: ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectIsBillable.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectIsBillable.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectIsBillable.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/groovyScripts/ProjectIsBillable.groovy Wed Nov  2 19:09:13 2016
@@ -17,22 +17,22 @@
  * under the License.
  */
 
-projectMembers = from("WorkEffortPartyAssignment").where("workEffortId", context.projectId).filterByDate().queryList();
+projectMembers = from("WorkEffortPartyAssignment").where("workEffortId", context.projectId).filterByDate().queryList()
 
-toPartyId = null;
-fromPartyId = null;
+toPartyId = null
+fromPartyId = null
 projectMembers.each {member ->
     if (member.roleTypeId.equals("INTERNAL_ORGANIZATIO")) {
-        fromPartyId = member.partyId;
+        fromPartyId = member.partyId
     }
     if (member.roleTypeId.equals("CLIENT_BILLING")) {
-        toPartyId = member.partyId;
+        toPartyId = member.partyId
     }
     if (fromPartyId && toPartyId && fromPartyId.equals(toPartyId)) {
-        context.isBillable = false;
+        context.isBillable = false
     } else if (!toPartyId || !fromPartyId){
-        context.isBillable = false;
+        context.isBillable = false
     } else {    
-        context.isBillable = true;
+        context.isBillable = true
     }
 }

Modified: ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddProductBacklogItem.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddProductBacklogItem.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddProductBacklogItem.groovy (original)
+++ ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddProductBacklogItem.groovy Wed Nov  2 19:09:13 2016
@@ -17,116 +17,116 @@
 * under the License.
 */
 
-import java.sql.*;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import net.fortuna.ical4j.model.DateTime;
-import org.apache.ofbiz.base.util.*;
-import org.apache.ofbiz.entity.condition.*;
-import sun.util.calendar.LocalGregorianCalendar.Date;
+import java.sql.*
+import java.sql.Timestamp
+import java.util.Calendar
+import net.fortuna.ical4j.model.DateTime
+import org.apache.ofbiz.base.util.*
+import org.apache.ofbiz.entity.condition.*
+import sun.util.calendar.LocalGregorianCalendar.Date
 
-def module = "AddProductBacklogItem.groovy";
+def module = "AddProductBacklogItem.groovy"
 
 // find cust request and items
-def inputFields = [:];
+def inputFields = [:]
 
 if(parameters.statusId == null){
-    parameters.statusId = "";
+    parameters.statusId = ""
 }else if("Any".equals(parameters.statusId)){
-    parameters.statusId = "";
+    parameters.statusId = ""
 }
-inputFields.putAll(parameters);
-inputFields.custRequestTypeId = "RF_PROD_BACKLOG";
-def performFindResults = runService('performFind', ["entityName": "CustRequestAndCustRequestItem", "inputFields": inputFields, "orderBy": "custSequenceNum"]);
-def custRequestAndItems = performFindResults.listIt.getCompleteList();
-performFindResults.listIt.close();
+inputFields.putAll(parameters)
+inputFields.custRequestTypeId = "RF_PROD_BACKLOG"
+def performFindResults = runService('performFind', ["entityName": "CustRequestAndCustRequestItem", "inputFields": inputFields, "orderBy": "custSequenceNum"])
+def custRequestAndItems = performFindResults.listIt.getCompleteList()
+performFindResults.listIt.close()
 
 // prepare cust request item list [cust request and item Map]
-def countSequence = 1;
-def custRequestAndCustRequestItems = [];
+def countSequence = 1
+def custRequestAndCustRequestItems = []
 custRequestAndItems.each() { custRequestAndItem ->
-    def tempCustRequestAndItem = [:];
-    tempCustRequestAndItem.putAll(custRequestAndItem);
-    tempCustRequestAndItem.custSequenceNum = countSequence;
-    tempCustRequestAndItem.realSequenceNum = custRequestAndItem.custSequenceNum;
+    def tempCustRequestAndItem = [:]
+    tempCustRequestAndItem.putAll(custRequestAndItem)
+    tempCustRequestAndItem.custSequenceNum = countSequence
+    tempCustRequestAndItem.realSequenceNum = custRequestAndItem.custSequenceNum
     // if custRequest has task then get Actual Hours
-    custWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", custRequestAndItem.custRequestId).queryList();
+    custWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", custRequestAndItem.custRequestId).queryList()
     if (custWorkEffortList) {
-        actualHours = 0.00;
+        actualHours = 0.00
         custWorkEffortList.each() { custWorkEffortMap ->
-            result = runService('getScrumActualHour', ["taskId" : custWorkEffortMap.workEffortId,"partyId" : null, "userLogin" : userLogin]);
-            actualHours += result.actualHours;
+            result = runService('getScrumActualHour', ["taskId" : custWorkEffortMap.workEffortId,"partyId" : null, "userLogin" : userLogin])
+            actualHours += result.actualHours
         }
         if(actualHours) {
-            tempCustRequestAndItem.actualHours = actualHours;
+            tempCustRequestAndItem.actualHours = actualHours
         } else {
-            tempCustRequestAndItem.actualHours = null;
+            tempCustRequestAndItem.actualHours = null
         }
     } else {
-        tempCustRequestAndItem.actualHours = null;
+        tempCustRequestAndItem.actualHours = null
     }
-    custRequestAndCustRequestItems.add(tempCustRequestAndItem);
-    countSequence ++;
+    custRequestAndCustRequestItems.add(tempCustRequestAndItem)
+    countSequence ++
 }
 
 if ("N".equals(parameters.sequence)) { // re-order category list item
-    custRequestAndCustRequestItems = UtilMisc.sortMaps(custRequestAndCustRequestItems, ["parentCustRequestId"]);
+    custRequestAndCustRequestItems = UtilMisc.sortMaps(custRequestAndCustRequestItems, ["parentCustRequestId"])
 }
 //set status back for display in Find screen
 if("".equals(parameters.statusId)){
-    parameters.statusId = "Any";
+    parameters.statusId = "Any"
 }
-context.custRequestAndCustRequestItems = custRequestAndCustRequestItems;
+context.custRequestAndCustRequestItems = custRequestAndCustRequestItems
 
 // unplanned backlog item list
 
-productId = parameters.productId;
+productId = parameters.productId
 
-conditionList = [];
-orConditionList = [];
-mainConditionList = [];
+conditionList = []
+orConditionList = []
+mainConditionList = []
 
-conditionList.add(EntityCondition.makeCondition("custRequestTypeId", EntityOperator.EQUALS, "RF_UNPLAN_BACKLOG"));
-conditionList.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, parameters.productId));
+conditionList.add(EntityCondition.makeCondition("custRequestTypeId", EntityOperator.EQUALS, "RF_UNPLAN_BACKLOG"))
+conditionList.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, parameters.productId))
 
-orConditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "CRQ_ACCEPTED"));
-orConditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "CRQ_REOPENED"));
+orConditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "CRQ_ACCEPTED"))
+orConditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "CRQ_REOPENED"))
 
-orConditions = EntityCondition.makeCondition(orConditionList, EntityOperator.OR);
-conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND);
+orConditions = EntityCondition.makeCondition(orConditionList, EntityOperator.OR)
+conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND)
 
-mainConditionList.add(orConditions);
-mainConditionList.add(conditions);
+mainConditionList.add(orConditions)
+mainConditionList.add(conditions)
 
-unplannedList = select("custRequestId", "custSequenceNum", "statusId", "description", "custEstimatedMilliSeconds", "custRequestName", "parentCustRequestId").from("CustRequestAndCustRequestItem").where(mainConditionList).orderBy("custSequenceNum").queryList();
+unplannedList = select("custRequestId", "custSequenceNum", "statusId", "description", "custEstimatedMilliSeconds", "custRequestName", "parentCustRequestId").from("CustRequestAndCustRequestItem").where(mainConditionList).orderBy("custSequenceNum").queryList()
 
-def countSequenceUnplanned = 1;
-def unplanBacklogItems = [];
+def countSequenceUnplanned = 1
+def unplanBacklogItems = []
 unplannedList.each() { unplannedItem ->
-    def tempUnplanned = [:];
-    tempUnplanned.putAll(unplannedItem);
-    tempUnplanned.custSequenceNum = countSequenceUnplanned;
-    tempUnplanned.realSequenceNum = unplannedItem.custSequenceNum;
+    def tempUnplanned = [:]
+    tempUnplanned.putAll(unplannedItem)
+    tempUnplanned.custSequenceNum = countSequenceUnplanned
+    tempUnplanned.realSequenceNum = unplannedItem.custSequenceNum
     // if custRequest has task then get Actual Hours
-    unplanCustWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", unplannedItem.custRequestId).queryList();
+    unplanCustWorkEffortList = from("CustRequestWorkEffort").where("custRequestId", unplannedItem.custRequestId).queryList()
     if (unplanCustWorkEffortList) {
-        actualHours = 0.00;
+        actualHours = 0.00
         unplanCustWorkEffortList.each() { custWorkEffortMap ->
-            result = runService('getScrumActualHour', ["taskId" : custWorkEffortMap.workEffortId,"partyId" : null, "userLogin" : userLogin]);
-            actualHours += result.actualHours;
+            result = runService('getScrumActualHour', ["taskId" : custWorkEffortMap.workEffortId,"partyId" : null, "userLogin" : userLogin])
+            actualHours += result.actualHours
         }
         if(actualHours) {
-            tempUnplanned.actualHours = actualHours;
+            tempUnplanned.actualHours = actualHours
         } else {
-            tempUnplanned.actualHours = null;
+            tempUnplanned.actualHours = null
         }
     } else {
-        tempUnplanned.actualHours = null;
+        tempUnplanned.actualHours = null
     }
-    unplanBacklogItems.add(tempUnplanned);
-    countSequenceUnplanned ++;
+    unplanBacklogItems.add(tempUnplanned)
+    countSequenceUnplanned ++
 }
 if ("N".equals(parameters.UnplannedSequence)) { // re-order category list item
-    unplanBacklogItems = UtilMisc.sortMaps(unplanBacklogItems, ["parentCustRequestId"]);
+    unplanBacklogItems = UtilMisc.sortMaps(unplanBacklogItems, ["parentCustRequestId"])
 }
-context.unplanBacklogItems = unplanBacklogItems;
+context.unplanBacklogItems = unplanBacklogItems

Modified: ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddResourceTaskParty.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddResourceTaskParty.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddResourceTaskParty.groovy (original)
+++ ofbiz/trunk/specialpurpose/scrum/groovyScripts/AddResourceTaskParty.groovy Wed Nov  2 19:09:13 2016
@@ -17,40 +17,40 @@
 * under the License.
 */
 
-import java.util.*;
-import org.apache.ofbiz.base.util.Debug;
+import java.util.*
+import org.apache.ofbiz.base.util.Debug
 
 partyId = parameters.partyId
 // get existing task that no assign
-projectSprintBacklogAndTaskList = [];
-projectAndTaskList = from("ProjectSprintBacklogAndTask").where("sprintTypeId", "SCRUM_SPRINT","taskCurrentStatusId", "STS_CREATED").orderBy("taskId DESC").queryList();
+projectSprintBacklogAndTaskList = []
+projectAndTaskList = from("ProjectSprintBacklogAndTask").where("sprintTypeId", "SCRUM_SPRINT","taskCurrentStatusId", "STS_CREATED").orderBy("taskId DESC").queryList()
 projectAndTaskList.each { projectAndTaskMap ->
-userLoginId = userLogin.partyId;
-    projectId = projectAndTaskMap.projectId;
-    partyAssignmentProjectList = from("WorkEffortPartyAssignment").where("workEffortId", projectId, "partyId", partyId).queryList();
-    partyAssignmentProjectMap = partyAssignmentProjectList[0];
+userLoginId = userLogin.partyId
+    projectId = projectAndTaskMap.projectId
+    partyAssignmentProjectList = from("WorkEffortPartyAssignment").where("workEffortId", projectId, "partyId", partyId).queryList()
+    partyAssignmentProjectMap = partyAssignmentProjectList[0]
         // if this userLoginId is a member of project
         if (partyAssignmentProjectMap) {
-            sprintId = projectAndTaskMap.sprintId;
-            partyAssignmentSprintList = from("WorkEffortPartyAssignment").where("workEffortId", sprintId, "partyId", partyId).queryList();
-            partyAssignmentSprintMap = partyAssignmentSprintList[0];
+            sprintId = projectAndTaskMap.sprintId
+            partyAssignmentSprintList = from("WorkEffortPartyAssignment").where("workEffortId", sprintId, "partyId", partyId).queryList()
+            partyAssignmentSprintMap = partyAssignmentSprintList[0]
             // if this userLoginId is a member of sprint
             if (partyAssignmentSprintMap) {
-                workEffortId = projectAndTaskMap.taskId;
-                partyAssignmentTaskList = from("WorkEffortPartyAssignment").where("workEffortId", workEffortId).queryList();
-                partyAssignmentTaskMap = partyAssignmentTaskList[0];
+                workEffortId = projectAndTaskMap.taskId
+                partyAssignmentTaskList = from("WorkEffortPartyAssignment").where("workEffortId", workEffortId).queryList()
+                partyAssignmentTaskMap = partyAssignmentTaskList[0]
                 // if the task do not assigned
                 if (!partyAssignmentTaskMap) {
-                    projectSprintBacklogAndTaskList.add(projectAndTaskMap);
+                    projectSprintBacklogAndTaskList.add(projectAndTaskMap)
                     // if the task do not assigned and assigned with custRequestTypeId = RF_SCRUM_MEETINGS
                     } else {
-                        custRequestTypeId = projectAndTaskMap.custRequestTypeId;
-                        backlogStatusId = projectAndTaskMap.backlogStatusId;
+                        custRequestTypeId = projectAndTaskMap.custRequestTypeId
+                        backlogStatusId = projectAndTaskMap.backlogStatusId
                         if (custRequestTypeId.equals("RF_SCRUM_MEETINGS") && backlogStatusId.equals("CRQ_REVIEWED")) {
-                            projectSprintBacklogAndTaskList.add(projectAndTaskMap);
+                            projectSprintBacklogAndTaskList.add(projectAndTaskMap)
                            }
                      }
                 }
             }
     }
-context.projectSprintBacklogAndTaskList = projectSprintBacklogAndTaskList;
+context.projectSprintBacklogAndTaskList = projectSprintBacklogAndTaskList

Modified: ofbiz/trunk/specialpurpose/scrum/groovyScripts/BacklogNotifications.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/groovyScripts/BacklogNotifications.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/scrum/groovyScripts/BacklogNotifications.groovy (original)
+++ ofbiz/trunk/specialpurpose/scrum/groovyScripts/BacklogNotifications.groovy Wed Nov  2 19:09:13 2016
@@ -17,48 +17,48 @@
  * under the License.
  */
 
-import org.apache.ofbiz.base.util.*;
-import org.apache.ofbiz.entity.condition.*;
+import org.apache.ofbiz.base.util.*
+import org.apache.ofbiz.entity.condition.*
 
-def module = "BacklogNotifications.groovy";
+def module = "BacklogNotifications.groovy"
 
-custRequest = from("CustRequest").where("custRequestId", custRequestId).queryOne();
-person = from("PartyNameView").where("partyId", partyIdTo).queryOne();
-informationMap = [:];
-informationMap.internalName = null;
-informationMap.productId = null;
-informationMap.workEffortName = null;
-informationMap.workEffortId = null;
+custRequest = from("CustRequest").where("custRequestId", custRequestId).queryOne()
+person = from("PartyNameView").where("partyId", partyIdTo).queryOne()
+informationMap = [:]
+informationMap.internalName = null
+informationMap.productId = null
+informationMap.workEffortName = null
+informationMap.workEffortId = null
 
 //check in sprint
-backlogList = select("productId", "workEffortId", "custRequestId").from("ProductBacklog").where("workEffortTypeId", "SCRUM_SPRINT", "custRequestId", custRequestId).queryList();
+backlogList = select("productId", "workEffortId", "custRequestId").from("ProductBacklog").where("workEffortTypeId", "SCRUM_SPRINT", "custRequestId", custRequestId).queryList()
 if (backlogList) {
-    product = from("Product").where("productId", backlogList[0].productId).queryOne();
-    sprint = from("WorkEffort").where("workEffortId", backlogList[0].workEffortId).queryOne();
-    informationMap.internalName = product.internalName;
-    informationMap.productId = product.productId;
-    informationMap.workEffortName = sprint.workEffortName;
-    informationMap.workEffortId = sprint.workEffortId;
+    product = from("Product").where("productId", backlogList[0].productId).queryOne()
+    sprint = from("WorkEffort").where("workEffortId", backlogList[0].workEffortId).queryOne()
+    informationMap.internalName = product.internalName
+    informationMap.productId = product.productId
+    informationMap.workEffortName = sprint.workEffortName
+    informationMap.workEffortId = sprint.workEffortId
 } else {
-    backlogList = select("productId", "workEffortId", "custRequestId").from("ProductBacklog").where("custRequestId", custRequestId).queryList();
+    backlogList = select("productId", "workEffortId", "custRequestId").from("ProductBacklog").where("custRequestId", custRequestId).queryList()
     if (backlogList) {
         if (backlogList[0].productId) {
-            product = from("Product").where("productId", backlogList[0].productId).queryOne();
-            informationMap.internalName = product.internalName;
-            informationMap.productId = product.productId;
+            product = from("Product").where("productId", backlogList[0].productId).queryOne()
+            informationMap.internalName = product.internalName
+            informationMap.productId = product.productId
         }
     }
 }
 // check backlog removed from sprint.
-removedFromSprint = false;
+removedFromSprint = false
 if ("CRQ_ACCEPTED".equals(custRequest.statusId)) {
-    custStatusList = custRequest.getRelated("CustRequestStatus", null, ["-custRequestStatusId"], false);
+    custStatusList = custRequest.getRelated("CustRequestStatus", null, ["-custRequestStatusId"], false)
     if (custStatusList.size() > 2 && "CRQ_REVIEWED".equals(custStatusList[1].statusId)) {
-        removedFromSprint = true;
+        removedFromSprint = true
         }
     }
 
-context.custRequest = custRequest;
-context.person = person;
-context.informationMap = informationMap;
-context.removedFromSprint = removedFromSprint;
+context.custRequest = custRequest
+context.person = person
+context.informationMap = informationMap
+context.removedFromSprint = removedFromSprint