ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hans...@apache.org
Subject svn commit: r609923 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.properties script/org/ofbiz/project/ProjectServices.xml webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh widget/TimeSheetScreens.xml
Date Tue, 08 Jan 2008 10:29:43 GMT
Author: hansbak
Date: Tue Jan  8 02:29:43 2008
New Revision: 609923

URL: http://svn.apache.org/viewvc?rev=609923&view=rev
Log:
In the timesheet entry different rateTypes on the same task accepted now

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
    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/TimeSheetScreens.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties?rev=609923&r1=609922&r2=609923&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Tue Jan  8
02:29:43 2008
@@ -38,7 +38,8 @@
 PageTitleAddTimeEntry=Add Time Entry
 PageTitleDependencies=Task dependencies
 PageTitleEditCurrentTimesheet=Edit current timesheet
-PageTitleCurrentTimesheet=Current timesheet
+PageTitleCurrentTimesheet=Current Timesheet
+PageTitleTimesheet=Timesheet
 PageTitleEditProject=Edit Project
 PageTitleProjectGanttChart=Project Gantt Chart
 PageTitleEditPhase=Edit Phase

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=609923&r1=609922&r2=609923&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Tue
Jan  8 02:29:43 2008
@@ -242,26 +242,28 @@
         <if-not-empty field-name="timeEntries">
             <iterate entry-name="timeEntry" list-name="timeEntries">
                 <if-compare-field field-name="timeEntry.workEffortId" operator="equals"
to-field-name="parameters.workEffortId">
-                    <!-- check if the entry does not contain any hours, then delete -->
-                    <if-empty field-name="timeEntry.hours">
-                        <remove-value value-name="timeEntry"/> 
-                        <else>
-                            <!-- translate the date into the daynumber -->
-                            <call-class-method class-name="org.ofbiz.base.util.UtilDateTime"
method-name="getIntervalInDays" ret-field-name="dayNumber">
-                                <field field-name="timesheet.fromDate" type="java.sql.Timestamp"/>
-                                <field field-name="timeEntry.fromDate" type="java.sql.Timestamp"/>
-                            </call-class-method>
-                            <!-- get the related field -->
-                            <if-not-empty field-name="parameters.hoursDay${dayNumber}">
-                                <set field="hours" from-field="parameters.hoursDay${dayNumber}"/>
-                                <else>
-                                    <set field="hours" value="0"/>
-                                </else>
-                            </if-not-empty>
-                            <set field="parameters.hoursDay${dayNumber}" value="-1"/>
-                            <call-simple-method method-name="updateTimeEntry"/>   
                    
-                        </else>
-                    </if-empty>
+                    <if-compare-field field-name="timeEntry.rateTypeId" operator="equals"
to-field-name="parameters.rateTypeId">
+                        <!-- check if the entry does not contain any hours, then delete
-->
+                        <if-empty field-name="timeEntry.hours">
+                            <remove-value value-name="timeEntry"/> 
+                            <else>
+                                <!-- translate the date into the daynumber -->
+                                <call-class-method class-name="org.ofbiz.base.util.UtilDateTime"
method-name="getIntervalInDays" ret-field-name="dayNumber">
+                                    <field field-name="timesheet.fromDate" type="java.sql.Timestamp"/>
+                                    <field field-name="timeEntry.fromDate" type="java.sql.Timestamp"/>
+                                </call-class-method>
+                                <!-- get the related field -->
+                                <if-not-empty field-name="parameters.hoursDay${dayNumber}">
+                                    <set field="hours" from-field="parameters.hoursDay${dayNumber}"/>
+                                    <else>
+                                        <set field="hours" value="0"/>
+                                    </else>
+                                </if-not-empty>
+                                <call-simple-method method-name="updateTimeEntry"/>
                       
+                                <set field="parameters.hoursDay${dayNumber}" value="-999999"/>
+                            </else>
+                        </if-empty>
+                    </if-compare-field>
                 </if-compare-field>
             </iterate>
         </if-not-empty>
@@ -269,18 +271,17 @@
         <!-- process not yet done fields -->
         <loop count="7" field="dayNr">
             <if-not-empty field-name="parameters.hoursDay${dayNr}">
-                <set field="hours" from-field="parameters.hoursDay${dayNr}"/>
-                <else>
-                    <set field="hours" value="0"/>
-                </else>
+                <if-compare field-name="parameters.hoursDay${dayNr}" value="-999999" operator="not-equals">
+                    <set field="hours" from-field="parameters.hoursDay${dayNr}"/>
+                    <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="addDaysToTimestamp"
ret-field-name="fromDate">
+                        <field field-name="timesheet.fromDate" type="java.sql.Timestamp"/>
+                        <field field-name="dayNr" type="int"/>
+                    </call-class-method>
+                    <call-simple-method method-name="updateTimeEntry"/>           
            
+                </if-compare>
             </if-not-empty>
-            <set field="hours" from-field="parameters.hoursDay${dayNr}"/>
-            <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="addDaysToTimestamp"
ret-field-name="fromDate">
-                <field field-name="timesheet.fromDate" type="java.sql.Timestamp"/>
-                <field field-name="dayNr" type="int"/>
-            </call-class-method>
-            <call-simple-method method-name="updateTimeEntry"/>                   
    
         </loop>
+        <!-- update the assignment status -->
         <if-compare field-name="parameters.checkComplete" value="Y" operator="equals">
             <entity-one entity-name="WorkEffortPartyAssignment" value-name="alreadyAssign"/>
             <if-compare field-name="alreadyAssign.statusId" value="PAS_COMPLETED" operator="not-equals">
@@ -908,7 +909,6 @@
             <else>
                 <if-compare field-name="hours" operator="not-equals" value="0">
                     <set-service-fields service-name="createTimeEntry" map-name="parameters"
to-map-name="teCreMap"/>
-                    <set field="teCreMap.rateTypeId" from-field="parameters.rateTypeId"/>
                     <set field="teCreMap.hours" from-field="hours"/>
                     <set field="teCreMap.fromDate" from-field="fromDate"/>
                     <call-service service-name="createTimeEntry" in-map-name="teCreMap"/>

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=609923&r1=609922&r2=609923&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
Tue Jan  8 02:29:43 2008
@@ -142,11 +142,6 @@
 	} 
     timeEntry = te.next();
     
-    // set the rate type to default if missing
-	if (timeEntry.getString("rateTypeId") == null) {
-		timeEntry.put("rateTypeId", context.get("defaultRateTypeId"));
-	}    
-	Debug.logInfo("bsh: workeffort:" + timeEntry.getString("workEffortId") + " ratetype: " +
timeEntry.getString("rateTypeId"), "" ); 
     if (lastTimeEntry != null && 
     	(!lastTimeEntry.getString("workEffortId").equals(timeEntry.getString("workEffortId"))
|| 
     	!lastTimeEntry.getString("rateTypeId").equals(timeEntry.getString("rateTypeId")))) {
@@ -167,10 +162,9 @@
         taskTotal += hours;
     }
     entry.put("rateTypeId", timeEntry.get("rateTypeId"));
-    lastWorkEffortId = timeEntry.getString("workEffortId");
 }
 
-if (lastTimeEntry != null) {
+if (timeEntry != null) {
 	lastTimeEntry = timeEntry;
    	retrieveWorkEffortData();
     }
@@ -183,7 +177,7 @@
 }
 
 // add the totals line if at least one entry
-if (lastTimeEntry != null) {
+if (timeEntry != null) {
     entry = UtilMisc.toMap("timesheetId", timesheet.get("timesheetId"));
     entry.put("0", day0Total);
     entry.put("1", day1Total);

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml?rev=609923&r1=609922&r2=609923&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml Tue Jan  8 02:29:43
2008
@@ -64,7 +64,7 @@
                 <decorator-screen name="CommonTimesheetDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">                               
                  
                         <container style="screenlet">
-                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditCurrentTimesheet}
# ${timesheet.timesheetId} week: ${weekNumber}</label></container>           
                    
+                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleTimesheet}
# ${timesheet.timesheetId} week: ${weekNumber} ${uiLabelMap.CommonFrom} ${bsh:timesheet.get(&quot;fromDate&quot;).toString().substring(0,10)}
${uiLabelMap.CommonTo} ${bsh:timesheet.get(&quot;thruDate&quot;).toString().substring(0,10)}</label></container>
                               
                             <container style="screenlet-body"> 
                                 <section>
                                     <condition>
@@ -154,13 +154,13 @@
                 <set field="tabButtonItem" value="edittimesheet"/>
                 <set field="labelTitleProperty" value="PageTitleAddTimesheet"/>
                 <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh"/>
-                <set field="my" value="My"/><!-- change link in list -->
+                <set field="my" value="My"/><!-- change link and target -->
             </actions>
             <widgets>
                 <decorator-screen name="CommonMyTimeDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">                               
                  
                         <container style="screenlet">
-                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleCurrentTimesheet}
# ${timesheet.timesheetId} week: ${weekNumber}</label></container>           
                    
+                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleCurrentTimesheet}
# ${timesheet.timesheetId} week: ${weekNumber} ${uiLabelMap.CommonFrom} ${bsh:timesheet.get(&quot;fromDate&quot;).toString().substring(0,10)}
${uiLabelMap.CommonTo} ${bsh:timesheet.get(&quot;thruDate&quot;).toString().substring(0,10)}</label></container>
                               
                             <container style="screenlet-body"> 
                                 <section>
                                     <condition>



Mime
View raw message