Author: hansbak
Date: Wed Nov 28 20:20:20 2007 New Revision: 599260 URL: http://svn.apache.org/viewvc?rev=599260&view=rev Log: corrected the subproject list everywhere Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh (with props) Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.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=599260&r1=599259&r2=599260&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original) +++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Wed Nov 28 20:20:20 2007 @@ -84,7 +84,7 @@ ProjectMgrSubProjects=Sub Projects ProjectMgrSubTaskName=Sub Task Name ProjectMgrSubProjectDetails=Enter the SubProject Details below -ProjectMgrSubProjectList=List of SubProject +ProjectMgrSubProjectList=List of SubProjects ProjectMgrSubTasks=Sub Tasks ProjectMgrTaskCurrent=Current Task ProjectMgrTaskDetails=Enter the Task Details below Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh?rev=599260&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh (added) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh Wed Nov 28 20:20:20 2007 @@ -0,0 +1,76 @@ +/* +/* + * 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 java.util.Iterator; +import javolution.util.FastMap; +import java.math.BigDecimal; + +import org.ofbiz.entity.*; +import org.ofbiz.base.util.*; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.entity.condition.EntityConditionList; +import org.ofbiz.entity.condition.EntityExpr; +import org.ofbiz.entity.condition.EntityOperator; + + +import org.ofbiz.entity.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.condition.*; +import java.sql.Timestamp; + +fromDate = parameters.get("fromDate"); +workEffortName = parameters.get("workEffortName"); +projectId = parameters.get("projectId"); +userLogin = parameters.get("userLogin"); + +// entry conditions +entryCondition = new LinkedList(); +if (UtilValidate.isNotEmpty(fromDate)) { + entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0")); +} +if (UtilValidate.isNotEmpty(workEffortName)) { + entryCondition.add(new EntityExpr("workEffortName", EntityOperator.LIKE, "%" + workEffortName + "%")); +} + +// get subprojects for a project +if (UtilValidate.isNotEmpty(projectId)) { + entryCondition.add(new EntityExpr("workEffortParentId", EntityOperator.EQUALS, projectId)); +} + +// create project list. +exprList = UtilMisc.toList( + new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROJECT")); +if (UtilValidate.isNotEmpty(entryCondition)) exprList.addAll(entryCondition); +condition = new EntityConditionList(exprList, EntityOperator.AND); +projectIds = delegator.findByCondition("WorkEffort", condition, UtilMisc.toList("workEffortId", "workEffortName"), UtilMisc.toList("workEffortName DESC")); + +// retrieve all project data with the service +projects = new LinkedList(); +p = projectIds.iterator(); +while(p.hasNext()) { + projectId = p.next(); + serviceResult = dispatcher.runSync("getProject", UtilMisc.toMap("userLogin", userLogin, "projectId", projectId.getString("workEffortId"))); + projects.add(serviceResult.get("projectInfo")); +} + +context.put("projects", projects); Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh ------------------------------------------------------------------------------ svn:mime-type = text/plain 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=599260&r1=599259&r2=599260&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Wed Nov 28 20:20:20 2007 @@ -32,14 +32,20 @@ <response name="success" type="view" value="main"/> </request-map> + <request-map uri="ListSubProjects"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListSubProjects"/> + </request-map> + <request-map uri="AddSubProject"> + <security https="true" auth="true"/> + <event type="service" invoke="updateWorkEffort"/> + <response name="error" type="view" value="ListSubProjects"/> + <response name="success" type="view" value="ListSubProjects"/> + </request-map> <request-map uri="FindProject"> <security https="true" auth="true"/> <response name="success" type="view" value="FindProject"/> </request-map> - <request-map uri="FindProjectByRange"> - <security https="true" auth="true"/> - <response name="success" type="view" value="FindProjectByRange"/> - </request-map> <request-map uri="EditProject"> <security https="true" auth="true"/> <response name="success" type="view" value="EditProject"/> @@ -383,8 +389,8 @@ <!-- View Mappings --> <view-map name="main" type="screen" page="component://projectmgr/widget/TaskScreens.xml#MyTasks"/> + <view-map name="ListSubProjects" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#ListSubProjects"/> <view-map name="FindProject" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#FindProject"/> - <view-map name="FindProjectByRange" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#FindProjectByRange"/> <view-map name="EditProject" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#EditProject"/> <view-map name="EditWorkEffort" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#EditProject"/> <view-map name="ChildWorkEfforts" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#ChildWorkEfforts"/> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml?rev=599260&r1=599259&r2=599260&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml Wed Nov 28 20:20:20 2007 @@ -24,7 +24,7 @@ <menu-item name="mytime" title="${uiLabelMap.TimesheetMyTime}"><link target="MyTimesheets"/></menu-item> <menu-item name="mytasks" title="${uiLabelMap.WorkEffortMyTasks}"><link target="MyTasks"/></menu-item> - <menu-item name="projects" title="${uiLabelMap.WorkEffortProjects}"><link target="FindProjectByRange?workEffortTypeId=PROJECT"/></menu-item> + <menu-item name="projects" title="${uiLabelMap.WorkEffortProjects}"><link target="FindProject?workEffortTypeId=PROJECT"/></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> @@ -46,8 +46,7 @@ <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> - <menu-item name="subprojects" title="${uiLabelMap.ProjectMgrSubProjects}"><link target="FindProject?projectId=${parameters.projectId}&workEffortTypeId=PROJECT&workEffortAssocTypeId=WORK_EFF_BREAKDOWN"/></menu-item> - <!-- estimates only on task level menu-item name="projectskills" title="${uiLabelMap.ProjectMgrSkillStandards}"><link target="EditProjectSkills?projectId=${parameters.projectId}"/></menu-item--> + <menu-item name="subprojects" title="${uiLabelMap.ProjectMgrSubProjects}"><link target="ListSubProjects?projectId=${parameters.projectId}"/></menu-item> <menu-item name="treeDetails" title="${uiLabelMap.ProjectMgrTreeDetails}"><link target="ChildWorkEfforts?projectId=${parameters.projectId}&trail=${workEffortId}&workEffortTypeId=PROJECT&workEffortAssocTypeId=WORK_EFF_BREAKDOWN"/></menu-item> </menu> <menu name="TaskTabBar" type="simple" menu-container-style="button-bar tab-bar" default-selected-style="selected"> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=599260&r1=599259&r2=599260&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml Wed Nov 28 20:20:20 2007 @@ -20,55 +20,37 @@ <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> - <screen name="FindProject"> + <screen name="ListSubProjects"> <section> <actions> <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="workEffortId" from-field="parameters.projectId"/> - <set field="parameters.workEffortIdFrom" from-field="parameters.projectId"/> - <set field="projectId" from-field="parameters.projectId"/> - <set field="workEffortTypeId" from-field="parameters.workEffortTypeId"/> - <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/ChildWorkEffort.bsh"/> + <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/> + <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh"/> </actions> <widgets> <decorator-screen name="CommonProjectDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <section> - <condition> - <if-empty field-name="workEffortId"/> - </condition> - <!-- This is the code for the List of Projects --> - <widgets> - <container style="screenlet"> - <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.${titleProperty}}</label></container> - <container style="screenlet-body"> - <container style="button-bar"><link target="EditProject?workEffortTypeId=PROJECT" text="${uiLabelMap.ProjectMgrNewProject}" style="buttontext"/></container> - <include-form name="ListProjects" location="component://projectmgr/widget/forms/ProjectForms.xml"/> - </container> - </container> - </widgets> - <!-- This is the code for the List of subProjects --> - <fail-widgets> - <container style="screenlet"> - <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditSubProject}</label></container> - <container style="screenlet-body"> - <include-form name="ListChildEfforts" location="component://projectmgr/widget/forms/ProjectForms.xml"/> - </container> - </container> - <platform-specific> - <html><html-template location="component://projectmgr/webapp/projectmgr/project/editprojectandassoc.ftl"/></html> - </platform-specific> - </fail-widgets> - </section> + <container style="screenlet"> + <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditSubProject}</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-body"> + <include-form name="AddSubProject" location="component://projectmgr/widget/forms/ProjectForms.xml"/> + </container> + </container> </decorator-section> </decorator-screen> </widgets> </section> </screen> - <screen name="FindProjectByRange"> + <screen name="FindProject"> <section> <actions> <set field="titleProperty" value="PageTitleFindProject"/> @@ -310,31 +292,6 @@ </section> </screen> - <!-- Edit an existing SubTask and their Association--> - <!--screen name="EditTaskAndAssoc"> - <section> - <actions> - <set field="titleProperty" value="PageTitleEditTask"/> - <set field="labelTitleProperty" value="PageTitleEditTask"/> - <set field="tabButtonItem" value="edittask"/> - <set field="donePage" from-field="parameters.DONE_PAGE"/> - <set field="workEffortIdTo" from-field="parameters.workEffortIdTo"/> - <set field="workEffortIdFrom" from-field="parameters.workEffortIdFrom"/> - <set field="fromDate" from-field="parameters.fromDate"/> - <entity-one entity-name="WorkEffort" value-name="task"/> - <entity-one entity-name="WorkEffortAssoc" value-name="workEffortAssoc"/> - </actions> - <widgets> - <decorator-screen name="CommonTaskDecorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://projectmgr/webapp/projectmgr/project/edittaskandassoc.ftl"/></html> - </platform-specific> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen--> <screen name="FindPhase"> <section> <actions> @@ -572,9 +529,8 @@ <screen name="SubProjectsInfo"> <section> <actions> - <set field="parameters.projectId" from-field="parameters.workEffortId"/> - <set field="parameters.workEffortTypeId" value="PROJECT"/> - <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/ChildWorkEffort.bsh"/> + <set field="parameters.projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/> + <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh"/> </actions> <widgets> <container style="screenlet"> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=599260&r1=599259&r2=599260&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Wed Nov 28 20:20:20 2007 @@ -24,7 +24,7 @@ <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="projectName" parameter-name="workEffortName" title="${uiLabelMap.CommonName}*"><text/></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> @@ -53,6 +53,18 @@ <field use-when="project!=null" name="actualStartDate" title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display description="${bsh:project.get("actualStartDate")!=null?project.get("actualStartDate").toString().substring(0,10):"";}"/></field> <field use-when="project!=null" name="actualCompletionDate" title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display description="${bsh:project.get("actualCompletionDate")!=null?project.get("actualCompletionDate").toString().substring(0,10):"";}"/></field> <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="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-options> + </drop-down> + </field> + <field name="add"><submit/></field> </form> <form name="FindProject" type="single" target="FindProjectByRange"> <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><date-time type="date"/></field> |
Free forum by Nabble | Edit this page |