svn commit: r707261 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.xml script/org/ofbiz/project/ProjectSimpleEvents.xml webapp/projectmgr/WEB-INF/controller.xml widget/Menus.xml

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

svn commit: r707261 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.xml script/org/ofbiz/project/ProjectSimpleEvents.xml webapp/projectmgr/WEB-INF/controller.xml widget/Menus.xml

hansbak-2
Author: hansbak
Date: Wed Oct 22 20:53:11 2008
New Revision: 707261

URL: http://svn.apache.org/viewvc?rev=707261&view=rev
Log:
add a set to 'complete' button on the detailed task screen

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml?rev=707261&r1=707260&r2=707261&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml Wed Oct 22 20:53:11 2008
@@ -879,6 +879,10 @@
         <value xml:lang="th">หยุดไว้ชั่วคราว</value>
         <value xml:lang="zh">暂停</value>
     </property>
+    <property key="ProjectMgrSetComplete">
+        <value xml:lang="en">Complete</value>
+        <value xml:lang="th">เสร็จสมบูรณ์</value>
+    </property>
     <property key="ProjectMgrSkillStandards">
         <value xml:lang="en">Skill Standards</value>
         <value xml:lang="fr">Compétences standards</value>

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml?rev=707261&r1=707260&r2=707261&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml Wed Oct 22 20:53:11 2008
@@ -68,4 +68,30 @@
         <set-service-fields service-name="createWorkEffortRequest" map-name="parameters" to-map-name="connectMap"/>
         <call-service service-name="createWorkEffortRequest" in-map-name="connectMap"/>
     </simple-method>
+    <simple-method method-name="setTaskStatusToComplete" short-description="Set the task status to complete, if resources assigned that status will also be set to complete">
+        <entity-one entity-name="WorkEffort" value-name="workEffort"/>
+        <if-empty field="workEffort">
+            <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskNotFound"/></add-error>
+        </if-empty>
+        <if-compare field="workEffort.currentStatusId" value="PTS_CREATED" operator="not-equals">
+            <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskStatusWrong"/></add-error>
+        </if-compare>
+        <check-errors/>
+        <entity-and entity-name="WorkEffortPartyAssignment" list-name="assigns" filter-by-date="true">
+            <field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
+        </entity-and>
+        <!-- if all assigns are complete the task will be set to complete -->
+        <if-not-empty field="assigns">
+            <iterate entry-name="assign" list-name="assigns">
+                <set-service-fields service-name="updateTaskAssigment" map-name="assign" to-map-name="upd"/>
+                <set field="upd.statusId" value="PAS_COMPLETED"/>
+                <call-service service-name="updateTaskAssigment" in-map-name="upd"/>
+            </iterate>
+            <else>
+                <set-service-fields service-name="updateWorkEffort" map-name="parameters" to-map-name="upd"/>
+                <set field="upd.currentStatusId" value="PTS_COMPLETED"/>
+                <call-service service-name="updateWorkEffort" in-map-name="upd"/>
+            </else>
+        </if-not-empty>
+    </simple-method>
 </simple-methods>

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=707261&r1=707260&r2=707261&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Wed Oct 22 20:53:11 2008
@@ -157,6 +157,11 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="EditTaskPartyAssigns"/>
     </request-map>
+    <request-map uri="setTaskStatusToComplete">
+        <security https="true" auth="true"/>
+        <event type="simple" invoke="setTaskStatusToComplete" path="org/ofbiz/project/ProjectSimpleEvents.xml"/>
+        <response name="success" type="view" value="taskView"/>
+    </request-map>
     <request-map uri="setTaskStatus">
         <security https="true" auth="true"/>
         <event type="service" invoke="updateWorkEffort"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml?rev=707261&r1=707260&r2=707261&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml Wed Oct 22 20:53:11 2008
@@ -294,13 +294,20 @@
             <condition>
                 <and>
                     <not><if-empty field-name="workEffort"/></not>
-                    <if-compare field-name="workEffort.currentStatusId" operator="not-equals" value="PTS_CANCELLED"/>
-                    <if-compare field-name="workEffort.currentStatusId" operator="not-equals" value="PTS_ON_HOLD"/>
-                    <if-compare field-name="workEffort.currentStatusId" operator="not-equals" value="PTS_COMPLETED"/>
+                    <if-compare field-name="workEffort.currentStatusId" operator="equals" value="PTS_CREATED"/>
                 </and>
             </condition>
             <link target="setTaskStatus?workEffortId=${workEffortId}&amp;currentStatusId=PTS_ON_HOLD"/>
         </menu-item>
+        <menu-item name="setcomplete" title="${uiLabelMap.ProjectMgrSetComplete}" >
+            <condition>
+                <and>
+                    <not><if-empty field-name="workEffort"/></not>                    
+                    <if-compare field-name="workEffort.currentStatusId" operator="equals" value="PTS_CREATED"/>
+                </and>
+            </condition>
+            <link target="setTaskStatusToComplete?workEffortId=${workEffortId}"/>
+        </menu-item>
         <menu-item name="release" title="${uiLabelMap.ProjectMgrRelease}" >
             <condition>
                 <and>
@@ -314,8 +321,7 @@
             <condition>
                 <and>
                     <not><if-empty field-name="workEffort"/></not>
-                    <if-compare field-name="workEffort.currentStatusId" operator="not-equals" value="PTS_COMPLETED"/>
-                    <if-compare field-name="workEffort.currentStatusId" operator="not-equals" value="PTS_CANCELLED"/>
+                    <if-compare field-name="workEffort.currentStatusId" operator="equals" value="PTS_CREATED"/>
                 </and>
             </condition>
             <link target="setTaskStatus?workEffortId=${workEffortId}&amp;currentStatusId=PTS_CANCELLED"/>