svn commit: r574662 - in /ofbiz/trunk/applications/workeffort: servicedef/ src/org/ofbiz/workeffort/workeffort/ webapp/workeffort/calendar/

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

svn commit: r574662 - in /ofbiz/trunk/applications/workeffort: servicedef/ src/org/ofbiz/workeffort/workeffort/ webapp/workeffort/calendar/

adrianc
Author: adrianc
Date: Tue Sep 11 11:37:52 2007
New Revision: 574662

URL: http://svn.apache.org/viewvc?rev=574662&view=rev
Log:
Work Effort modifications proposed in OFBIZ-1228. Added ability for other components to use the work effort calendar services and screens.

Modified:
    ofbiz/trunk/applications/workeffort/servicedef/services.xml
    ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/upcoming.ftl
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl

Modified: ofbiz/trunk/applications/workeffort/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services.xml?rev=574662&r1=574661&r2=574662&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/workeffort/servicedef/services.xml Tue Sep 11 11:37:52 2007
@@ -187,6 +187,7 @@
         <attribute name="numPeriods" type="java.lang.Integer" mode="IN" optional="false"/>
         <attribute name="periodType" type="java.lang.Integer" mode="IN" optional="false"/>
         <attribute name="filterOutCanceledEvents" type="java.lang.Boolean" mode="IN" optional="true"/>
+        <attribute name="entityExprList" type="java.util.List" mode="IN" optional="true"/>
         <attribute name="periods" type="java.util.List" mode="OUT" optional="false"/>
         <attribute name="maxConcurrentEntries" type="java.lang.Integer" mode="OUT" optional="false"/>
     </service>

Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=574662&r1=574661&r2=574662&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Tue Sep 11 11:37:52 2007
@@ -287,81 +287,79 @@
         return resultMap;
     }
         
-    private static List getWorkEffortEvents(DispatchContext ctx, Timestamp startStamp, Timestamp endStamp, String partyId, String facilityId, String fixedAssetId) {
-        Set partyIds = new HashSet();
-        partyIds.add(partyId);
-        return getWorkEffortEvents(ctx, startStamp, endStamp, partyIds, facilityId, fixedAssetId);
-    }
-
-    private static List getWorkEffortEvents(DispatchContext ctx, Timestamp startStamp, Timestamp endStamp, Collection partyIds, String facilityId, String fixedAssetId) {
-        GenericDelegator delegator = ctx.getDelegator();
-        List validWorkEfforts = new ArrayList();
-        try {
-            List entityExprList = UtilMisc.toList(
-                    new EntityExpr("estimatedCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, startStamp),
-                    new EntityExpr("estimatedStartDate", EntityOperator.LESS_THAN, endStamp));
-            // Filter out all the canceled work efforts
-            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "CAL_CANCELLED"));
-            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CANCELLED"));
-            
-            List typesList = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "EVENT"));
-            if (partyIds != null && partyIds.size() > 0) {
-                entityExprList.add(new EntityExpr("partyId", EntityOperator.IN, partyIds));
-            }
-            if (UtilValidate.isNotEmpty(facilityId)) {
-                entityExprList.add(new EntityExpr("facilityId", EntityOperator.EQUALS, facilityId));
-                typesList.add(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_HEADER"));
-                entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CREATED"));
-                entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_COMPLETED"));
-                entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CLOSED"));
-            }
-            if (UtilValidate.isNotEmpty(fixedAssetId)) {
-                entityExprList.add(new EntityExpr("fixedAssetId", EntityOperator.EQUALS, fixedAssetId));
-                typesList.add(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"));
-                entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CREATED"));
-                entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_COMPLETED"));
-                entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CLOSED"));
-            }
-            EntityCondition typesCondition = null;
-            if (typesList.size() == 1) {
-                typesCondition = (EntityExpr)typesList.get(0);
-            } else {
-                typesCondition = new EntityConditionList(typesList, EntityJoinOperator.OR);
-            }
-            entityExprList.add(typesCondition);
-
-            List tempWorkEfforts = null;
-            if (partyIds != null && partyIds.size() > 0) {
-                tempWorkEfforts = delegator.findByAnd("WorkEffortAndPartyAssign", entityExprList, UtilMisc.toList("estimatedStartDate"));
-            } else {
-                tempWorkEfforts = delegator.findByAnd("WorkEffort", entityExprList, UtilMisc.toList("estimatedStartDate"));
-            }
-
-            // This block needs to be here to filter duplicate workeffort ids when
-            // more than one of the selected party ids is assigned to the WorkEffort
-            
-            Set tempWeKeys = new HashSet();
-            Iterator tempWorkEffortIter = tempWorkEfforts.iterator();
-            while (tempWorkEffortIter.hasNext()) {
-                GenericValue tempWorkEffort = (GenericValue) tempWorkEffortIter.next();
-                String tempWorkEffortId = tempWorkEffort.getString("workEffortId");
-                if (tempWeKeys.contains(tempWorkEffortId)) {
-                    tempWorkEffortIter.remove();
-                } else {
-                    tempWeKeys.add(tempWorkEffortId);
-                }
-            }
-            
-            validWorkEfforts = new ArrayList(tempWorkEfforts);
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e, module);
+    private static List getDefaultWorkEffortExprList(Collection partyIds, String facilityId, String fixedAssetId) {
+        List entityExprList = UtilMisc.toList(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "CAL_CANCELLED"), new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CANCELLED"));
+        List typesList = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "EVENT"));
+        if (partyIds != null && partyIds.size() > 0) {
+            entityExprList.add(new EntityExpr("partyId", EntityOperator.IN, partyIds));
+        }
+        if (UtilValidate.isNotEmpty(facilityId)) {
+            entityExprList.add(new EntityExpr("facilityId", EntityOperator.EQUALS, facilityId));
+            typesList.add(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_HEADER"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CREATED"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_COMPLETED"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CLOSED"));
+        }
+        if (UtilValidate.isNotEmpty(fixedAssetId)) {
+            entityExprList.add(new EntityExpr("fixedAssetId", EntityOperator.EQUALS, fixedAssetId));
+            typesList.add(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CREATED"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_COMPLETED"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "PRUN_CLOSED"));
+        }
+        EntityCondition typesCondition = null;
+        if (typesList.size() == 1) {
+            typesCondition = (EntityExpr) typesList.get(0);
+        } else {
+            typesCondition = new EntityConditionList(typesList, EntityJoinOperator.OR);
         }
-        return validWorkEfforts;        
+        entityExprList.add(typesCondition);
+        return entityExprList;
     }
 
+    /**
+     * Get Work Efforts by period.
+     * <p>
+     * This method takes the following parameters:
+     * </p>
+     * <ul>
+     * <li>start - TimeStamp (Period start date/time)</li>
+     * <li>numPeriods - Integer</li>
+     * <li>periodType - Integer (see java.util.Calendar)</li>
+     * <li>eventStatus - String</li>
+     * <li>partyId - String</li>
+     * <li>partyIds - List</li>
+     * <li>facilityId - String</li>
+     * <li>fixedAssetId - String</li>
+     * <li>filterOutCanceledEvents - Boolean</li>
+     * <li>entityExprList - List</li>
+     * </ul>
+     * <p>
+     * The method will find all matching Work Effort events and return them as a List called
+     * <b>periods</b> - one List element per period. It also returns a
+     * <b>maxConcurrentEntries</b> Integer - which indicates the maximum number of
+     * Work Efforts found in one period.
+     * </p>
+     * <p>
+     * Each <b>periods</b> list element is a Map containing the following
+     * key/value pairs:
+     * </p>
+     * <ul>
+     * <li>start - TimeStamp (Period start date/time)</li>
+     * <li>end - TimeStamp (Period end date/time)</li>
+     * <li>calendarEntries - List of Maps. Each Map contains the following
+     * key/value pairs:</li>
+     * <ul>
+     * <li>workEffort - GenericValue</li>
+     * <li>periodSpan - Integer (Number of periods this Work Effort spans)</li>
+     * <li>startOfPeriod - Boolean (true if this is the first occurrence in the period range)</li>
+     * </ul>
+     * </ul>
+     */
     public static Map getWorkEffortEventsByPeriod(DispatchContext ctx, Map context) {
+        GenericDelegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
-        GenericValue userLogin = (GenericValue) context.get("userLogin");    
+        GenericValue userLogin = (GenericValue) context.get("userLogin");
         Locale locale = (Locale) context.get("locale");
         TimeZone timeZone = (TimeZone) context.get("timeZone");
 
@@ -374,32 +372,35 @@
         String fixedAssetId = (String) context.get("fixedAssetId");
         Boolean filterOutCanceledEvents = (Boolean) context.get("filterOutCanceledEvents");
         if (filterOutCanceledEvents == null) {
-         filterOutCanceledEvents = Boolean.FALSE;
+            filterOutCanceledEvents = Boolean.FALSE;
         }
-        
-        //To be returned, the max concurrent entries for a single period
+
+        // To be returned, the max concurrent entries for a single period
         int maxConcurrentEntries = 0;
-                
+
         Integer periodTypeObject = (Integer) context.get("periodType");
         int periodType = 0;
         if (periodTypeObject != null) {
             periodType = periodTypeObject.intValue();
         }
-        
+
         int numPeriods = 0;
-        if(numPeriodsInteger != null) numPeriods = numPeriodsInteger.intValue();
-        
+        if (numPeriodsInteger != null) {
+            numPeriods = numPeriodsInteger.intValue();
+        }
+
         // get a timestamp (date) for the beginning of today and for beginning of numDays+1 days from now
         Timestamp startStamp = UtilDateTime.getDayStart(startDay, timeZone, locale);
         Timestamp endStamp = UtilDateTime.adjustTimestamp(startStamp, periodType, 1, timeZone, locale);
         long periodLen = endStamp.getTime() - startStamp.getTime();
         endStamp = UtilDateTime.adjustTimestamp(startStamp, periodType, numPeriods, timeZone, locale);
-        
+
         // Get the WorkEfforts
         List validWorkEfforts = null;
         Collection partyIdsToUse = partyIds;
-        if (partyIdsToUse == null) partyIdsToUse = new HashSet();
-        
+        if (partyIdsToUse == null) {
+            partyIdsToUse = new HashSet();
+        }
         if (UtilValidate.isNotEmpty(partyId)) {
             if (partyId.equals(userLogin.getString("partyId")) || security.hasEntityPermission("WORKEFFORTMGR", "_VIEW", userLogin)) {
                 partyIdsToUse.add(partyId);
@@ -412,19 +413,52 @@
                 partyIdsToUse.add(userLogin.getString("partyId"));
             }
         }
-                
-        // Use the View Entity
-        if (partyIdsToUse.size() > 0 || UtilValidate.isNotEmpty(facilityId) || UtilValidate.isNotEmpty(fixedAssetId)) {
-            validWorkEfforts = getWorkEffortEvents(ctx, startStamp, endStamp, partyIdsToUse, facilityId, fixedAssetId);
+
+        List entityExprList = (List) context.get("entityExprList");
+        if (entityExprList == null) {
+            entityExprList = getDefaultWorkEffortExprList(partyIds, facilityId, fixedAssetId);
         }
+        entityExprList.add(new EntityExpr("estimatedCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, startStamp));
+        entityExprList.add(new EntityExpr("estimatedStartDate", EntityOperator.LESS_THAN, endStamp));
         if (filterOutCanceledEvents.booleanValue()) {
-         validWorkEfforts = EntityUtil.filterOutByCondition(validWorkEfforts, new EntityExpr("currentStatusId", EntityOperator.EQUALS, "EVENT_CANCELLED"));
+            entityExprList.add(new EntityExpr("currentStatusId", EntityOperator.NOT_EQUAL, "EVENT_CANCELLED"));
         }
-        
+
+        // Use the View Entity
+        if (partyIdsToUse.size() > 0 || UtilValidate.isNotEmpty(facilityId) || UtilValidate.isNotEmpty(fixedAssetId)) {
+            try {
+                List tempWorkEfforts = null;
+                if (partyIds != null && partyIds.size() > 0) {
+                    tempWorkEfforts = delegator.findByAnd("WorkEffortAndPartyAssign", entityExprList, UtilMisc.toList("estimatedStartDate"));
+                } else {
+                    tempWorkEfforts = delegator.findByAnd("WorkEffort", entityExprList, UtilMisc.toList("estimatedStartDate"));
+                }
+
+                // This block needs to be here to filter duplicate workeffort ids when
+                // more than one of the selected party ids is assigned to the WorkEffort
+
+                Set tempWeKeys = new HashSet();
+                Iterator tempWorkEffortIter = tempWorkEfforts.iterator();
+                while (tempWorkEffortIter.hasNext()) {
+                    GenericValue tempWorkEffort = (GenericValue) tempWorkEffortIter.next();
+                    String tempWorkEffortId = tempWorkEffort.getString("workEffortId");
+                    if (tempWeKeys.contains(tempWorkEffortId)) {
+                        tempWorkEffortIter.remove();
+                    } else {
+                        tempWeKeys.add(tempWorkEffortId);
+                    }
+                }
+
+                validWorkEfforts = new ArrayList(tempWorkEfforts);
+            } catch (GenericEntityException e) {
+                Debug.logWarning(e, module);
+            }
+        }
+
         // Split the WorkEffort list into a map with entries for each period, period start is the key
         List periods = new ArrayList();
         if (validWorkEfforts != null) {
-        
+
             // For each day in the set we check all work efforts to see if they fall within range
             for (int i = 0; i < numPeriods; i++) {
                 Timestamp curPeriodStart = UtilDateTime.adjustTimestamp(startStamp, periodType, i, timeZone, locale);
@@ -432,49 +466,55 @@
                 List curWorkEfforts = new ArrayList();
                 Map entry = new HashMap();
                 for (int j = 0; j < validWorkEfforts.size(); j++) {
-                    
+
                     GenericValue workEffort = (GenericValue) validWorkEfforts.get(j);
                     // Debug.log("Got workEffort: " + workEffort.toString(), module);
-            
+
                     Timestamp estimatedStartDate = workEffort.getTimestamp("estimatedStartDate");
                     Timestamp estimatedCompletionDate = workEffort.getTimestamp("estimatedCompletionDate");
-            
-                    if (estimatedStartDate == null || estimatedCompletionDate == null) continue;
-                    
+
+                    if (estimatedStartDate == null || estimatedCompletionDate == null)
+                        continue;
+
                     if (estimatedStartDate.compareTo(curPeriodEnd) < 0 && estimatedCompletionDate.compareTo(curPeriodStart) > 0) {
-                        //Debug.logInfo("Task start: "+estimatedStartDate+" Task end: "+estimatedCompletionDate+" Period start: "+curPeriodStart+" Period end: "+curPeriodEnd, module);
-                      
+                        // Debug.logInfo("Task start: "+estimatedStartDate+" Task end: "+estimatedCompletionDate+" Period start: "+curPeriodStart+" Period end: "+curPeriodEnd, module);
+
                         Map calEntry = new HashMap();
-                        calEntry.put("workEffort",workEffort);
-                                              
+                        calEntry.put("workEffort", workEffort);
+
                         long length = ((estimatedCompletionDate.after(endStamp) ? endStamp.getTime() : estimatedCompletionDate.getTime()) - (estimatedStartDate.before(startStamp) ? startStamp.getTime() : estimatedStartDate.getTime()));
-                        int periodSpan = (int) Math.ceil((double) length / periodLen);                                                
+                        int periodSpan = (int) Math.ceil((double) length / periodLen);
                         calEntry.put("periodSpan", new Integer(periodSpan));
 
-                        if(i == 0) calEntry.put("startOfPeriod", Boolean.TRUE); //If this is the first priod any valid entry is starting here
-                        else {
-                            boolean startOfPeriod = ((estimatedStartDate.getTime() - curPeriodStart.getTime()) >= 0);                            
+                        if (i == 0) {
+                            // If this is the first period any valid entry is starting here
+                            calEntry.put("startOfPeriod", Boolean.TRUE);
+                        } else {
+                            boolean startOfPeriod = ((estimatedStartDate.getTime() - curPeriodStart.getTime()) >= 0);
                             calEntry.put("startOfPeriod", new Boolean(startOfPeriod));
                         }
                         curWorkEfforts.add(calEntry);
                     }
-        
+
                     // if startDate is after hourEnd, continue to the next day, we haven't gotten to this one yet...
-                    if (estimatedStartDate.after(curPeriodEnd)) break;
-                    
+                    if (estimatedStartDate.after(curPeriodEnd))
+                        break;
+
                     // if completionDate is before the hourEnd, remove from list, we are done with it
                     if (estimatedCompletionDate.before(curPeriodEnd)) {
                         validWorkEfforts.remove(j);
                         j--;
                     }
                 }
-                //For calendar we want to include empty periods aswell
-                //if (curWorkEfforts.size() > 0)  
+                // For calendar we want to include empty periods as well
+                // if (curWorkEfforts.size() > 0)
                 int numEntries = curWorkEfforts.size();
-                if(numEntries > maxConcurrentEntries) maxConcurrentEntries = numEntries;
-                entry.put("start",curPeriodStart);
-                entry.put("end",curPeriodEnd);                
-                entry.put("calendarEntries",curWorkEfforts);
+                if (numEntries > maxConcurrentEntries) {
+                    maxConcurrentEntries = numEntries;
+                }
+                entry.put("start", curPeriodStart);
+                entry.put("end", curPeriodEnd);
+                entry.put("calendarEntries", curWorkEfforts);
                 periods.add(entry);
             }
         }

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl?rev=574662&r1=574661&r2=574662&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl Tue Sep 11 11:37:52 2007
@@ -21,9 +21,9 @@
   <div class="screenlet-title-bar">
     <ul>
       <h2>${start?date?string("EEEE")?cap_first} ${start?date?string.long}</h2>
-      <li><a href="<@ofbizUrl>day?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortNextDay}</a></li>
-      <li><a href="<@ofbizUrl>day?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.CommonToday}</a></li>
-      <li><a href="<@ofbizUrl>day?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortPreviousDay}</a></li>
+      <li><a href="<@ofbizUrl>day?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortNextDay}</a></li>
+      <li><a href="<@ofbizUrl>day?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonToday}</a></li>
+      <li><a href="<@ofbizUrl>day?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortPreviousDay}</a></li>
     </ul>
     <br class="clear"/>
   </div>
@@ -46,7 +46,7 @@
   <#list periods as period>              
   <tr>                  
     <td valign="top" nowrap width="1%" class="monthweekheader" height="36"><span class="monthweeknumber">${period.start?time?string.short}</span><br/>
-      <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a></td>
+      <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a></td>
     <#list period.calendarEntries as calEntry>
     <#if calEntry.startOfPeriod>
     <td class="calendarentry" rowspan="${calEntry.periodSpan}" colspan="1" width="${entryWidth?string("#")}%" valign="top">
@@ -59,7 +59,7 @@
     <#else>
       ${calEntry.workEffort.estimatedStartDate?time?string.short}-${calEntry.workEffort.estimatedCompletionDate?time?string.short}
     </#if>
-    <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;</td>
+    <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}${addlParam?if_exists}</a>&nbsp;</td>
     </#if>
     </#list>
     <#if period.calendarEntries?size < maxConcurrentEntries>

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl?rev=574662&r1=574661&r2=574662&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl Tue Sep 11 11:37:52 2007
@@ -21,9 +21,9 @@
   <div class="screenlet-title-bar">
     <ul>
       <h2>${start?date?string("MMMM yyyy")?cap_first}</h2>
-      <li><a href='<@ofbizUrl>month?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>'>${uiLabelMap.WorkEffortNextMonth}</a></li>
-      <li><a href='<@ofbizUrl>month?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>'>${uiLabelMap.WorkEffortThisMonth}</a></li>
-      <li><a href='<@ofbizUrl>month?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>'>${uiLabelMap.WorkEffortPreviousMonth}</a></li>
+      <li><a href='<@ofbizUrl>month?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortNextMonth}</a></li>
+      <li><a href='<@ofbizUrl>month?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortThisMonth}</a></li>
+      <li><a href='<@ofbizUrl>month?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortPreviousMonth}</a></li>
     </ul>
     <br class="clear"/>
   </div>
@@ -42,13 +42,13 @@
   <#assign indexMod7 = period_index % 7>
   <#if indexMod7 = 0>
   <tr class="bg">
-    <td valign="top" height="60" nowrap class="monthweekheader"><a href='<@ofbizUrl>week?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>' class="monthweeknumber">${uiLabelMap.CommonWeek} ${period.start?date?string("w")}</a></td>
+    <td valign="top" height="60" nowrap class="monthweekheader"><a href='<@ofbizUrl>week?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>' class="monthweeknumber">${uiLabelMap.CommonWeek} ${period.start?date?string("w")}</a></td>
   </#if>
     <td valign="top">
       <table width="100%" cellspacing="0" cellpadding="0" border="0">
         <tr>
-          <td nowrap class="monthdaynumber"><a href='<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>' class="monthdaynumber">${period.start?date?string("d")?cap_first}</a></td>
-          <td align="right"><a href='<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}</@ofbizUrl>' class="add">${uiLabelMap.CommonAddNew}</a>&nbsp;&nbsp;</td>
+          <td nowrap class="monthdaynumber"><a href='<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>' class="monthdaynumber">${period.start?date?string("d")?cap_first}</a></td>
+          <td align="right"><a href='<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>' class="add">${uiLabelMap.CommonAddNew}</a>&nbsp;&nbsp;</td>
         </tr>
       </table>
       <#list period.calendarEntries as calEntry>
@@ -65,7 +65,7 @@
               ${calEntry.workEffort.estimatedStartDate?time?string.short}-${calEntry.workEffort.estimatedCompletionDate?time?string.short}
             </#if>
             <br/>
-            <a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;
+            <a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;
           </td>
         </tr>
       </table>

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/upcoming.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/upcoming.ftl?rev=574662&r1=574661&r2=574662&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/upcoming.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/upcoming.ftl Tue Sep 11 11:37:52 2007
@@ -38,7 +38,7 @@
             <tr<#if alt_row> class="alternate-row"</#if>>
               <td>${workEffort.estimatedStartDate}</td>
               <td>${workEffort.estimatedStartDate}</td>
-              <td class="button-col"><a href="<@ofbizUrl>EditWorkEffort?workEffortId=${workEffort.workEffortId}</@ofbizUrl>">${workEffort.workEffortName}</a></td>
+              <td class="button-col"><a href="<@ofbizUrl>EditWorkEffort?workEffortId=${workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>">${workEffort.workEffortName}</a></td>
             </tr>
             <#assign alt_row = !alt_row>
           </#list>

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl?rev=574662&r1=574661&r2=574662&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl Tue Sep 11 11:37:52 2007
@@ -21,9 +21,9 @@
   <div class="screenlet-title-bar">
     <ul>
       <h2>${uiLabelMap.CommonWeek} ${start?date?string("w")}</h2>
-      <li><a href="<@ofbizUrl>week?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortNextWeek}</a></li>
-      <li><a href="<@ofbizUrl>week?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortThisWeek}</a></li>
-      <li><a href="<@ofbizUrl>week?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>">${uiLabelMap.WorkEffortPreviousWeek}</a></li>
+      <li><a href="<@ofbizUrl>week?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortNextWeek}</a></li>
+      <li><a href="<@ofbizUrl>week?start=${nowTimestamp.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortThisWeek}</a></li>
+      <li><a href="<@ofbizUrl>week?start=${prev.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortPreviousWeek}</a></li>
     </ul>
     <br class="clear"/>
   </div>
@@ -44,8 +44,8 @@
   </tr>
   <#list periods as period>
   <tr>
-    <td valign="top" nowrap width="1%" class="monthweekheader" height="36"><a href="<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if></@ofbizUrl>" class="monthweeknumber">${period.start?date?string("EEEE")?cap_first} ${period.start?date?string.short}</a><br/>
-      <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a>
+    <td valign="top" nowrap width="1%" class="monthweekheader" height="36"><a href="<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>" class="monthweeknumber">${period.start?date?string("EEEE")?cap_first} ${period.start?date?string.short}</a><br/>
+      <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a>
     </td>
     <#list period.calendarEntries as calEntry>
     <#if calEntry.startOfPeriod>
@@ -61,7 +61,7 @@
     <#else>
       ${calEntry.workEffort.estimatedStartDate?time?string.short}-${calEntry.workEffort.estimatedCompletionDate?time?string.short}
     </#if>
-      <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;</td>
+      <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;</td>
     </#if>
     </#list>
     <#if period.calendarEntries?size < maxConcurrentEntries>