svn commit: r607004 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.properties script/org/ofbiz/project/ProjectServices.xml webapp/projectmgr/WEB-INF/actions/ListProjects.bsh widget/forms/ProjectForms.xml

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

svn commit: r607004 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.properties script/org/ofbiz/project/ProjectServices.xml webapp/projectmgr/WEB-INF/actions/ListProjects.bsh widget/forms/ProjectForms.xml

hansbak-2
Author: hansbak
Date: Wed Dec 26 22:12:37 2007
New Revision: 607004

URL: http://svn.apache.org/viewvc?rev=607004&view=rev
Log:
improved the project find screens

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/ListProjects.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties?rev=607004&r1=607003&r2=607004&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Wed Dec 26 22:12:37 2007
@@ -96,6 +96,7 @@
 ProjectMgrPhaseList=List of project Phases
 ProjectMgrPhases=Phases
 ProjectMgrPhaseTaskList=List of Phases and Tasks
+ProjectMgrProjectId=Project Id
 ProjectMgrProjectName=Project Name
 ProjectMgrProjectSummary=Project Summary
 ProjectMgrProjectTeam=Project Team

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=607004&r1=607003&r2=607004&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Wed Dec 26 22:12:37 2007
@@ -378,6 +378,7 @@
         <set field="highInfo.projectName" from-field="project.workEffortName"/>
         <set field="highInfo.projectDescription" from-field="project.description"/>
         <set field="highInfo.scopeEnumId" from-field="project.scopeEnumId"/>
+        <set field="highInfo.createdStamp" from-field="project.createdStamp"/>
         <entity-one entity-name="StatusItem" value-name="highSeq">
             <field-map field-name="statusId" env-name="project.currentStatusId"/>
         </entity-one>

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh?rev=607004&r1=607003&r2=607004&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh Wed Dec 26 22:12:37 2007
@@ -29,9 +29,26 @@
 import org.ofbiz.entity.condition.*;
 import java.sql.Timestamp;
 
+
+EntityOperator checkCondition(String condition){
+      
+        switch (condition) {
+            case "equals": return EntityOperator.EQUALS; break;
+            case "like": return EntityOperator.LIKE; break;
+            case "contains": return EntityOperator.LIKE; break;
+            case "empty":  return EntityOperator.NOT; break;
+            case "notEqual": return EntityOperator.NOT_EQUAL; break;
+            default: return EntityOperator.EQUALS;break;
+        }
+}
+
 LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
 fromDate = parameters.get("fromDate");
 projectId = parameters.get("projectId"); // if provided only give subprojects of a certain main project
+projectName = parameters.get("projectName");
+
+projectId_op = parameters.get("projectId_op");
+projectName_op = parameters.get("projectName_op");
 
 conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
 
@@ -40,14 +57,30 @@
     }
 
 if (!UtilValidate.isEmpty(projectId)) {
-    conditions.add(new EntityExpr("workEffortParentId", EntityOperator.EQUALS, projectId));
+ if(!UtilValidate.isEmpty(projectId_op)){
+ if( projectId_op.equals("contains") || projectId_op.equals("like") ) {
+     conditions.add(new EntityExpr("workEffortId", EntityOperator.LIKE, "%"+projectId+"%"));
+     }else{
+     conditions.add(new EntityExpr("workEffortId", checkCondition(projectId_op), projectId));
+     }
     }
+}
 
+if (!UtilValidate.isEmpty(projectName)) {
+ if(!UtilValidate.isEmpty(projectName_op)) {
+ if( projectName_op.equals("contains") || projectName_op.equals("like") ) {
+ conditions.add(new EntityExpr("workEffortName", EntityOperator.LIKE, "%"+projectName+"%"));
+ }else{
+ conditions.add(new EntityExpr("workEffortName", checkCondition(projectName_op), projectName));
+ }
+ }
+}
+    
 allConditions = new EntityConditionList( conditions, EntityOperator.AND );
 orderBy = UtilMisc.toList("createdStamp DESC");
-
 projects = new LinkedList();
 listProjects = delegator.findByConditionCache("WorkEffort", allConditions, UtilMisc.toList("workEffortId"), orderBy);
+
 if (!UtilValidate.isEmpty(listProjects)) {
     itr = listProjects.iterator();
             while (itr.hasNext()) {
@@ -57,3 +90,6 @@
     }
     context.put("projects", projects);
 }
+
+
+

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=607004&r1=607003&r2=607004&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Wed Dec 26 22:12:37 2007
@@ -94,9 +94,10 @@
         <field name="roleTypeId"><hidden value="PROJECT_TEAM"/></field>
         <field name="addButton" ><submit/></field>
     </form>
-    <form name="FindProject" type="single" target="FindProject">
-        <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><date-time type="date"/></field>
-        <field name="projectName" parameter-name="workEffortName" title="${uiLabelMap.ProjectMgrProjectName}"><text/></field>
+    <form name="FindProject" type="single" target="FindProject" title="Find and List Project">
+        <field name="projectId" title="${uiLabelMap.ProjectMgrProjectId}"><text-find size="25"></text-find></field>
+        <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}"><text-find size="25"></text-find></field>
+        <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><date-time type="date"  /></field>
         <field name="find" title="${uiLabelMap.CommonFind}"><submit/></field>
     </form>
     <form name="hoursNotYetBilled" type="list" list-name="entryList">
@@ -109,17 +110,22 @@
         <field name="partyId"><display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName}"/></field>
         <field name="fromDate"><display type="date"/></field>
     </form>
-    <form name="ListProjects" type="list" list-name="projects" paginate-target="FindProject">
+    <form name="ListProjects" type="list" list-name="projects" paginate-target="FindProject">
+        <field name="projectId" title="${uiLabelMap.ProjectMgrWorkEffortId}"  widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${projectId}" target="projectView?projectId=${projectId}"/>
+        </field>
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}" widget-style="buttontext">
-            <hyperlink also-hidden="false" description="${projectName}" target="projectView?projectId=${projectId}"/>
-        </field>
-        <field name="statusDescription" title="${uiLabelMap.CommonStatus}"><display/></field>
+            <hyperlink also-hidden="false" description="${projectName}" target="projectView?projectId=${projectId}"/>
+        </field>
+        <field name="currentStatusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/></field>
         <field name="priority" title="${uiLabelMap.CommonPriority}"><display/></field>
-        <field name="startDate" title="${uiLabelMap.WorkEffortStartDate}"><display type="date"/></field>
-        <field name="completionDate" title="${uiLabelMap.WorkEffortCompletionDate}"><display type="date"/></field>
+        <field name="estimatedStartDate" title="${uiLabelMap.WorkEffortEstimatedStartDate}"><display type="date"/></field>
+        <field name="estimatedCompletionDate" title="${uiLabelMap.WorkEffortEstimatedCompletionDate}"><display type="date"/></field>
+        <field name="actualStartDate" title="${uiLabelMap.WorkEffortActualStartDate}"><display type="date"/></field>
+        <field name="actualCompletionDate" title="${uiLabelMap.WorkEffortActualCompletionDate}"><display type="date"/></field>
         <field name="plannedHours"><display/></field>
-        <field name="actualHours"><display/></field>
-        <field name="createdDate"><display type="date"/></field>
+        <field name="actualHours"><display/></field>
+        <field name="createdStamp"><display type="date"/></field>
     </form>                                        
     <form name="ProjectInfo" type="single" default-map-name="project" paginate-target="FindProject">
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}"><display/></field>