svn commit: r600282 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ script/org/ofbiz/project/ webapp/projectmgr/WEB-INF/actions/ widget/ widget/forms/

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

svn commit: r600282 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ script/org/ofbiz/project/ webapp/projectmgr/WEB-INF/actions/ widget/ widget/forms/

hansbak-2
Author: hansbak
Date: Sun Dec  2 05:13:33 2007
New Revision: 600282

URL: http://svn.apache.org/viewvc?rev=600282&view=rev
Log:
showing sub/parent projects everywhere properly

Added:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh   (with props)
Modified:
    ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
    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=600282&r1=600281&r2=600282&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Sun Dec  2 05:13:33 2007
@@ -70,6 +70,7 @@
 ProjectMgrNewSubTask=New Sub Task
 ProjectMgrNewTask=New Task
 ProjectMgrNotesCreateNew=Create New
+ProjectMgrParentProjectName=Parent Project Name
 ProjectMgrPartyList=List of Parties
 ProjectMgrProjectCurrent=Current Project
 ProjectMgrPhaseDetails=Enter the Phase Details below

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=600282&r1=600281&r2=600282&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  2 05:13:33 2007
@@ -40,7 +40,13 @@
         <set field="highInfo.sequenceId" from-field="highSeq.sequenceId"/>
         <set field="highInfo.statusDescription" from-field="highSeq.description"/>
         <set field="highInfo.createdDate" from-field="project.createdDate"/>
-        
+        <if-not-empty field-name="project.workEffortParentId">
+            <entity-one entity-name="WorkEffort" value-name="parentProject">
+                <field-map field-name="workEffortId" env-name="project.workEffortParentId"/>
+            </entity-one>
+            <set field="highInfo.parentProjectName" from-field="parentProject.workEffortName"/>
+            <set field="highInfo.parentProjectId" from-field="parentProject.workEffortId"/>
+        </if-not-empty>
         <!-- loop through the related phases and tasks -->
         <get-related value-name="project" relation-name="ChildWorkEffort" list-name="phases"/>
         <iterate entry-name="phase" list-name="phases">

Added: 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=600282&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh (added)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh Sun Dec  2 05:13:33 2007
@@ -0,0 +1,59 @@
+/*
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+  
+import java.util.*;
+import java.lang.*;
+import org.ofbiz.entity.*;
+import org.ofbiz.base.util.*;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.entity.util.*;
+import org.ofbiz.base.util.*;
+import org.ofbiz.entity.condition.*;
+import java.sql.Timestamp;
+
+LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
+fromDate = parameters.get("fromDate");
+projectId = parameters.get("projectId"); // if provided only give subprojects of a certain main project
+
+conditions = UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"));
+
+if (!UtilValidate.isEmpty(fromDate)) {
+    conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate + " 00:00:00.0"));
+    }
+
+if (!UtilValidate.isEmpty(projectId)) {
+    conditions.add(new EntityExpr("workEffortParentId", EntityOperator.EQUALS, projectId));
+    }
+
+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()) {
+                project = itr.next();
+                result = dispatcher.runSync("getProject", UtilMisc.toMap("userLogin", parameters.get("userLogin"), "projectId", project.getString("workEffortId")));
+                projects.add(result.get("projectInfo"));            
+    }
+    context.put("projects", projects);
+}

Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml?rev=600282&r1=600281&r2=600282&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml Sun Dec  2 05:13:33 2007
@@ -24,7 +24,7 @@
     
         <menu-item name="mytasks" title="${uiLabelMap.WorkEffortMyTasks}"><link target="MyTasks"/></menu-item>
         <menu-item name="mytime" title="${uiLabelMap.TimesheetMyTime}"><link target="MyTimesheets"/></menu-item>
-        <menu-item name="projects" title="${uiLabelMap.WorkEffortProjects}"><link target="FindProject?workEffortTypeId=PROJECT"/></menu-item>
+        <menu-item name="projects" title="${uiLabelMap.WorkEffortProjects}"><link target="FindProject"/></menu-item>
         <menu-item name="timesheet" title="${uiLabelMap.Timesheet}"><link target="FindTimeSheet?findAll=N"/></menu-item>
         <menu-item name="SkillType" title="${uiLabelMap.ProjectMgrSkillType}"><link target="findSkillTypes"/></menu-item>
         <menu-item name="calendar" title="${uiLabelMap.WorkEffortCalendar}"><link target="day"/></menu-item>
@@ -42,7 +42,7 @@
     <menu name="ProjectTabBar" type="simple" menu-container-style="button-bar tab-bar" default-selected-style="selected">
         <menu-item name="projectView" title="${uiLabelMap.ProjectMgrProjectSummary}"><link target="projectView?projectId=${parameters.projectId}"/></menu-item>
         <menu-item name="editproject" title="${uiLabelMap.ProjectMgrEditPoject}"><link target="EditProject?projectId=${parameters.projectId}"/></menu-item>
-        <menu-item name="phases" title="${uiLabelMap.ProjectMgrPhases}"><link target="FindPhase?projectId=${parameters.projectId}&amp;workEffortTypeId=PHASE&amp;workEffortAssocTypeId=WORK_EFF_BREAKDOWN"/></menu-item>
+        <menu-item name="phases" title="${uiLabelMap.ProjectMgrPhases}"><link target="FindPhase?projectId=${parameters.projectId}"/></menu-item>
         <menu-item name="tasks" title="${uiLabelMap.ProjectMgrTasks}"><link target="FindTask?projectId=${parameters.projectId}"/></menu-item>        
         <menu-item name="parties" title="${uiLabelMap.ProjectMgrParties}"><link target="ListWorkEffortPartyAssigns?projectId=${parameters.projectId}"/></menu-item>
         <menu-item name="notes" title="${uiLabelMap.CommonNotes}"><link target="EditWorkEffortNotes?projectId=${parameters.projectId}"/></menu-item>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=600282&r1=600281&r2=600282&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml Sun Dec  2 05:13:33 2007
@@ -26,21 +26,20 @@
                 <set field="titleProperty" value="PageTitleFindProject"/>
                 <set field="tabButtonItem" value="subprojects"/>
                 <set field="labelTitleProperty" value="ProjectMgrProjectName"/>
-                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="/workeffort/control/FindProject"/>
                 <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/>
-                <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh"/>
+                <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh"/>
             </actions>                                                
             <widgets>  
                 <decorator-screen name="CommonProjectDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">                                                                                                                
                         <container style="screenlet">
-                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditSubProject}</label></container>
+                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleListSubProjects}</label></container>
                             <container style="screenlet-body">
                                 <include-form name="ListProjects" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
                             </container>        
                         </container>    
                         <container style="screenlet">
-                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditSubProject}</label></container>
+                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleAddSubProject}</label></container>
                             <container style="screenlet-body">
                                 <include-form name="AddSubProject" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
                             </container>        
@@ -57,7 +56,7 @@
                 <set field="labelTitleProperty" value="ProjectMgrProjectName"/>
                 <set field="donePage" from-field="parameters.DONE_PAGE" default-value="/workeffort/control/FindProject"/>
                 <set field="workEffortId" from-field="parameters.projectId"/>
-                <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh"/>
+                <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh"/>
             </actions>                                                
             <widgets>  
                 <decorator-screen name="CommonProjectDecorator" location="${parameters.mainDecoratorLocation}">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=600282&r1=600281&r2=600282&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Sun Dec  2 05:13:33 2007
@@ -21,27 +21,14 @@
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
     <form name="EditProject" type="single" target="updateProject" default-map-name="project">
         <alt-target use-when="project==null" target="createProject"/>
-        <field name="projectId"><hidden value="${parameters.projectId}"/></field>
-        <field name="DONE_PAGE"><hidden value="${donePage}"/></field>
         <field name="workEffortTypeId"><hidden value="PROJECT"/></field>
-        <field name="projectId" parameter-name="workEffortId"><hidden/></field>
+        <field name="projectId"><hidden/></field>
+        <field name="workEffortId"><hidden value="${projectId}"/></field>
         <field name="projectName" parameter-name="workEffortName" title="${uiLabelMap.ProjectMgrProjectName}*"><text/></field>
         <field name="projectDescription" parameter-name="description" title="${uiLabelMap.CommonDescription}"><text/></field>
         <field use-when="project!=null" name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
         <field use-when="project==null" name="statusId" parameter-name="currentStatusId"><hidden value="CAL_ACCEPTED"/></field>
-        <field name="priority" title="${uiLabelMap.CommonPriority}">
-            <drop-down allow-empty="true" current="selected">
-                <option key="1" description="1 (${uiLabelMap.WorkEffortPriorityHigh})"/>
-                <option key="2" description="2"/>
-                <option key="3" description="3"/>
-                <option key="4" description="4"/>
-                <option key="5" description="5"/>
-                <option key="6" description="6"/>
-                <option key="7" description="7"/>
-                <option key="8" description="8"/>
-                <option key="9" description="9 (${uiLabelMap.WorkEffortPriorityLow})"/>
-            </drop-down>
-        </field>
+        <field name="priority" title="${uiLabelMap.CommonPriority}"><display/></field>
         <field name="scopeEnumId" title="${uiLabelMap.ProjectMgrWorkEffortScopeEnumId}">
             <drop-down allow-empty="false">
                 <entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId">
@@ -49,6 +36,14 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="parentProjectName" parameter-name="workEffortParentId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="WorkEffort" description="${workEffortName}" key-field-name="workEffortId">
+                    <entity-constraint name="workEffortTypeId" value="PROJECT"/>
+                    <entity-constraint name="workEffortId" operator="not-equals" env-name="projectId"/>                    
+                </entity-options>
+            </drop-down>
+        </field>
         <field use-when="project!=null" name="estimatedStartDate" title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display description="${bsh:project.get(&quot;estimatedStartDate&quot;)!=null?project.get(&quot;estimatedStartDate&quot;).toString().substring(0,10):&quot;&quot;;}"/></field>
         <field use-when="project!=null" name="estimatedCompletionDate" title="${uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display description="${bsh:project.get(&quot;estimatedCompletionDate&quot;)!=null?project.get(&quot;estimatedCompletionDate&quot;).toString().substring(0,10):&quot;&quot;;}"/></field>
         <field use-when="project!=null" name="actualStartDate" title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display description="${bsh:project.get(&quot;actualStartDate&quot;)!=null?project.get(&quot;actualStartDate&quot;).toString().substring(0,10):&quot;&quot;;}"/></field>
@@ -56,18 +51,19 @@
         <field name="save" title="${uiLabelMap.CommonSave}"><submit/></field>
     </form>
     <form name="AddSubProject" type="single" target="AddSubProject">
-        <field name="workEffortParentId"><hidden value="${parameters.projectId}"/></field>
+        <field name="workEffortParentId"><hidden value="${projectId}"/></field>
+        <field name="projectId"><hidden/></field>
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrProjectName}">
             <drop-down>
                 <entity-options entity-name="WorkEffort" description="${workEffortName}">
                     <entity-constraint name="workEffortTypeId" value="PROJECT"/>
-                    <entity-constraint name="workEffortId" operator="not-equals" env-name="parameters.projectId"/>                    
+                    <entity-constraint name="workEffortId" operator="not-equals" env-name="projectId"/>                    
                 </entity-options>
             </drop-down>
         </field>
         <field name="add"><submit/></field>
     </form>
-    <form name="FindProject" type="single" target="FindProjectByRange">
+    <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>
         <field name="find" title="${uiLabelMap.CommonFind}"><submit/></field>
@@ -77,7 +73,7 @@
             <hyperlink also-hidden="false" description="${projectName}" target="projectView?projectId=${projectId}"/>
         </field>
         <field name="statusDescription" title="${uiLabelMap.CommonStatus}"><display/></field>
-        <field name="priority" title="${uiLabelMap.CommonPriority}"><display type="date"/></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="plannedHours"><display/></field>
@@ -87,7 +83,8 @@
     <form name="ProjectInfo" type="single" default-map-name="project" paginate-target="FindProject">
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}"><display/></field>
         <field name="statusDescription" title="${uiLabelMap.CommonStatus}"><display/></field>
-        <field name="priority" title="${uiLabelMap.CommonPriority}"><display type="date"/></field>
+        <field name="priority" title="${uiLabelMap.CommonPriority}"><display/></field>
+        <field name="parentProjectName" title="${uiLabelMap.ProjectMgrParentProjectName}"><hyperlink target="projectView?projectId=${project.parentProjectId}" description="${project.parentProjectName}"/></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>