svn commit: r606662 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh widget/forms/TimeSheetForms.xml

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

svn commit: r606662 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh widget/forms/TimeSheetForms.xml

hansbak-2
Author: hansbak
Date: Sun Dec 23 20:25:06 2007
New Revision: 606662

URL: http://svn.apache.org/viewvc?rev=606662&view=rev
Log:
set actual start date when time is registered, remove NPE from bsh, add subhyperlink on timesheet

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml?rev=606662&r1=606661&r2=606662&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Sun Dec 23 20:25:06 2007
@@ -21,6 +21,8 @@
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
     
+    <simple-method method-name="" short-description=""></simple-method>
+    
     <simple-method method-name="scheduleProject" short-description="Project Scheduler sets the planningdates according task requirements and available resources">
         <!--
                 theory behind the program
@@ -162,6 +164,13 @@
             <set field="addAssign.roleTypeId" from-field="projectAssign.roleTypeId"/>
             <set field="addAssign.statusId" value="PAS_ASSIGNED" />
             <call-service service-name="assignPartyToWorkEffort" in-map-name="addAssign"/>
+        </if-empty>
+        
+        <!-- check if the actual start date is set, when not set it to todays date -->
+        <if-empty field-name="project.actualStartDate">
+            <now-date-to-env env-name="updTask.actualStartDate"/>
+            <set field="updTask.workEffortId" from-field="parameters.workEffortId"/>
+            <call-service service-name="updateWorkEffort" in-map-name="updTask"/>
         </if-empty>
         
         <get-related value-name="timesheet" relation-name="TimeEntry" list-name="timeEntries"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh?rev=606662&r1=606661&r2=606662&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh Sun Dec 23 20:25:06 2007
@@ -72,16 +72,19 @@
     if (lastWorkEffortId != null && !lastWorkEffortId.equals(timeEntry.getString("workEffortId"))) {
         entry.put("total", taskTotal);
         // get the planned number of hours
-        plannedHours = timeEntry.getRelatedOne("WorkEffort").getRelated("WorkEffortSkillStandard");
-        ph = plannedHours.iterator();
-        pHours = 0.00;
-        while(ph.hasNext()) {
-            plannedHour = ph.next();
-            if (plannedHour.get("estimatedDuration") != null) {
-                pHours += plannedHour.get("estimatedDuration");
-            }
+        entryWorkEffort = timeEntry.getRelatedOne("WorkEffort");
+        if (entryWorkEffort != null) {
+         plannedHours = entryWorkEffort.getRelated("WorkEffortSkillStandard");
+        ph = plannedHours.iterator();
+        pHours = 0.00;
+        while(ph.hasNext()) {
+            plannedHour = ph.next();
+            if (plannedHour.get("estimatedDuration") != null) {
+                pHours += plannedHour.get("estimatedDuration");
+            }
+        }
+        entry.put("plannedHours", pHours);
         }
-        entry.put("plannedHours", pHours);
         entries.add(entry);
         taskTotal = 0.00;
         entry = UtilMisc.toMap("timesheetId", timesheet.get("timesheetId"));

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml?rev=606662&r1=606661&r2=606662&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Sun Dec 23 20:25:06 2007
@@ -29,7 +29,8 @@
                     <entity-order-by field-name="projectName"/>
                     <entity-order-by field-name="phaseName"/>
                     <entity-order-by field-name="workEffortName"/>
-                </entity-options>
+                </entity-options>
+                <sub-hyperlink target="taskView?workEffortId=${workEffortId}" link-style="buttontext" description="${workEffortId}"/>
             </drop-down>
         </field>
         <field name="0" parameter-name="hoursDay0" title="Sun"><text size="5"/></field>