ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hans...@apache.org
Subject svn commit: r607849 - in /ofbiz/trunk/specialpurpose/projectmgr: entitydef/ servicedef/ webapp/projectmgr/WEB-INF/actions/ widget/ widget/forms/
Date Tue, 01 Jan 2008 14:10:01 GMT
Author: hansbak
Date: Tue Jan  1 06:10:01 2008
New Revision: 607849

URL: http://svn.apache.org/viewvc?rev=607849&view=rev
Log:
added more security checks, improved the task find screen, added a new view to accomodate
this, changed project find screen

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml
    ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjects.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml?rev=607849&r1=607848&r2=607849&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml Tue Jan  1 06:10:01 2008
@@ -26,6 +26,7 @@
   <!-- ========================================================= -->
 
     <entity-group group="org.ofbiz" entity="ProjectPartyAndPhaseAndTask"/>
+    <entity-group group="org.ofbiz" entity="ProjectAndPhaseAndTaskParty"/>
     <entity-group group="org.ofbiz" entity="ProjectPartyAndPhase"/>
     <entity-group group="org.ofbiz" entity="ProjectAndPhaseAndTask"/>
     <entity-group group="org.ofbiz" entity="TimesheetAndTimeEntry"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml?rev=607849&r1=607848&r2=607849&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml Tue Jan  1 06:10:01 2008
@@ -88,6 +88,45 @@
     </relation>
   </view-entity>
   
+  <view-entity entity-name="ProjectAndPhaseAndTaskParty"
+    package-name="org.ofbiz.workeffort.project"
+    title="WorkEffort for use in party -> project -> phase -> task">
+    <member-entity entity-alias="WEP" entity-name="WorkEffort"/>
+    <member-entity entity-alias="WEPH" entity-name="WorkEffort"/>
+    <member-entity entity-alias="WET" entity-name="WorkEffort"/>
+    <member-entity entity-alias="WEPA" entity-name="WorkEffortPartyAssignment"/>
+    <alias-all entity-alias="WEPA">
+      <exclude field="facilityId"/>
+      <exclude field="workEffortId"/>
+    </alias-all>
+    <alias-all entity-alias="WET"/>
+    <alias entity-alias="WEP" field="workEffortId" name="projectId"/>
+    <alias entity-alias="WEP" field="workEffortName" name="projectName"/>
+    <alias entity-alias="WEPH" field="workEffortId" name="phaseId"/>
+    <alias entity-alias="WEPH" field="workEffortName" name="phaseName"/>
+    <view-link entity-alias="WEP" rel-entity-alias="WEPH">
+      <key-map field-name="workEffortId" rel-field-name="workEffortParentId"/>
+    </view-link>
+    <view-link entity-alias="WEPH" rel-entity-alias="WET">
+      <key-map field-name="workEffortId" rel-field-name="workEffortParentId"/>
+    </view-link>
+    <view-link entity-alias="WET" rel-entity-alias="WEPA">
+      <key-map field-name="workEffortId"/>
+    </view-link>
+    <relation type="one-nofk" rel-entity-name="PartyNameView">
+      <key-map field-name="partyId"/>
+    </relation>
+    <relation type="many" rel-entity-name="TimeEntry">
+      <key-map field-name="workEffortId"/>
+    </relation>
+    <relation type="many" rel-entity-name="WorkEffortPartyAssignment">
+      <key-map field-name="workEffortId"/>
+    </relation>
+    <relation type="many" rel-entity-name="WorkEffortSkillStandard">
+      <key-map field-name="workEffortId"/>
+    </relation>
+  </view-entity>
+  
   <view-entity entity-name="ProjectAndPhaseAndTask"
     package-name="org.ofbiz.workeffort.project"
     title="WorkEffort for use in project -> phase -> task">

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=607849&r1=607848&r2=607849&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Tue Jan  1 06:10:01 2008
@@ -52,6 +52,7 @@
     <service name="updateTimeEntryByWorkeffort" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="updateTimeEntryByWorkeffort">
         <description>Update workeffort by workeffort and timesheetId </description>
+        <permission-service service-name="projectMgrPermission" main-action="UPDATE"/>
         <attribute name="timesheetId" type="String" mode="IN" optional="false"/>
         <attribute name="workEffortId" type="String" mode="IN" optional="true"/><!--
when empty will be ignored -->
         <attribute name="hoursDay0" type="Double" mode="IN" optional="true"/>
@@ -66,6 +67,7 @@
     <service name="getProject" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getProject">
         <description>Get project information and realated phase and task info.</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
         <attribute name="projectInfo" type="java.util.Map" mode="OUT" optional="true"/>
     </service>
@@ -107,24 +109,28 @@
     <service name="copyProject" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="copyProject">
         <description>Copy a project planning data but ignore the actual data.</description>
+        <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="false"/>
     </service>
     
     <service name="copyProjectToTemplate" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="copyProjectToTemplate">
         <description>Copy a project planning data to a template project.</description>
+        <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="false"/>
     </service>
     
     <service name="scheduleProject" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="scheduleProject">
         <description>(re) calculate the estimated start and enddates of tasks within
a project</description>
+        <permission-service service-name="projectMgrPermission" main-action="UPDATE"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
     </service>
     
     <service name="getProjectIdAndName" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getProjectIdAndName">
         <description>Get the projectId and Name when a phase or task is provided.</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
         <attribute name="taskId" type="String" mode="IN" optional="true"/>
         <attribute name="phaseId" type="String" mode="IN" optional="true"/>
         <attribute name="projectId" type="String" mode="OUT" optional="true"/>
@@ -136,6 +142,7 @@
     <service name="getProjectPhaseList" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getProjectPhaseList">
         <description>Get project phase information and related task info.</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
         <attribute name="phaseList" type="List" mode="OUT" optional="true"/>
     </service>
@@ -143,6 +150,7 @@
     <service name="getProjectTaskList" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getProjectTaskList">
         <description>Get project phase information and related task info.</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
         <attribute name="taskList" type="List" mode="OUT" optional="true"/>
     </service>
@@ -150,6 +158,7 @@
     <service name="getProjectTask" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getProjectTask">
         <description>Get project task information and related timesheet info.</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
         <attribute name="hoursPartyId" type="String" mode="IN" optional="true"/>
         <attribute name="taskId" type="String" mode="INOUT" optional="true"/>
         <attribute name="projectId" type="String" mode="OUT" optional="true"/>
@@ -160,6 +169,7 @@
     <service name="getProjectsByParties" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getProjectsByParties">
         <description>Get project information by party</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
       
         <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
         <attribute name="partyId" type="String" mode="INOUT" optional="true"/>
         <attribute name="projectParties" type="List" mode="OUT" optional="true"/>
@@ -168,6 +178,7 @@
     <service name="getTasksByParties" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getTasksByParties">
         <description>Get project information by party</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>
         <attribute name="workEffortId" type="String" mode="INOUT" optional="true"/>
         <attribute name="partyId" type="String" mode="INOUT" optional="true"/>
         <attribute name="taskParties" type="List" mode="OUT" optional="true"/>

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=607849&r1=607848&r2=607849&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
Tue Jan  1 06:10:01 2008
@@ -47,14 +47,13 @@
 projectId = parameters.get("projectId"); 
 subProjects = parameters.get("subProjects"); //  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"));
 
 if (!UtilValidate.isEmpty(fromDate)) {
-    conditions.add(new EntityExpr("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate
+ " 00:00:00.0"));
+    conditions.add(new EntityExpr("lastStatusUpdate", EntityOperator.GREATER_THAN_EQUAL_TO,
fromDate + " 00:00:00.0"));
     }
 
 
@@ -83,11 +82,19 @@
 		}
  	}
 }
+
+
+entityName = "WorkEffort";
+if (security.hasPermission("PROJECTMGR_ROLE_VIEW", session)) {
+	conditions.add(new EntityExpr("partyId", EntityOperator.EQUALS, userLogin.getString("partyId")));
+	entityName = "WorkEffortAndPartyAssign";
+}
+
     
 allConditions = new EntityConditionList( conditions, EntityOperator.AND );
-orderBy = UtilMisc.toList("createdStamp DESC");
+orderBy = UtilMisc.toList("lastStatusUpdate DESC");
 projects = new LinkedList();
-listProjects = delegator.findByConditionCache("WorkEffort", allConditions, UtilMisc.toList("workEffortId"),
orderBy);
+listProjects = delegator.findByConditionCache(entityName, allConditions, UtilMisc.toList("workEffortId"),
orderBy);
 
 if (!UtilValidate.isEmpty(listProjects)) {
     itr = listProjects.iterator();

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml?rev=607849&r1=607848&r2=607849&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml Tue Jan  1 06:10:01 2008
@@ -26,11 +26,31 @@
         <menu-item name="mytime" title="${uiLabelMap.TimesheetMyTime}"><link target="MyTimesheet"/></menu-item>
         <menu-item name="projects" title="${uiLabelMap.WorkEffortProjects}"><link
target="FindProject"/></menu-item>
         <menu-item name="task" title="${uiLabelMap.ProjectMgrTasks}"><link target="FindTask"/></menu-item>
-        <menu-item name="resources" title="${uiLabelMap.ProjectMgrResources}"><link
target="FindResource"/></menu-item>
-        <menu-item name="timesheet" title="${uiLabelMap.Timesheet}"><link target="FindTimeSheet"/></menu-item>
-        <menu-item name="SkillType" title="${uiLabelMap.ProjectMgrSkillType}"><link
target="findSkillTypes"/></menu-item>
+        <menu-item name="resources" title="${uiLabelMap.ProjectMgrResources}">
+            <condition>
+                <if-has-permission permission="PARTYMGR_ADMIN"/>
+            </condition>
+            <link target="FindResource"/>
+        </menu-item>
+        <menu-item name="timesheet" title="${uiLabelMap.Timesheet}">
+            <condition>
+                <if-has-permission permission="PARTYMGR_ADMIN"/>
+            </condition>
+            <link target="FindTimeSheet"/>
+        </menu-item>
+        <menu-item name="SkillType" title="${uiLabelMap.ProjectMgrSkillType}">
+            <condition>
+                <if-has-permission permission="PARTYMGR_ADMIN"/>
+            </condition>
+            <link target="findSkillTypes"/>
+        </menu-item>
         <!--menu-item name="calendar" title="${uiLabelMap.WorkEffortCalendar}"><link
target="day"/></menu-item-->
-        <menu-item name="request" title="${uiLabelMap.WorkEffortRequestList}"><link
target="requestlist"/></menu-item>
+        <menu-item name="request" title="${uiLabelMap.WorkEffortRequestList}">
+            <condition>
+                <if-has-permission permission="PARTYMGR_ADMIN"/>
+            </condition>
+            <link target="requestlist"/>
+        </menu-item>
         
         <menu-item name="help" title="Help" align-style="col-right">
             <link target="http://docs.ofbiz.org/display/OFBENDUSER/Project+Manager+Application+Roles?decorator=printable"
url-mode="plain" target-window="new"/>
@@ -48,51 +68,142 @@
         <actions>
             <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/>
         </actions>
-        <menu-item name="ganttchart" title="${uiLabelMap.ProjectMgrGanttChart}"><link
target="ganttChart?projectId=${projectId}"/></menu-item>
-        <menu-item name="projectView" title="${uiLabelMap.ProjectMgrProjectSummary}"><link
target="projectView?projectId=${projectId}"/></menu-item>
-        <menu-item name="editproject" title="${uiLabelMap.ProjectMgrEditPoject}"><link
target="EditProject?projectId=${projectId}"/></menu-item>
-        <menu-item name="phases" title="${uiLabelMap.ProjectMgrPhases}"><link target="FindPhase?projectId=${projectId}"/></menu-item>
-        <menu-item name="tasks" title="${uiLabelMap.ProjectMgrTasks}"><link target="EditProjectTasks?projectId=${projectId}"/></menu-item>
       
-        <menu-item name="parties" title="${uiLabelMap.ProjectMgrResources}"><link
target="ListWorkEffortPartyAssigns?projectId=${projectId}"/></menu-item>
-        <menu-item name="notes" title="${uiLabelMap.CommonNotes}"><link target="EditWorkEffortNotes?projectId=${projectId}"/></menu-item>
-        <menu-item name="subprojects" title="${uiLabelMap.ProjectMgrSubProjects}"><link
target="ListSubProjects?projectId=${projectId}&amp;subProjects=true"/></menu-item>
-        <menu-item name="billing" title="${uiLabelMap.ProjectMgrBilling}"><link
target="projectBilling?projectId=${projectId}"/></menu-item>
-        <!--menu-item name="treeDetails" title="${uiLabelMap.ProjectMgrTreeDetails}"><link
target="ChildWorkEfforts?projectId=${projectId}&amp;trail=${workEffortId}&amp;workEffortTypeId=PROJECT&amp;workEffortAssocTypeId=WORK_EFF_BREAKDOWN"/></menu-item-->
+        <menu-item name="ganttchart" title="${uiLabelMap.ProjectMgrGanttChart}">
+            <condition>
+                    <if-has-permission permission="PARTYMGR_VIEW"/>
+            </condition>
+            <link target="ganttChart?projectId=${projectId}"/>
+        </menu-item>
+        <menu-item name="projectView" title="${uiLabelMap.ProjectMgrProjectSummary}">
+            <condition>
+                <if-has-permission permission="PARTYMGR_VIEW"/>
+            </condition>
+            <link target="projectView?projectId=${projectId}"/>
+        </menu-item>
+        <menu-item name="editproject" title="${uiLabelMap.ProjectMgrEditPoject}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="EditProject?projectId=${projectId}"/>
+        </menu-item>
+        <menu-item name="phases" title="${uiLabelMap.ProjectMgrPhases}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="FindPhase?projectId=${projectId}"/>
+        </menu-item>
+        <menu-item name="tasks" title="${uiLabelMap.ProjectMgrTasks}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="EditProjectTasks?projectId=${projectId}"/>
+        </menu-item>        
+        <menu-item name="parties" title="${uiLabelMap.ProjectMgrResources}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="ListWorkEffortPartyAssigns?projectId=${projectId}"/>
+        </menu-item>
+        <menu-item name="notes" title="${uiLabelMap.CommonNotes}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="EditWorkEffortNotes?projectId=${projectId}"/>
+        </menu-item>
+        <menu-item name="subprojects" title="${uiLabelMap.ProjectMgrSubProjects}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="ListSubProjects?projectId=${projectId}&amp;subProjects=true"/>
+        </menu-item>
+        <menu-item name="billing" title="${uiLabelMap.ProjectMgrBilling}">
+            <condition>
+                <and>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_COMPLETED"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_ON_HOLD"/>
+                    <if-compare field-name="project.currentStatusId" operator="not-equals"
value="PTS_CANCELED"/>
+                </and>
+            </condition>
+            <link target="projectBilling?projectId=${projectId}"/>
+        </menu-item>
     </menu>
     <menu name="ProjectSubTabBar" type="simple" menu-container-style="button-bar button-style-2"
default-selected-style="selected">
         <actions>
             <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/>
         </actions>
         <menu-item name="newProject" title="${uiLabelMap.ProjectMgrNewProject}">
-            <condition>
-                <not>
-                    <if-empty field-name="project"/>
-                </not>
+            <condition>
+                <and>
+                    <not>
+                        <if-empty field-name="project"/>
+                    </not>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                </and>
             </condition>
             <link target="EditProject"></link>
         </menu-item>
         <menu-item name="copyProject" title="${uiLabelMap.ProjectMgrCopyProject}">
-            <condition>
-                <not>
-                    <if-empty field-name="project"/>
-                </not>
-            </condition>
+            <condition>
+                <and>
+                    <not>
+                        <if-empty field-name="project"/>
+                    </not>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                </and>
+            </condition>
             <link target="copyProject?projectId=${projectId}"></link>
         </menu-item>
         <menu-item name="schedule" title="${uiLabelMap.ProjectMgrSchedule}">
-            <condition>
-                <not>
-                    <if-empty field-name="project"/>
-                </not>
-            </condition>
+            <condition>
+                <and>
+                    <not>
+                        <if-empty field-name="project"/>
+                    </not>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                </and>
+            </condition>
             <link target="scheduleProject?projectId=${projectId}"></link>
         </menu-item>
         <menu-item name="copyProjectToTemplate" title="${uiLabelMap.ProjectMgrSaveAsTemplate}">
-            <condition>
-                <not>
-                    <if-empty field-name="project"/>
-                </not>
-            </condition>
+            <condition>
+                <and>
+                    <not>
+                        <if-empty field-name="project"/>
+                    </not>
+                    <if-has-permission permission="PARTYMGR_ROLE_UPDATE"/>
+                </and>
+            </condition>
             <link target="copyProjectToTemplate?projectId=${projectId}"></link>
         </menu-item>
     </menu>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml?rev=607849&r1=607848&r2=607849&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml Tue Jan  1 06:10:01 2008
@@ -164,15 +164,7 @@
             <actions>
                 <set field="titleProperty" value="PageTitleFindTask"/>
                 <set field="headerItem" value="task"/>
-                <set field="labelTitleProperty" value="ProjectMgrMyTasks"/>
-                <entity-and entity-name="WorkEffortAndPartyAssign" list-name="tasks">
-                    <field-map field-name="partyId" env-name="userLogin.partyId"/>
-                    <field-map field-name="workEffortTypeId" value="TASK"/>
-                </entity-and>
-                <entity-one entity-name="WorkEffort" value-name="task">
-                    <field-map field-name="workEffortId" value="dummy"/>
-                </entity-one>
-                <set field="myTask" value="notNull"/>
+                <set field="labelTitleProperty" value="ProjectMgrListTasks"/>
             </actions>                                                
             <widgets>  
                 <decorator-screen name="CommonMyTaskDecorator" location="${parameters.mainDecoratorLocation}">
@@ -182,8 +174,31 @@
                                 <container style="screenlet">
                                     <container style="screenlet-title-bar"><label
style="boxhead">${uiLabelMap.PageTitleFindTask}</label></container>       
                        
                                     <container style="screenlet-body"> 
-                                        <include-form name="FindTask" location="component://projectmgr/widget/forms/TaskForms.xml"/>
-                                        <include-form name="ListTasks" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                        <include-form name="FindTask" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                        <section>
+                                            <condition>
+                                                <if-empty field-name="parameters.partyId"/>
+                                            </condition>
+                                            <actions>
+                                                <set field="entityName" value="ProjectAndPhaseAndTask"/>
+                                            </actions>
+                                            <widgets>
+                                                <include-form name="ListTasks" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                            </widgets>
+                                        </section>
+                                        <section>
+                                            <condition>
+                                                <not>
+                                                    <if-empty field-name="parameters.partyId"/>
+                                                </not>
+                                            </condition>
+                                            <actions>
+                                                <set field="entityName" value="ProjectAndPhaseAndTaskParty"/>
+                                            </actions>
+                                            <widgets>
+                                                <include-form name="ListTasks" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                            </widgets>
+                                        </section>
                                     </container>
                                 </container>
                                                                                 

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=607849&r1=607848&r2=607849&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Tue Jan  1 06:10:01 2008
@@ -167,7 +167,16 @@
         <field name="hideSearch"><hidden value="Y"/></field>
         <field name="workEffortTypeId"><hidden value="TASK"/></field>
         <field name="workEffortId"  title="${uiLabelMap.ProjectMgrTaskId}"><text-find
default-option="contains" ignore-case="true"/></field>
-        <field name="workEffortName" title="${uiLabelMap.ProjectMgrTaskName}"><text-find
default-option="contains" ignore-case="true"/></field>
+        <field name="workEffortName" title="${uiLabelMap.ProjectMgrTaskName}"><text-find
default-option="contains" ignore-case="true"/></field>
+        <field name="partyId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="PartyRoleAndPartyDetail" description="${firstName}
${middleName} ${lastName}">
+                    <entity-constraint name="roleTypeId" value="PROJECT_TEAM"/>
+                    <entity-order-by field-name="lastName"/>
+                    <entity-order-by field-name="groupName"/>
+                </entity-options>    
+            </drop-down>
+        </field>
         <field name="projectName"><text-find default-option="contains" ignore-case="true"/></field>
         <field name="estimatedStartDate" title="${uiLabelMap.CommonFromDate}"><date-find/></field>
         <field name="find" title="${uiLabelMap.CommonFind}"><submit/></field>
@@ -176,28 +185,23 @@
         <actions>
             <service service-name="performFind" result-map-name="result" result-map-list-name="listIt">
                 <field-map field-name="inputFields" env-name="parameters"/>
-                <field-map field-name="entityName" value="WorkEffort"/>
-                <field-map field-name="orderBy" value="lastUpdatedStamp DESC"/>
+                <field-map field-name="entityName" value="${entityName}"/>
+                <field-map field-name="orderBy" value="lastStatusUpdate DESC"/>
             </service>
         </actions>
         <row-actions>
             <service service-name="getProjectTask" result-map-name="result">
                 <field-map field-name="taskId" env-name="workEffortId"/>
+                <field-map field-name="hoursPartyId" env-name="partyId"/>
             </service>
             <set field="plannedHours" from-field="result.taskInfo.plannedHours"/>
             <set field="actualHours" from-field="result.taskInfo.actualTotalHours"/>
             <set field="currentStatusId" from-field="result.taskInfo.currentStatusId"/>
-            <service service-name="getProjectIdAndName" result-map-name="resultProject">
-                <field-map field-name="taskId" env-name="workEffortId"/>
-            </service>
-            <set field="projectName" from-field="resultProject.projectName"/>
-            <set field="projectId" from-field="resultProject.projectId"/>
-            <set field="phaseName" from-field="resultProject.phaseName"/>
         </row-actions>
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskId}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${workEffortName}[${workEffortId}]"
target="taskView?workEffortId=${workEffortId}"/>
         </field>
-        <field name="resultProject.phaseName" title="${uiLabelMap.ProjectMgrPhaseName}">
+        <field name="phaseName" title="${uiLabelMap.ProjectMgrPhaseName}">
             <hyperlink also-hidden="false" description="${phaseName}" target="FindPhase?projectId=${projectId}"/>
         </field>
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}" widget-style="buttontext">



Mime
View raw message