svn commit: r688237 - in /ofbiz/trunk/specialpurpose/projectmgr: src/org/ofbiz/project/Various.java webapp/projectmgr/WEB-INF/controller.xml widget/RequestScreens.xml widget/forms/RequestForms.xml 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: r688237 - in /ofbiz/trunk/specialpurpose/projectmgr: src/org/ofbiz/project/Various.java webapp/projectmgr/WEB-INF/controller.xml widget/RequestScreens.xml widget/forms/RequestForms.xml widget/forms/TimeSheetForms.xml

hansbak-2
Author: hansbak
Date: Fri Aug 22 18:09:32 2008
New Revision: 688237

URL: http://svn.apache.org/viewvc?rev=688237&view=rev
Log:
 add total registered time on timesheet list, add some orderby statements

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java?rev=688237&r1=688236&r2=688237&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java Fri Aug 22 18:09:32 2008
@@ -85,5 +85,26 @@
      return UtilDateTime.addDaysToTimestamp(startDate, plannedHours / 8);
     }
     
-    
+    public static double calculateActualHours(GenericDelegator delegator, String timesheetId) {
+ List actuals = FastList.newInstance();
+ double actualHours = 0.00;
+ if(timesheetId != null){
+ try {
+ actuals = delegator.findByAnd("TimeEntry", UtilMisc.toMap("timesheetId", timesheetId));
+ if(actuals.size() > 0){
+ Iterator ite = actuals.iterator();
+ while(ite.hasNext()){
+ GenericValue actual =(GenericValue)ite.next();
+ Double hour = (Double) actual.get("hours");
+ double hours = hour.doubleValue();
+ actualHours = actualHours + hours;
+ }
+ }
+ } catch (GenericEntityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return actualHours;
+    }
 }

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml?rev=688237&r1=688236&r2=688237&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Fri Aug 22 18:09:32 2008
@@ -219,7 +219,7 @@
     <request-map uri="updateTask">
         <security https="true" auth="true"/>
         <event type="service" invoke="updateWorkEffort"/>
-        <response name="success" type="view" value="EditTask"/>
+        <response name="success" type="view" value="TaskView"/>
         <response name="error" type="view" value="EditTask"/>
     </request-map>
     <request-map uri="addDependency">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml?rev=688237&r1=688236&r2=688237&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml Fri Aug 22 18:09:32 2008
@@ -28,7 +28,7 @@
                 <set field="headerItem" value="request"/>
                 <entity-and list-name="custRequests" entity-name="CustRequest">
                     <field-map field-name="statusId" value="CRQ_ACCEPTED"/>
-                    <order-by field-name="-lastModifiedDate"/>
+                    <order-by field-name="lastModifiedDate"/>
                 </entity-and>
             </actions>
             <widgets>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml?rev=688237&r1=688236&r2=688237&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml Fri Aug 22 18:09:32 2008
@@ -119,6 +119,7 @@
         <actions>
             <entity-and entity-name="WorkEffortCustRequestView" list-name="requests">
                 <field-map field-name="statusId" value="CRQ_REVIEWED"/>
+                <order-by field-name="createdDate"/>
             </entity-and>
         </actions>
         <row-actions>
@@ -148,7 +149,6 @@
         <field name="statusId">
             <display-entity also-hidden="false" entity-name="StatusItem"/>
         </field>
-        <field name="description"><display/></field>
     </form>
     <form name="ViewRequestWorkEfforts" extends="ViewRequestWorkEfforts" extends-resource="component://order/webapp/ordermgr/request/RequestForms.xml">
         <field name="workEffortId">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml?rev=688237&r1=688236&r2=688237&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Fri Aug 22 18:09:32 2008
@@ -68,7 +68,7 @@
         <field name="comments" title="${uiLabelMap.CommonComments}"><display/></field>
         <field name="completeLink" title="${uiLabelMap.CommonStatustoComplete}" widget-style="buttontext">
             <hyperlink target="${my}StatusToComplete?timesheetId=${timesheetId}&amp;statusId=TIMESHEET_COMPLETED"
-                description="${bsh:statusId.equals(&quot;TIMESHEET_IN_PROCESS&quot;)?&quot;${uiLabelMap.CommonStatustoComplete}&quot;:&quot;&quot;}" also-hidden="false"/>
+                description="${bsh:statusId.equals(&quot;TIMESHEET_IN_PROCESS&quot;)?&quot;To Complete&quot;:&quot;&quot;}" also-hidden="false"/>
         </field>
     </form>
     <form name="FindTimeSheet" target="FindTimeSheet" title="" type="single"
@@ -109,10 +109,11 @@
             <hyperlink also-hidden="false" description="${timesheetId}" target="Timesheet?timesheetId=${timesheetId}"/>
         </field>
         <field name="partyId" title="${uiLabelMap.PartyParty}"><display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName} ${groupName}"/></field>
+        <field name="actualHours" title="${uiLabelMap.ProjectMgrActualHours}"><display description="${bsh: org.ofbiz.project.Various.calculateActualHours(delegator, timesheetId);}"/></field>
         <field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" description="${description}"/></field>
         <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display type="date"/></field>
         <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display type="date"/></field>
-        <field name="comments" title="${uiLabelMap.CommonComments}"><display/></field>
+        <!--field name="comments" title="${uiLabelMap.CommonComments}"><display/></field-->
         <field name="completeLink" title="${uiLabelMap.CommonStatustoComplete}" widget-style="buttontext">
             <hyperlink target="TimesheetToComplete?timesheetId=${timesheetId}&amp;statusId=TIMESHEET_COMPLETED"
                 description="${bsh:statusId.equals(&quot;TIMESHEET_IN_PROCESS&quot;)?&quot;To complete&quot;:&quot;&quot;}" also-hidden="false"/>