svn commit: r706549 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy widget/CommonScreens.xml 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: r706549 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy widget/CommonScreens.xml widget/forms/ProjectForms.xml

hansbak-2
Author: hansbak
Date: Tue Oct 21 01:14:32 2008
New Revision: 706549

URL: http://svn.apache.org/viewvc?rev=706549&view=rev
Log:
only show active projects on the project mainscreen and only the projects the logged on person is member of

Added:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy   (with props)
Modified:
    ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml

Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy?rev=706549&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy (added)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy Tue Oct 21 01:14:32 2008
@@ -0,0 +1,40 @@
+/*
+/*
+ * 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 org.ofbiz.entity.condition.*;
+
+cond = EntityCondition.makeCondition ("workEffortTypeId", EntityOperator.EQUALS, "PROJECT");
+allProjects = delegator.findList("WorkEffort", cond, (HashSet) ["workEffortId"], ["workEffortName"], null, false);
+
+projects = [];
+allProjects.each { project ->
+ result = dispatcher.runSync("getProject", ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId]);
+ if (result.projectInfo) {
+ if (!result.projectInfo.currentStatusId.equals("PTS_COMPLETED") && !result.projectInfo.currentStatusId.equals("PTS_CANCELLED")) {
+ resultAssign = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : parameters.userLogin.partyId, "workEffortId" : project.workEffortId])
+ if (resultAssign) {
+ projects.add(result.projectInfo);
+ }
+ }
+ }
+}
+if (projects) {
+ context.projects = projects;
+}
\ No newline at end of file

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

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

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

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml?rev=706549&r1=706548&r2=706549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml Tue Oct 21 01:14:32 2008
@@ -294,8 +294,8 @@
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet title="${uiLabelMap.ProjectMgrProjectSummary}" navigation-form-name="ListProjects">
-                            <include-form name="ListProjects" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
+                        <screenlet title="${uiLabelMap.ProjectMgrProjectSummary}" navigation-form-name="ListCurrentProjects">
+                            <include-form name="ListCurrentProjects" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
                         </screenlet>
                     </decorator-section>
                 </decorator-screen>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=706549&r1=706548&r2=706549&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Tue Oct 21 01:14:32 2008
@@ -111,7 +111,6 @@
             <hyperlink description="${resultProject.projectInfo.projectName}" target="projectView?projectId=${resultProject.projectInfo.projectId}"/>
         </field>
         <field name="currentStatusId" map-name="resultProject.projectInfo" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/></field>
-        <field name="priority" map-name="resultProject.projectInfo" title="${uiLabelMap.CommonPriority}"><display/></field>
         <field name="estimatedStartDate" map-name="resultProject.projectInfo" title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display type="date"/></field>
         <field name="estimatedCompletionDate" map-name="resultProject.projectInfo" title="${uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display type="date"/></field>
         <field name="actualStartDate" map-name="resultProject.projectInfo" title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display type="date"/></field>
@@ -120,6 +119,23 @@
         <field name="actualHours" map-name="resultProject.projectInfo" title="${uiLabelMap.ProjectMgrActualHours}"><display/></field>
         <field name="createdStamp" title="${uiLabelMap.FormFieldTitle_createdDate}"><display type="date"/></field>
     </form>                                            
+    <form name="ListCurrentProjects" type="list" list-name="projects" paginate-target="main"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <actions>
+            <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy"/>
+        </actions>
+        <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}" widget-style="buttontext">
+            <hyperlink 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="estimatedStartDate" title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display type="date"/></field>
+        <field name="estimatedCompletionDate" title="${uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display type="date"/></field>
+        <field name="actualStartDate" title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display type="date"/></field>
+        <field name="actualCompletionDate" title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display type="date"/></field>
+        <field name="plannedHours" title="${uiLabelMap.ProjectMgrPlannedHours}"><display/></field>
+        <field name="actualHours" title="${uiLabelMap.ProjectMgrActualHours}"><display/></field>
+        <field name="createdStamp" title="${uiLabelMap.FormFieldTitle_createdDate}"><display type="date"/></field>
+    </form>
     <form name="EditSubProjects" list-name="projects" type="list" target="RemoveSubProject"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <actions>