svn commit: r596544 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh widget/forms/ProjectForms.xml widget/forms/TaskForms.xml

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

svn commit: r596544 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh widget/forms/ProjectForms.xml widget/forms/TaskForms.xml

hansbak-2
Author: hansbak
Date: Mon Nov 19 21:35:27 2007
New Revision: 596544

URL: http://svn.apache.org/viewvc?rev=596544&view=rev
Log:
add the createdTimestamp to the task/project list and made the date selection work

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh?rev=596544&r1=596543&r2=596544&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh Mon Nov 19 21:35:27 2007
@@ -39,10 +39,14 @@
     findAll = "N";
 }
 if(workEffortTypeId.equals("PROJECT")) {
-    if ( !(UtilValidate.isEmpty(fromDate) || UtilValidate.isEmpty(thruDate))) {
+    if ( !UtilValidate.isEmpty(fromDate) || !UtilValidate.isEmpty(thruDate)) {
         conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
-        conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
-        conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
+        if (!UtilValidate.isEmpty(fromDate)) {
+            conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
+            }
+        if (!UtilValidate.isEmpty(thruDate)) {
+            conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
+            }
         allConditions = new EntityConditionList( conditions, EntityOperator.AND );
         orderBy = UtilMisc.toList("createdStamp DESC");
         listProjects = delegator.findByConditionCache("WorkEffort", allConditions, null, orderBy );
@@ -56,10 +60,11 @@
                 projects.add(UtilMisc.toMap("workEffortId", project.getString("workEffortId"),
                                          "workEffortName", project.getString("workEffortName"),  
                                          "workEffortTypeId", project.getString("workEffortTypeId"),
+                                         "createdStamp", project.getTimestamp("createdStamp").toString().substring(0,10),
                                          "workEffortPurposeTypeId", project.getString("workEffortPurposeTypeId")));
-                context.put("projects", projects);        
             }
         }
+        context.put("projects", projects);        
      } else {
          if (findAll.equals("Y") ){
              List listProjects = delegator.findByAnd("WorkEffort", UtilMisc.toMap("workEffortTypeId", workEffortTypeId));
@@ -73,21 +78,26 @@
                      projects.add(UtilMisc.toMap("workEffortId", project.getString("workEffortId"),
                                               "workEffortName", project.getString("workEffortName"),  
                                               "workEffortTypeId", project.getString("workEffortTypeId"),
+                                              "createdStamp", project.getTimestamp("createdStamp").toString().substring(0,10),
                                               "workEffortPurposeTypeId", project.getString("workEffortPurposeTypeId")));
-                     context.put("projects", projects);        
                  }
              }
+             context.put("projects", projects);        
          } else {
              List projects=null;
              context.put("projects", projects);
          }
     }
 } else {
-    if ( !(UtilValidate.isEmpty(fromDate) || UtilValidate.isEmpty(thruDate))) {
+    if ( !UtilValidate.isEmpty(fromDate) || !UtilValidate.isEmpty(thruDate)) {
 
         conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK"));
-        conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
-        conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
+        if (!UtilValidate.isEmpty(fromDate)) {
+            conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate ));
+            }
+        if (!UtilValidate.isEmpty(thruDate)) {
+            conditions.add(new EntityExpr("createdStamp", EntityOperator.LESS_THAN_EQUAL_TO, thruDate ));
+            }
 
         allConditions = new EntityConditionList( conditions, EntityOperator.AND );
         orderBy = UtilMisc.toList("createdStamp DESC");
@@ -99,13 +109,14 @@
             workEffortId = task.get("workEffortId");    
             GenericValue workEffortAssoc = EntityUtil.getFirst(delegator.findByAnd("WorkEffortAssoc", UtilMisc.toMap("workEffortIdTo", workEffortId)));
             if (workEffortAssoc == null) {
-            unAssignedTasks.add(UtilMisc.toMap("workEffortId", task.getString("workEffortId"),
+                unAssignedTasks.add(UtilMisc.toMap("workEffortId", task.getString("workEffortId"),
                                                  "workEffortName", task.getString("workEffortName"),  
                                                  "workEffortTypeId", task.getString("workEffortTypeId"),
+                                                 "createdStamp", task.getTimestamp("createdStamp").toString().substring(0,10),
                                                  "workEffortPurposeTypeId", task.getString("workEffortPurposeTypeId")));
-                context.put("tasks", unAssignedTasks);        
             }
         }
+        context.put("tasks", unAssignedTasks);        
     } else {        
         if (findAll.equals("Y") ){
         List tasks = delegator.findByAnd("WorkEffort", UtilMisc.toMap("workEffortTypeId", workEffortTypeId));
@@ -119,9 +130,10 @@
             unAssignedTasks.add(UtilMisc.toMap("workEffortId", task.getString("workEffortId"),
                                                  "workEffortName", task.getString("workEffortName"),  
                                                  "workEffortTypeId", task.getString("workEffortTypeId"),
+                                                 "createdStamp", task.getTimestamp("createdStamp").toString().substring(0,10),
                                                  "workEffortPurposeTypeId", task.getString("workEffortPurposeTypeId")));
-                context.put("tasks", unAssignedTasks);        
             }
+            context.put("tasks", unAssignedTasks);        
         }        
     } else {
         List unAssignedTasks=null;

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=596544&r1=596543&r2=596544&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Mon Nov 19 21:35:27 2007
@@ -31,6 +31,7 @@
         <!--field name="projectView" title="${uiLabelMap.ProjectMgrProjectSummary}" widget-style="linktext">
             <hyperlink also-hidden="false" description="${uiLabelMap.ProjectMgrProjectSummary}" target="projectView?workEffortId=${workEffortId}"/>
         </field-->
+        <field name="createdStamp"><display/></field>
         <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="linktext">
             <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteProject?workEffortId=${workEffortId}"/>
         </field>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=596544&r1=596543&r2=596544&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Mon Nov 19 21:35:27 2007
@@ -98,7 +98,7 @@
         </field>
         <field name="workEffortName" title="${uiLabelMap.CommonName}"><display/></field>
         <field name="workEffortTypeId" title="${uiLabelMap.ProjectMgrWorkEffortTypeId}"><display-entity entity-name="WorkEffortType"/></field>
-        <field name="workEffortPurposeTypeId" title="${uiLabelMap.ProjectMgrWorkEffortPurposeTypeId}"><display-entity entity-name="WorkEffortPurposeType"/></field>        
+        <field name="createdStamp"><display/></field>
         <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="linktext">
             <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteTask?workEffortId=${workEffortId}"/>
         </field>